当我从Crypto.Cipher
导入AES时,我第一次使用AES加密并遇到这个问题
Traceback (most recent call last):
File "C:\Users\gek0n\Desktop\wargames\server.py", line 8, in <module>
from Crypto.Cipher import AES
File "build\bdist.win-amd64\egg\Crypto\Cipher\AES.py", line 50, in <module>
File "build\bdist.win-amd64\egg\Crypto\Cipher\_AES.py", line 7, in <module>
File "build\bdist.win-amd64\egg\Crypto\Cipher\_AES.py", line 4, in __bootstrap__
File "build\bdist.win-amd64\egg\pkg_resources.py", line 914, in resource_filename
File "build\bdist.win-amd64\egg\pkg_resources.py", line 1601, in get_resource_filename
File "build\bdist.win-amd64\egg\pkg_resources.py", line 1629, in _extract_resource
File "build\bdist.win-amd64\egg\pkg_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:\Users\gek0n\Desktop\wargames\server.py", line 8, in <module>
from Crypto.Cipher import AES
File "C:\Python27\lib\site-packages\Crypto\Cipher\AES.py", line 50, in <module>
from Crypto.Cipher import _AES
ImportError: DLL load failed: %1 не является приложением Win32.
我不知道,如何解决这个问题,我只会描述一下我的行为:
附:在此操作之前,我尝试使用win32安装创建环境,但它没有帮助!
在Windows上我重新安装了PyCrypto模块(link),一切都适合我。
pip uninstall pycrypto pip install pycrypto(有错误)pip install --upgrade pycrypto(有错误)下载并启动amd64的exe(链接:http://www.voidspace.org.uk/python/modules.shtml)尝试导入 - 完成!
没有为我工作因为使用python 3