ImportError: No module named Crypto.Cipher

前端 未结 25 1384
后悔当初
后悔当初 2020-11-28 04:08

When I try to run app.py (Python 3.3, PyCrypto 2.6) my virtualenv keeps returning the error listed above. My import statement is just from Crypto.Cipher import AES

25条回答
  •  暗喜
    暗喜 (楼主)
    2020-11-28 04:43

    I found the solution. Issue is probably in case sensitivity (on Windows).

    Just change the name of the folder:

    • C:\Python27\Lib\site-packages\crypto
    • to: C:\Python27\Lib\site-packages\Crypto

    This is how folder was named after installation of pycrypto:

    I've changed it to:

    And now the following code works fine:

提交回复
热议问题