menu Chancel's blog
rss_feed
Chancel's blog
我就是这样的人

Crypto的诡异问题

作者:Chancel, 时间:2021 Jun 15, 阅读:64

在Windows上使用pip安装 crypto

pip3 install crypto

尝试导入crypto的对象时候出现错误

>>> from Crypto.Cipher import AES
Traceback (most recent call last):
    File "<stdin>" , line 1, in <module>
NoduleNotFoundError: No module name 'Crypto'

原因:crypto在python上面的名字是pycrypto,它是一个第三方库,但是已经停止更新三年了

分2步解决这个问题

  1. 卸载crypto然后安装pycryptodome
    pip3 uninstall crypto
    pip3 install pycryptodome
    
  2. 定位到Python的安装目录,找到Libsite-packages,将crypto文件夹的首字母改成大写就可以了,crypto->Crypto

Linux只需要第一步

[[replyMessage== null?"发表评论":"发表评论 @ " + replyMessage.m_author]]

account_circle
email
web_asset
textsms

评论列表([[messageResponse.total]])

还没有可以显示的留言...
[[messageItem.m_author]] [[messageItem.m_author]]
[[messageItem.create_time]]
[[getEnviron(messageItem.m_environ)]]
[[subMessage.m_author]] [[subMessage.m_author]] @ [[subMessage.parent_message.m_author]] [[subMessage.parent_message.m_author]]
[[subMessage.create_time]]
[[getEnviron(messageItem.m_environ)]]