0%

ImportError cannot import name ''DerBitString'' from ''Crypto.Util.asn1''

今天用到 PyCryptodome 模块的时候,当我用到了

1
from Crypto.PublicKey import RSA

的时候,出现了错误:
ImportError : cannot import name ‘’DerBitString’’ from ‘’Crypto.Util.asn1’’。
找到了这篇博客官方文档,都提到了Windows下同时安装PyCryptodome和PyCrypto会出现这个问题。

给出的解决方案是:

1
2
3
pip uninstall crypto
pip uninstall pycryptodome
pip install pycryptodome

但我并没有安装crypto模块也出现了问题,后来发现只要

1
2
pip uninstall pycryptodome
pip install pycryptodome

重新装一下pycryptodome问题就解决了。

本文地址: https://www.chimaoshu.top/ImportError-cannot-import-name-DerBitString-from-Crypto-Util-asn1/
版权声明:本博客所有文章除特别声明外,均采用 Apache License 2.0 许可协议,转载请注明出处。

Welcome to my other publishing channels