由于 AppEngine 需要通过 SSL 上传您的应用程序,我尝试在我的工作笔记本电脑上安装该模块。
这是一个安装了 Python 2.5.4 x86 的 x64 Win 7 系统。
我遵循了如下指南:How to install Python ssl module on Windows? 以及所有相关链接。
但主要问题是,MinGw 和 GnuWin 似乎都无法正常工作。
GnuWin 已完美安装,是最新的并且具有构建 SSL 模块所需的所有依赖项。
但是输入
> "C:\Python25\python.py" setup.py install -c mingw32
只是严重失败。 “-cmingw32”和“-gnuwin32”也是如此。 (-cmingw32 显然失败了,因为即使 MinGW 已完全安装,MinGw 也未被识别)
“构建”而不是安装似乎“输出”了一些东西: MinGw 提示“ggc 没有这样的文件或目录”,而对于 GnuWin,“它不知道如何使用 gnuwin 在 nt 上编译 C/C++”
这对我来说听起来完全是垃圾,因为我按照教程中的描述做了所有事情。
我解决了我的问题的一部分:gcc 现在被 easy_install 识别,但 AE 仍然提示缺少 SSL 模块,尽管 easy_install 和 python 都说 Pycrypto incl。 SSL安装成功
easy_install ssl
C:\Users\faits>easy_install ssl
Searching for ssl
Best match: ssl 1.15
Adding ssl 1.15 to easy-install.pth file
Using c:\python25\lib\site-packages
Processing dependencies for ssl
Finished processing dependencies for ssl
easy_install pycrypto
C:\Users\faits>easy_install ssl
Searching for ssl
Best match: ssl 1.15
Adding ssl 1.15 to easy-install.pth file
Using c:\python25\lib\site-packages
Processing dependencies for ssl
Finished processing dependencies for ssl
python
IDLE 1.2.4
>>> import ssl
Traceback (most recent call last):
File "<pyshell#0>", line 1, in <module>
import ssl
File "C:\Python25\lib\site-packages\ssl\__init__.py", line 61, in <module>
import _ssl2 # if we can't import it, let the error propagate
ImportError: No module named _ssl2
python
>>> import pycrypto
Traceback (most recent call last):
File "<pyshell#1>", line 1, in <module>
import pycrypto
ImportError: No module named pycrypto
最佳答案
我在以下链接中很好地总结了所有说明。请检查一下。 http://waqasshabbir.tumblr.com/post/18010535789/ssl-module-for-python-2-5-installation-windows-only
关于python - 在 Windows 上为 Python (2.5.4) 安装 SSL 模块,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4763463/