2

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

When I try to do

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

That works fine.

So, I'm guessing there is some error in the AES module?

Gino Mempin
  • 25,369
  • 29
  • 96
  • 135
sanjit jena
  • 23
  • 1
  • 1
  • 3

2 Answers2

6

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?

Community
  • 1
  • 1
alexanderlukanin13
  • 4,577
  • 26
  • 29
0

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

俊杰张
  • 11
  • 2