python - 模块未找到错误 : No module named 'Crypto' Error

标签 python python-3.x pycryptodome

我已经在 python 3.6.5 上安装了 pycryptodomex 模块,但是当我尝试执行下面的调用时,我得到了标题中提到的错误

from Crypto.Cipher import AES

我想使用 AES 加密文件。现在如何进行?

最佳答案

>> pip install pycryptodome

from Crypto.Cipher import AES  #Works

>> pip install pycryptodomex
from Cryptodome.Cipher import AES 

对于 python3,包名称现在是 pycryptodomepycryptodomex

如果您的项目需要与 Python2 兼容,请使用 pycryptodome 或使用 pycryptodomex,它是一个独立于旧 PyCrypto 的库。

关于python - 模块未找到错误 : No module named 'Crypto' Error,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51824628/

相关文章:

python - 无法使用相同的 AES 对象解密给定的密文两次

pycrypto - 使用 PyCrypto 编写的 RSA 代码不适用于 PyCryptodome

python - scipy.stats.kstest 与规范以外的分布

regex - 通过正则表达式分割字符串

python - 脚本编译后如何在python中重新加载模块?

python-3.x - 属性错误: 'module' object has no attribute 'ensure_future'

python - 使用 Python 编写网页的服务器端脚本 : nothing happens

python - Pandas:根据层次结构删除重复值

python - 如何为 Google Cloud Storage 中存储的图像创建 PDF?

python - 导入错误: cannot import name 'RSA' from 'Crypto.PublicKey'