PyCrypto nie jest w pełni zainstalowany na Windows XP

Uruchomiłem python setup.py install w konsoli Windows XP i raportował następująco:

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

Kiedy próbuję uruchomić skrypt z import Crypto.Cipher.AES, nie działa, mówiąc:

ImportError: cannot import name AES
Jak mogę to naprawić?
Author: hichris123, 2009-11-06

3 answers

W systemie windows może być łatwiejsza instalacja PyCrypto za pomocą gotowego Instalatora windows. Strona Voidspace posiada instalatory PyCrypto 2.1 i 2.3 Dla Pythona 2.2-2.7.

 43
Author: John Paulett,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/doraprojects.net/template/agent.layouts/content.php on line 54
2012-02-24 14:46:12

Dla innych ludzi takich jak ja na 64-bitowym windows 7:

Krótka wersja: Wykonaj to instrukcje.

Wersja długa:

Zainstaluj VC++ 2008 SP1 Express. możesz go pobrać z tutaj .

Potrzebujesz również SDK systemu Windows, a konkretnie Win7 + Net 3.5 SDK .

Może problem został już rozwiązany w Twojej wersji Pythona, jeśli nie pobierz pliku diff ze strony sprawy

Pobierz patch.py (lub jakiekolwiek inne narzędzie do patch diff files)

Jeśli pobrałeś patch.py i plik diff w c:\Python27 po prostu uruchom:

python patch-11.01.py vcvars3.diff

Wreszcie zainstalować za pomocą pip:

pip install pycrypto
 3
Author: tovmeod,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/doraprojects.net/template/agent.layouts/content.php on line 54
2014-12-15 22:12:32

Możesz użyć PyPM Aby zainstalować (wstępnie zbudowany pakiet binarny) 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

Aby wyświetlić listę zainstalowanych plików, wpisz:

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 można zainstalować instalując ActivePython.

 0
Author: Sridhar Ratnakumar,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/doraprojects.net/template/agent.layouts/content.php on line 54
2010-09-28 23:34:04