如何在 Windows 上安装 PyCrypto? [英] How do I install PyCrypto on Windows?

查看:61
本文介绍了如何在 Windows 上安装 PyCrypto?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经阅读了所有其他 google 源代码和 SO 线程,但没有任何效果.

I've read every other google source and SO thread, with nothing working.

Python 2.7.3 32bit 安装在 Windows 7 64bit 上.下载、解压,然后尝试安装 PyCrypto 导致 无法找到 vcvarsall.bat".

Python 2.7.3 32bit installed on Windows 7 64bit. Download, extracting, and then trying to install PyCrypto results in "Unable to find vcvarsall.bat".

所以我安装了 MinGW 并将其添加到安装行中作为选择的编译器.但后来我收到错误 "RuntimeError: chmod error".

So I install MinGW and tack that on the install line as the compiler of choice. But then I get the error "RuntimeError: chmod error".

我到底该如何解决这个问题?我试过使用 pip,它给出了相同的结果.我找到了一个预构建的 PyCrypto 2.3 二进制文件并安装了它,但在系统上找不到它(不工作).

How in the world do I get around this? I've tried using pip, which gives the same result. I found a prebuilt PyCrypto 2.3 binary and installed that, but it's nowhere to be found on the system (not working).

有什么想法吗?

推荐答案

如果您还没有安装与 Python.org 分发的 Visual Studio 二进制文件兼容的 C/C++ 开发环境,那么您应该坚持使用仅安装纯 Python 包或 Windows 二进制文件可用的包.

If you don't already have a C/C++ development environment installed that is compatible with the Visual Studio binaries distributed by Python.org, then you should stick to installing only pure Python packages or packages for which a Windows binary is available.

幸运的是,有适用于 Windows 的 PyCrypto 二进制文件:http://www.voidspace.org.uk/python/modules.shtml#pycrypto

Fortunately, there are PyCrypto binaries available for Windows: http://www.voidspace.org.uk/python/modules.shtml#pycrypto

更新:
正如@Udi 在下面的评论中所建议的那样,以下命令还安装了 pycrypto 并且也可以在 virtualenv 中使用:

UPDATE:
As @Udi suggests in the comment below, the following command also installs pycrypto and can be used in virtualenv as well:

easy_install http://www.voidspace.org.uk/python/pycrypto-2.6.1/pycrypto-2.6.1.win32-py2.7.exe

请注意从此列表中为您的设置选择相关链接

如果您正在寻找 Python 3.5 的构建版本,请参阅 python 3.5 上的 PyCrypto

If you're looking for builds for Python 3.5, see PyCrypto on python 3.5

这篇关于如何在 Windows 上安装 PyCrypto?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆