Python 导入错误:没有名为 Crypto 的模块
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/30738083/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
ImportError: No module named Crypto
提问by AK1992
I am just starting to explore Python. I am trying to run an AES algorithm code and I am facing the:
我刚刚开始探索 Python。我正在尝试运行 AES 算法代码,但我面临:
ImportError: No module named Crypto.
导入错误:没有名为 Crypto 的模块。
How do you solve this?
你如何解决这个问题?
回答by AK1992
You have to install crypto package. https://pypi.python.org/pypi/pycrypto
回答by Nejmeddine Khéchine
Solved when i installed pycrypto rather then crypto
pip2 install pycrypto
当我安装 pycrypto 而不是 crypto 时解决了
pip2 install pycrypto
回答by Hariprakash Sambath
Solution:
解决方案:
By installing pycryptomodule from your virtualenv
通过从您的virtualenv安装pycrypto模块
pip install pycrypto