no module named crypto.cipher

前端 未结 9 596
囚心锁ツ
囚心锁ツ 2021-02-07 06:59

I\'m trying my hands on encryption for a while now. I recently got hands on this python based crypter named PythonCrypter.

I\'m fairly new to Python and when I try to o

相关标签:
9条回答
  • 2021-02-07 07:13

    PyCrypto doesn't play well with Windows systems if you're installing using pip or easy_install... or at least it didn't for me.

    Try using the prebuilt binaries for Windows here: http://www.voidspace.org.uk/python/modules.shtml#pycrypto

    0 讨论(0)
  • 2021-02-07 07:15

    In my case, pycrypto package was not installed, when I tried to add it: I ran into the following error which was rectified by downloading and installing C++ Compiler for Python 2.7.

    error: Microsoft Visual C++ 9.0 is required. Get it from http://aka.ms/vcpython27

    0 讨论(0)
  • 2021-02-07 07:21

    I think u should try this:

    sudo pip2 install pycrypto
    
    0 讨论(0)
  • 2021-02-07 07:22

    I just spent half an hour figuring this out on Ubuntu. Turns out, I had installed the python-pycryptopp package through apt (I prefer to avoid pip if possible), but the package I needed was actually python-crypto.

    0 讨论(0)
  • 2021-02-07 07:25

    I just encountered this issue with Python 2.7 on Windows. My solution was to rename the folder from ..\site-packages\crypto to ..\site-packages\Crypto. The lower case "c" was causing the import error.

    See https://github.com/pypa/pip/issues/3309 for details.

    0 讨论(0)
  • 2021-02-07 07:30

    I know this has already been answered, but I want to expand a little bit

    pip install Crypto --> IS THE WRONG PACKAGE
    

    if you do this run the below to remove it:

    $> pip uninstall Crypto
    

    Now, to install type:

    $> pip uninstall pycrypto --> just in case you have a broken package already
    
    $> pip install pycrypto
    

    On macOS Catalina this will automatically install the pycrypto package for Python3.6 ONLY.

    This means that if you run:

    python your_script.py
    

    It wil fail. Unless of course Python3 is set as your default.

    Now if you really want to run pycrypto on Python2 you can run the below

    $> sudo pip2 install pycrypto
    

    You will need the sudo for this to work!

    This will install pycrypto for Python2 only.

    I hope this helps someone who might be installing then running with python2, or who wants the package installed with Python2 but is continuously installing with the Python3 package

    0 讨论(0)
提交回复
热议问题