【问题标题】:Installing SSL Module for Python (2.5.4) on Windows在 Windows 上安装适用于 Python (2.5.4) 的 SSL 模块
【发布时间】:2011-06-13 09:41:09
【问题描述】:

由于 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 也没有被识别)

“build”而不是 install 似乎“输出”了一些东西: 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

蟒蛇

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

蟒蛇

>>> import pycrypto

Traceback (most recent call last):
  File "<pyshell#1>", line 1, in <module>
    import pycrypto
ImportError: No module named pycrypto

【问题讨论】:

  • 注意:mingw 中的编译器应该是gcc 而不是ggc
  • 粘贴你从easy_install得到的命令和确切的错误。
  • "C:\Users\faits>easy_install ssl 搜索 ssl 最佳匹配:ssl 1.15 将 ssl 1.15 添加到 easy-install.pth 文件 使用 c:\python25\lib\site-packages 处理依赖项ssl 完成对 ssl 的依赖处理"
  • 确保带有_ssl2.pyd 文件的目录在您的%PATH% 中。顺便说一句,这些说明看起来很复杂,我不确定它们是否会产生正确的 64 位 版本。这是一个有用的通用页面(但它没有 pycrypto、ssl)lfd.uci.edu/~gohlke/pythonlibs
  • @daemonfire300:如果您希望我收到通知,请在评论开头使用 @J.F. Sebastian:

标签: python windows-7 ssl module installation


【解决方案1】:

我已经很好地总结了以下链接中的所有说明。一定要检查一下。 http://waqasshabbir.tumblr.com/post/18010535789/ssl-module-for-python-2-5-installation-windows-only

【讨论】:

    【解决方案2】:

    -cbuild 命令一起使用。

    比较:

    $ python setup.py install -c

    --compile (-c)     compile .py to .pyc [default]
    

    与:

    $ python setup.py build -c

    --compiler (-c)    specify the compiler type
    

    要找出其他选项,请运行:

    $ python setup.py build --help

    【讨论】:

    • 我确实使用了 build -c(例如 --compiler=gnuwin),但是它不知道如何编译。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2011-01-23
    • 2011-07-28
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-02-09
    相关资源
    最近更新 更多