PyCrypto 未完全安装在 Windows XP 上
我在 Windows XP 控制台中运行了 python setup.py install,报告如下:
running install
running build
running build_py
running build_ext
warning: GMP library not found; Not building Crypto.PublicKey._fastmath.
building 'Crypto.Random.OSRNG.winrandom' extension
error: None
当我尝试使用 import Crypto.Cipher.AES 运行脚本时,它没有不起作用,说:
ImportError: cannot import name AES
我该如何解决这个问题?
I ran python setup.py install
in a Windows XP console, and it reported as follows:
running install
running build
running build_py
running build_ext
warning: GMP library not found; Not building Crypto.PublicKey._fastmath.
building 'Crypto.Random.OSRNG.winrandom' extension
error: None
When I try to run a script with import Crypto.Cipher.AES
, it doesn't work, saying:
ImportError: cannot import name AES
How can I fix this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
在 Windows 上,通过预构建的 Windows 安装程序安装 PyCrypto 可能更容易。 Voidspace 网站有适用于 Python 2.2-2.7 的 PyCrypto 2.1 和 2.3 安装程序。
On windows, it may just be easier installing PyCrypto via a prebuilt windows installer. The Voidspace site has PyCrypto 2.1 and 2.3 installers for Python 2.2-2.7.
对于像我这样使用 64 位 Windows 7 的人:
简短版本:
请按照此说明进行操作。
长版本:
安装VC++ 2008 SP1 Express。您可以从此处。
您还需要 Windows SDK,特别是 Win7 + Net 3.5 SDK< /a>.
也许问题已经在你的Python版本中解决了,如果没有从问题页面
下载获取差异文件< a href="https://code.google.com/p/python-patch/" rel="nofollow">patch.py(或任何其他用于修补 diff 文件的工具)(
如果您下载了补丁)。 py 和 diff 文件位于
c:\Python27
中,只需运行:最后使用 pip 安装:
For other people like me on 64 bit windows 7:
Short version:
Follow this instructions.
Long version:
Install VC++ 2008 SP1 Express. you can get it from here.
You also need the Windows SDK, specifically the Win7 + Net 3.5 SDK.
Maybe the issue was already solved in your python version, if not get the diff file from the issue page
download patch.py (or any other tool to patch diff files)
if you downloaded the patch.py and diff file in
c:\Python27
just run:Finally install using pip:
您可以使用 PyPM 安装 pycrypto(预构建的二进制包):
要列出已安装的文件,请键入:
PyPM 可以通过安装 ActivePython 来安装。
You may use PyPM to install (pre-built binary package of) pycrypto:
To list the files installed, type:
PyPM can be installed by installing ActivePython.