导入错误:无法从“Crypto.Util”导入名称“_counter”

Wil*_*ort 7 python cryptography compiler-errors python-import python-3.x

我在 Linux Ubuntu 18.04 LTS 上使用 Geanny 编辑器和 python 3.7 解释器。我试图使用 AES 256 位加密。我在互联网上研究了这个问题并尝试了各种不同的解决方案,但无济于事。我继续得到的错误是

ImportError: cannot import name '_counter' from 'Crypto.Util' (/usr/lib/python3/dist-packages/Crypto/Util/__init__.py).

解决此问题的任何建议或想法?

Ron*_*ian 2

尝试:

sudo pip install pycrypto pycryptodomex

如果仍然不起作用:

sudo pip uninstall pycrypto pycryptodomex

sudo pip install pycryptodome

注意 pycrypto 和 pycryptodome 会互相干扰

必须避免同时安装 PyCrypto 和 PyCryptodome,因为它们会互相干扰。

来源