ImportError: No module named Crypto.Cipher

前端 未结 25 1350
后悔当初
后悔当初 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:52

    I had the same problem on my Mac when installing with pip. I then removed pycrypto and installed it again with easy_install, like this:

    pip uninstall pycrypto
    easy_install pycrypto
    

    also as Luke commented: If you have trouble running these commands, be sure to run them as admin (sudo)

    Hope this helps!

    EDIT: As winklerr correctly notes above, pycrypto is no longer safe. Use pycryptodome instead, it is a drop-in replacement

提交回复
热议问题