【问题标题】:ImportError: cannot import name '_counter' from 'Crypto.Util'ImportError:无法从“Crypto.Util”导入名称“_counter”
【发布时间】:2019-03-01 05:31:54
【问题描述】:

我在 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).

对此问题的解决方案有任何建议或想法吗?

【问题讨论】:

  • 您忘记发布代码了。

标签: python python-3.x compiler-errors cryptography python-import


【解决方案1】:

试试:

sudo pip install pycrypto pycryptodomex

如果还是不行:

sudo pip uninstall pycrypto pycryptodomex

sudo pip install pycryptodome

注意pycrypto和pycryptodome会互相干扰

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

(source)

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2022-01-22
    • 2021-06-30
    • 2020-10-19
    • 2018-08-13
    • 2015-01-26
    • 2020-10-10
    • 2020-02-12
    • 2021-11-27
    相关资源
    最近更新 更多