ImportError: No module named Crypto.Cipher

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

    For CentOS 7.4 I first installed pip and then pycrypto using pip:

    > sudo yum -y install python-pip 
    > sudo python -m pip install pycrypto
    
    0 讨论(0)
  • 2020-11-28 04:57

    If you are using this module with Python3 and having trouble with import. try this.

    pip uninstall crypto
    pip uninstall pycryptodome
    pip install pycryptodome
    

    Good Luck!

    0 讨论(0)
  • 2020-11-28 04:58

    I had simular problem and fixed it with the next command

    sudo pip3 install py
    
    0 讨论(0)
  • 2020-11-28 05:00

    For Windows 7:

    I got through this error "Module error Crypo.Cipher import AES"

    To install Pycrypto in Windows,

    Try this in Command Prompt,

    Set path=C:\Python27\Scripts (i.e path where easy_install is located)

    Then execute the following,

    easy_install pycrypto

    For Ubuntu:

    Try this,

    Download Pycrypto from "https://pypi.python.org/pypi/pycrypto"

    Then change your current path to downloaded path using your terminal:

    Eg: root@xyz-virtual-machine:~/pycrypto-2.6.1#

    Then execute the following using the terminal:

    python setup.py install

    It's worked for me. Hope works for all..

    0 讨论(0)
  • 2020-11-28 05:01

    If you an macos, rename lib folder lib/python3.7/site-packages/crypto to lib/python3.7/site-packages/Crypto

    0 讨论(0)
  • 2020-11-28 05:03

    I've had the same problem 'ImportError: No module named Crypto.Cipher', since using GoogleAppEngineLauncher (version > 1.8.X) with GAE Boilerplate on OSX 10.8.5 (Mountain Lion). In Google App Engine SDK with python 2.7 runtime, pyCrypto 2.6 is the suggested version. The solution that worked for me was...

    1) Download pycrypto2.6 source extract it somewhere(~/Downloads/pycrypto26)

    e.g., git clone https://github.com/dlitz/pycrypto.git

    2) cd (cd ~/Downloads/pycrypto26) then

    3) Execute the following terminal command inside the previous folder in order to install pyCrypto 2.6 manually in GAE folder.

    sudo python setup.py install --install-lib /Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine
    
    0 讨论(0)
提交回复
热议问题