2012-05-22 29 views
3

Gae sdk運行時沒有錯誤(使用2.7和webapp2),但突然停止。現在我甚至無法從the getting started page得到這個例子。破碎的Python 2.7 GAE安裝導致ImportError

我已經完成了python和gae的乾淨安裝,沒有骰子。我已經嘗試了不同版本的python 2.7(2.7.3,activestate 2.7.2)和gae(1.6.4,1.6.5,1.6.6),但我仍然在下面的ImportError中。

其他信息:

  1. 我可以導入_socket模塊在cmd中或Python外殼沒有錯誤。
  2. 我的筆記本電腦上有完全相同的問題。
  3. 我女朋友的Vista機器運行示例代碼很好。
  4. 我沒有Python 2.5的安裝,我猜測是GAE引用python25.dll文件T:\程序文件(x86)\谷歌\ google_appengine \
>  2012-05-22 12:56:59 Running command: "['T:\\Python27\\pythonw.exe', 'T:\\Program Files 
> (x86)\\Google\\google_appengine\\dev_appserver.py', 
> '--admin_console_server=', '--port=8080', 
> u'T:\\Users\\Wyatt\\Desktop\\helloworld']" 
>  Traceback (most recent call last): 
>  File "T:\Program Files (x86)\Google\google_appengine\dev_appserver.py", line 126, in <module> 
>   run_file(__file__, globals()) 
>  File "T:\Program Files (x86)\Google\google_appengine\dev_appserver.py", line 122, in run_file 
>   execfile(script_path, globals_) 
>  File "T:\Program Files (x86)\Google\google_appengine\google\appengine\tools\dev_appserver_main.py", 
> line 157, in <module> 
>   from google.appengine.tools import appcfg 
>  File "T:\Program Files (x86)\Google\google_appengine\google\appengine\tools\appcfg.py", line 
> 41, in <module> 
>   import mimetypes 
>  File "T:\Python27\lib\mimetypes.py", line 29, in <module> 
>   import urllib 
>  File "T:\Python27\lib\urllib.py", line 26, in <module> 
>   import socket 
>  File "T:\Python27\lib\socket.py", line 47, in <module> 
>   import _socket 
>  ImportError: Module use of python25.dll conflicts with this version of Python. 
>  2012-05-22 12:56:59 (Process exited with code 1) 
+0

是否有可能在機器上安裝了早期版本的Python,並且它位於PATH中? –

+0

我檢查過,沒有任何PATH變量不應該在那裏。 – wnewport

+0

奇怪的是'python25.dll'進入混合。我不太瞭解Windows7來解釋這一點。 –

回答

-1

我有同樣的問題,並通過從環境變量中刪除PYTHONPATH來解決。我正在安裝SimpleCV,問題來自它。

轉到System => Advanced System Parameters =>環境變量,然後在用戶變量中查找PYTHONPATH並將其刪除。重新啓動Google AppEngine,它應該可以工作。

+0

如果我們從用戶變量中刪除pythonpath,谷歌應用程序引擎啓動程序將不會運行,因爲它需要python –

+0

您應該從用戶變量中刪除它並在系統路徑中保留'C:\ python27'。我做到了,它工作得很好。 –