加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 编程开发 > Python > 正文

python – PyCrypto导入AES问题

发布时间:2020-12-20 13:40:08 所属栏目:Python 来源:网络整理
导读:我从Crypto.Cipher导入AES时,第一次使用AES加密并遇到此问题 Traceback (most recent call last): File "C:Usersgek0nDesktopwargamesserver.py",line 8,in module from Crypto.Cipher import AES File "buildbdist.win-amd64eggCryptoCipherAES.p
我从Crypto.Cipher导入AES时,第一次使用AES加密并遇到此问题

Traceback (most recent call last):
  File "C:Usersgek0nDesktopwargamesserver.py",line 8,in <module>
    from Crypto.Cipher import AES
  File "buildbdist.win-amd64eggCryptoCipherAES.py",line 50,in <module>
  File "buildbdist.win-amd64eggCryptoCipher_AES.py",line 7,line 4,in __bootstrap__
  File "buildbdist.win-amd64eggpkg_resources.py",line 914,in resource_filename
  File "buildbdist.win-amd64eggpkg_resources.py",line 1601,in get_resource_filename
  File "buildbdist.win-amd64eggpkg_resources.py",line 1629,in _extract_resource
  File "buildbdist.win-amd64eggpkg_resources.py",line 990,in get_cache_path
AttributeError: ResourceManager instance has no attribute '_warn_unsafe_extraction'

有人说,安装程序有问题,但是我使用了x64系统的.exe安装程序.
有人说,他将_warn_unsafe_extractor更改为不同的名称,问题解决了,但找不到此文件.

现在我有一个新的错误(用PIP重新安装PyCrypto之后)

Traceback (most recent call last):
  File "C:Usersgek0nDesktopwargamesserver.py",in <module>
    from Crypto.Cipher import AES
  File "C:Python27libsite-packagesCryptoCipherAES.py",in <module>
    from Crypto.Cipher import _AES
ImportError: DLL load failed: %1 не является приложением Win32.

我不知道,如何解决这个问题,我只会描述一下我的行为:

> pip卸载pycrypto
> pip install pycrypto(有错误)
> pip install –upgrade pycrypto(有错误)
>下载并启动amd64的exe(链接:http://www.voidspace.org.uk/python/modules.shtml)
>尝试导入 – 完成!

附:
在此操作之前,我尝试使用win32安装创建环境,但它没有帮助!

解决方法

在Windows上我重新安装了PyCrypto模块( link),所有功能都适用于我.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读