Python Getting ModuleNotFoundError:没有名为';加密';

Python Getting ModuleNotFoundError:没有名为';加密';,python,Python,这是我的代码,我正在尝试从Crypto.Cipher导入AES,但显示此错误。这将解决您的问题: from Crypto.Cipher import AES key = b'Sixteen byte key' cipher = AES.new(key, AES.MODE_EAX) nonce = cipher.nonce ciphertext, tag = cipher.encrypt_and_digest(data) 为我工作!谢谢回答你的问题吗?pip为我安装了pycryptodome

这是我的代码,我正在尝试从Crypto.Cipher导入AES,但显示此错误。

这将解决您的问题:

from Crypto.Cipher import AES

key = b'Sixteen byte key'
cipher = AES.new(key, AES.MODE_EAX)

nonce = cipher.nonce
ciphertext, tag = cipher.encrypt_and_digest(data)

为我工作!谢谢回答你的问题吗?pip为我安装了pycryptodome
pip install pycryptodome