python - 如何在 Windows 上安装 Python ssl 模块?

标签 python google-app-engine ssl installation python-2.5

Google App Engine Launcher 告诉我:

WARNING appengine_rpc.py:399 ssl module not found. Without the ssl module, the identity of the remote host cannot be verified, and connections may NOT be secure. To fix this, please install the ssl module from http://pypi.python.org/pypi/ssl .

我下载了这个包,它包含一个 setup.py 文件。我跑了:

python setup.py install

然后:

Python was built with Visual Studio 2003; blablabla use MinGW32

然后我安装了MinGW32,现在编译不起作用。编译错误结尾包含:

ssl/_ssl2.c:1561: error: `CRYPTO_LOCK' undeclared (first use in this function)

error: command 'gcc' failed with exit status 1

我该怎么办?

最佳答案

捕获openssllibgw32c来自 gnuwin32 项目的软件包(下载“开发人员文件”!)并将它们提取到您安装 gnuwin32 的位置 - 或者如果您还没有 gnuwin32 工具,您可以将其提取到任何地方(例如“C:\Program Files\gnuwin32”) .进入“setup.py”文件中的gnuwin32目录(替换第154行的“C:\Utils\GnuWin32”)。

然后您可以毫无问题地构建 ssl 模块。我自己测试了它,使用 GCC "4.3.2-tdm-2 mingw32"和命令行 setup.py build -cmingw32 (-cmingw32 像我一样强制 MinGW安装了微软的编译器)。构建成功后执行setup.py install安装ssl

关于python - 如何在 Windows 上安装 Python ssl 模块?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2261866/

相关文章:

Python从多个不同长度的列表中获取唯一对

mysql - Mysql ODBC 驱动程序无法连接到 MySQL 服务器

google-app-engine - GoogleAppEngine 错误 : rdbms_mysqldb. py:74

python - 在 Python + Google App Engine 中重定向用户

python - 使用 GQL 向现有表添加一列?

node.js - PEM 证书给出 "wrong tag"或 "header too long"错误

wcf - 将证书添加到 WCF 客户端。找不到 X.509 证书

python - 有效地查找间隔/范围是否是较长间隔/范围的一部分

python - 对特定于实现的数据库使用情况进行单元测试

python - 在 numpy 数组的末尾追加数组的 n 个副本