Python AES import error Please

只愿长相守 提交于 2019-12-24 10:36:07

问题


I have AES inside Cipher inside Crypto(Python27\Lib\Crypto\Cipher\AES module)

When I try to import AES from Crypto.Cipher import AES I get the following error:

Traceback (most recent call last):
  File "<pyshell#1>", line 1, in <module>
    from Crypto.Cipher import AES
  File "C:\Python27\lib\Crypto\Cipher\AES.py", line 50, in <module>
    from Crypto.Cipher import _AES
ImportError: cannot import name _AES

But I can import another module like from Crypto.Cipher import blockalgo working fine. So I'm guessing there some error in AES module?


回答1:


Most likely, your PyCrypto installation is broken and _AES.dll is missing.

Try to reinstall it according to this question: How do I install PyCrypto on Windows?




回答2:


I also met this problem, and solved it. the reason was that my computer was 64 bit but the Crypto which is 32 bit was downloaded by pip. You can download Crypto about 64 bit or add the files my git downloaded to the corresponding location under your python3/Lib. the file address: https://github.com/BConcernedOnFamily/Crypto_64bit



来源:https://stackoverflow.com/questions/26943136/python-aes-import-error-please

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!