I ran python setup.py install
in a Windows XP console, and it reported as follows:
running install running build running build_py running build_ext warning: GMP library not found; Not building Crypto.PublicKey._fastmath. building 'Crypto.Random.OSRNG.winrandom' extension error: None
When I try to run a script with import Crypto.Cipher.AES
, it doesn't work, saying:
ImportError: cannot import name AES
How can I fix this?
PyCrypto is written and tested using Python version 2.1 through 3.3. Python 1.5. 2 is not supported. The modules are packaged using the Distutils, so you can simply run “python setup.py build” to build the package, and “python setup.py install” to install it.
On windows, it may just be easier installing PyCrypto via a prebuilt windows installer. The Voidspace site has PyCrypto 2.1 and 2.3 installers for Python 2.2-2.7.
For other people like me on 64 bit windows 7:
Short version: Follow this instructions.
Long version:
Install VC++ 2008 SP1 Express. you can get it from here.
You also need the Windows SDK, specifically the Win7 + Net 3.5 SDK.
Maybe the issue was already solved in your python version, if not get the diff file from the issue page
download patch.py (or any other tool to patch diff files)
if you downloaded the patch.py and diff file in c:\Python27
just run:
python patch-11.01.py vcvars3.diff
Finally install using pip:
pip install pycrypto
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With