PyCrypto on python 3.5

前端 未结 5 1341
伪装坚强ぢ
伪装坚强ぢ 2020-12-07 19:04

I found some PyCrypto installers for Python 3.3 and 3.4, but nothing for Python 3.5.

When I try to install PyCrypton using pip install, it says:

相关标签:
5条回答
  • 2020-12-07 19:45

    That warning shouldn't stop the build, more likely you are lacking the Visual Studio 2015 compiler which is necessary to build binary extensions (which PyCrypto has). See the Python Packaging User Guide for which compiler you need for your version of Python.

    The reason you need the compiler is PyCrypto only offers a Source Distribution officially. So, you have two options for installing PyCrypto:

    1. Build from source:

    This is actually fairly simple, but it requires that you install some extra software. Again, refer to the Python Packaging User Guide linked above to find the suitable compiler for your version of Python. I think that there is an option to only install the relevant compiler for Python if you do a custom install of Visual Studio.

    Then, after the installation is completed, and you probably had to restart your computer, you should be able to simply run pip install pycrypto and pip will download the source and compile it for you.

    If you also installed wheel (pip install wheel) then pip will create a wheel from the source and cache it, which is how I created the wheels that I'm sharing in option 2.

    2. Install a Built Distribution from a 3rd party

    I happen to be a 3rd party and have shared wheels I compiled for PyCrypto 2.6.1 w/ Python 3.5 for 32 and 64-bit Windows on my GitHub repo. I included installation instructions on the readme of that repo.

    If you're looking for a built distribution for an older version of Python and/or PyCrypto, I've also linked to Voidspace on my repo's readme (sorry, I'm limited to 2 links here).

    0 讨论(0)
  • 2020-12-07 19:49

    Use pycryptodome instead! It is a project still maintained (june 2017) and includes the functions of pycrypto for python 3.xx (It worked for me on python 3.6)

    Project Page:

    https://www.pycryptodome.org/en/latest/index.html

    0 讨论(0)
  • 2020-12-07 19:49

    Simple solution for Python 3.x version:

    easy_install http://www.voidspace.org.uk/python/pycrypto-2.6.1/pycrypto-2.6.1.win-amd64-py3.4.exe
    
    0 讨论(0)
  • 2020-12-07 19:57

    Use this post as a reference to do this procedure over Windows systems: http://codeyarns.com/2012/04/28/python-version-not-found-in-registry-error/

    Using that, we can do this:

    1. Using the Windows Run dialog, open the regedit program.
    2. Export from HKEY_LOCAL_MACHINE\SOFTWARE\Python (python_install_35.reg). Go to this location and execute "export" in the context menu.
    3. Edit the reg file and replace HKEY_LOCAL_MACHINE with HKEY_CURRENT_USER
    4. Execute a console (cmd) prompt as admin and execute regedit python_install_35.reg
    5. Add the entries to the registry
    6. See the modified entries with regedit and change HKEY_CURRENT_USER\SOFTWARE\Python\PythonCore\3.5 to HKEY_CURRENT_USER\SOFTWARE\Python\PythonCore\3.3.
    7. Re-run the installer
    0 讨论(0)
  • 2020-12-07 20:00

    You can try PyCryptodome, a fork of PyCrypto. It has Windows wheels for Python 3.5.

    0 讨论(0)
提交回复
热议问题