Original address: https://gxnotes.com/article/198426.html
Problem description
I found some pycrypto installers for Python 3.3 and 3.4, but not any Python 3.5.
When I try to use pip install
the install Pycrypton, it says:
or MPIR library not found; Not building Crypto.PublicKey._fastmath.
Is there a way to install Pycrypto on Python 3.5 in Windows 10? Thank you!
The best solution for your ideas
This warning should not stop building, and it is more likely that you are missing the visual Studio 2015 compiler that built the binary extension (pycrypto). See Python Packaging User Guide for the compiler you need for your Python version.
The reason you need the compiler is that Pycrypto only provides formal source code distribution. So, you have two options for installing Pycrypto:
Build from Source:
This is actually quite simple, but it needs to install some extra software. Once again, refer to the Python Wrapper user guide above, and find the right compiler for your Python version. I think you can install Python-related compilers only if you install a custom installation of Visual Studio.
Then, after the installation is complete, you may have to restart the computer, you should be able to run pip install pycrypto
it easily, and Pip will download the source and compile it for you.
If you also have a wheel ( pip install wheel
) installed, Pip will create a wheel from the source and cache it, which is how I created the wheel I shared in option 2.
2. Installing a built-in release from a third party
I happen to be a third party and a shared wheel compiled for Pycrypto 2.6.1 W/python 3.5 for 32-bit and 64-bit Windows on my GitHub repo. I included the installation instructions in this repo Readme file.
If you are looking for an older version of Python and/or Pycrypto's built-in distribution, I also link to voidspace in my repo Readme file (sorry, I'm limited to 2 links here).
Second best solution to the idea
Use Pycryptodome instead! It is a project that remains (June 2017), including Python 3.xx's pycrypto feature (it works for me on Python 3.6)
Project page:
Https://www.pycryptodome.org/en/latest/index.html
Reference documents
Pycrypto python 3.5--turn