2011-01-21 37 views
4

由於AppEngine需要通過SSL上傳您的應用程序我試圖在我的工作筆記本電腦上安裝該模塊。在Windows上安裝適用於Python的SSL模塊(2.5.4)

它是一個安裝了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的不regcognized)

「建」,而不是安裝似乎「輸出」的東西: 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 
+0

注意:mingw中的編譯器應該是`gcc`而不是`ggc`。 – jfs 2011-01-22 22:55:43

+0

@ J.F。這是一個錯字,對不起。 – 2011-01-23 10:11:26

回答

0

使用-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