Pregunta

Corrí python setup.py install en un Windows XP de la consola, y se informó de la siguiente manera:

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

Cuando intento ejecutar una secuencia de comandos con import Crypto.Cipher.AES, no funciona, diciendo:

ImportError: cannot import name AES

¿Cómo puedo solucionar este problema?

¿Fue útil?

Solución

En las ventanas, que sólo puede ser más fácil de instalar PyCrypto a través de un instalador de ventanas prediseñados. El sitio de Voidspace tiene PyCrypto 2.1 y 2.3 instaladores para Python 2,2-2,7 .

Otros consejos

Para otras personas como yo en la versión de 64 bits de windows 7:

Versión corta:Siga este instrucciones.

Versión larga:

Instalar VC++ 2008 Express SP1.usted puede obtener de aquí.

Usted también necesita el SDK de Windows, específicamente el Win7 + Net 3.5 SDK.

Tal vez el problema ya fue resuelto en su versión de python, si no consigue el archivo de diferencias a partir de la página

descargar patch.py (o cualquier otra herramienta a la revisión de los archivos diff)

si has descargado el patch.py y archivo de diferencias en c:\Python27 sólo tiene que ejecutar:

python patch-11.01.py vcvars3.diff

Finalmente instalar usando pip:

pip install pycrypto

Es posible usar PyPM instalar (paquete binario de pre-construidos ) pycrypto:

C:> pypm install pycrypto
Ready to perform these actions:
The following packages will be installed:
 pycrypto-2.0.1
Get: [pypm.activestate.com] pycrypto 2.0.1-1
Installing pycrypto-2.0.1

Para una lista de los archivos instalados, escriba:

C:> pypm files pycrypto
C:\Users\sridharr\AppData\Roaming\Python\Python26
C:\Users\sridharr\AppData\Roaming\Python\Python26\site-packages
C:\Users\sridharr\AppData\Roaming\Python\Python26\site-packages\Crypto
C:\Users\sridharr\AppData\Roaming\Python\Python26\site-packages\Crypto\Cipher
C:\Users\sridharr\AppData\Roaming\Python\Python26\site-packages\Crypto\Cipher\AES.pyd
C:\Users\sridharr\AppData\Roaming\Python\Python26\site-packages\Crypto\Cipher\ARC2.pyd
C:\Users\sridharr\AppData\Roaming\Python\Python26\site-packages\Crypto\Cipher\ARC4.pyd
C:\Users\sridharr\AppData\Roaming\Python\Python26\site-packages\Crypto\Cipher\Blowfish.pyd
C:\Users\sridharr\AppData\Roaming\Python\Python26\site-packages\Crypto\Cipher\CAST.pyd
C:\Users\sridharr\AppData\Roaming\Python\Python26\site-packages\Crypto\Cipher\DES.pyd
C:\Users\sridharr\AppData\Roaming\Python\Python26\site-packages\Crypto\Cipher\DES3.pyd
C:\Users\sridharr\AppData\Roaming\Python\Python26\site-packages\Crypto\Cipher\IDEA.pyd
C:\Users\sridharr\AppData\Roaming\Python\Python26\site-packages\Crypto\Cipher\RC5.pyd
C:\Users\sridharr\AppData\Roaming\Python\Python26\site-packages\Crypto\Cipher\XOR.pyd
C:\Users\sridharr\AppData\Roaming\Python\Python26\site-packages\Crypto\Cipher\__init__.py
C:\Users\sridharr\AppData\Roaming\Python\Python26\site-packages\Crypto\Hash
C:\Users\sridharr\AppData\Roaming\Python\Python26\site-packages\Crypto\Hash\HMAC.py
C:\Users\sridharr\AppData\Roaming\Python\Python26\site-packages\Crypto\Hash\MD2.pyd
C:\Users\sridharr\AppData\Roaming\Python\Python26\site-packages\Crypto\Hash\MD4.pyd
C:\Users\sridharr\AppData\Roaming\Python\Python26\site-packages\Crypto\Hash\MD5.py
C:\Users\sridharr\AppData\Roaming\Python\Python26\site-packages\Crypto\Hash\RIPEMD.pyd
C:\Users\sridharr\AppData\Roaming\Python\Python26\site-packages\Crypto\Hash\SHA.py
C:\Users\sridharr\AppData\Roaming\Python\Python26\site-packages\Crypto\Hash\SHA256.pyd
C:\Users\sridharr\AppData\Roaming\Python\Python26\site-packages\Crypto\Hash\__init__.py
C:\Users\sridharr\AppData\Roaming\Python\Python26\site-packages\Crypto\Protocol
C:\Users\sridharr\AppData\Roaming\Python\Python26\site-packages\Crypto\Protocol\AllOrNothing.py
C:\Users\sridharr\AppData\Roaming\Python\Python26\site-packages\Crypto\Protocol\Chaffing.py
C:\Users\sridharr\AppData\Roaming\Python\Python26\site-packages\Crypto\Protocol\__init__.py
C:\Users\sridharr\AppData\Roaming\Python\Python26\site-packages\Crypto\PublicKey
C:\Users\sridharr\AppData\Roaming\Python\Python26\site-packages\Crypto\PublicKey\DSA.py
C:\Users\sridharr\AppData\Roaming\Python\Python26\site-packages\Crypto\PublicKey\ElGamal.py
C:\Users\sridharr\AppData\Roaming\Python\Python26\site-packages\Crypto\PublicKey\RSA.py
C:\Users\sridharr\AppData\Roaming\Python\Python26\site-packages\Crypto\PublicKey\__init__.py
C:\Users\sridharr\AppData\Roaming\Python\Python26\site-packages\Crypto\PublicKey\pubkey.py
C:\Users\sridharr\AppData\Roaming\Python\Python26\site-packages\Crypto\PublicKey\qNEW.py
C:\Users\sridharr\AppData\Roaming\Python\Python26\site-packages\Crypto\Util
C:\Users\sridharr\AppData\Roaming\Python\Python26\site-packages\Crypto\Util\RFC1751.py
C:\Users\sridharr\AppData\Roaming\Python\Python26\site-packages\Crypto\Util\__init__.py
C:\Users\sridharr\AppData\Roaming\Python\Python26\site-packages\Crypto\Util\number.py
C:\Users\sridharr\AppData\Roaming\Python\Python26\site-packages\Crypto\Util\randpool.py
C:\Users\sridharr\AppData\Roaming\Python\Python26\site-packages\Crypto\Util\test.py
C:\Users\sridharr\AppData\Roaming\Python\Python26\site-packages\Crypto\__init__.py
C:\Users\sridharr\AppData\Roaming\Python\Python26\site-packages\Crypto\test.py
C:\Users\sridharr\AppData\Roaming\Python\Python26\site-packages\pycrypto-2.0.1-py2.6.egg-info

PyPM se puede instalar mediante la instalación de ActivePython .

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top