ModuleNotFoundError: No module named 'Crypto' Error

◇◆丶佛笑我妖孽 提交于 2019-12-10 23:46:23

问题


I have installed pycryptodomex module on python 3.6.5 but when i try to execute the below call, i get the error mentioned in the headline

from Crypto.Cipher import AES

I want to encrypt a file using AES. How to proceed now ?


回答1:


>> pip install pycryptodome

from Crypto.Cipher import AES  #Works

or

>> pip install pycryptodomex
from Cryptodome.Cipher import AES 

For python3 the package name is now pycryptodome or pycryptodomex

If you need compatibility with your project with Python2 use pycryptodome or else use pycryptodomex which is a library independent of the old PyCrypto.




回答2:


According to the PyPI page, pycryptodomex is available under the name Cryptodome instead of Crypto




回答3:


You will have to install the Cryptography package. Visit here for more details.

Or you can try pip install at the terminal:

pip3 install pycrypto



回答4:


hello i had the same problem: _an almost drop-in replacement for the old PyCrypto library. You install it with:

$ pip install pycryptodome ((3.8.2)) or the latest version go to this directory : 2) [C:\Users\s****\AppData\Local\Programs\Python\Python37-32\Lib\site-packages\crypto]

here try to change the file name crypto to Crypto with upper case C because they import it as Crypto in every package. it works for me, good luck :)



来源:https://stackoverflow.com/questions/51824628/modulenotfounderror-no-module-named-crypto-error

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!