破碎的Python 2.7 GAE安装导致ImportError

时间:2012-05-22 20:50:37

标签: python google-app-engine windows-7 python-2.7

Gae sdk运行没有错误(使用2.7和webapp2),但突然停止。现在我甚至无法从the getting started page获得示例。

我已经完成了python和gae的干净安装,没有骰子。我尝试过不同版本的python 2.7(2.7.3,activestate 2.7.2)和gae(1.6.4,1.6.5,1.6.6),但我仍然在下面得到ImportError。

其他信息:

  1. 我可以在cmd或python shell中导入_socket模块而不会出错。
  2. 我的笔记本电脑上存在完全相同的问题。
  3. 我女朋友的Vista机器运行示例代码很好。
  4. 我没有安装Python 2.5,我猜测GAE正在引用T:\ Program Files(x86)\ Google \ google_appengine \
  5. 中的python25.dll文件
    >     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)
    

1 个答案:

答案 0 :(得分:-1)

我有同样的问题,并通过从环境变量中删除PYTHONPATH来解决。我正在安装SimpleCV,问题就来自它。

转到System =&gt;高级系统参数=&gt;环境变量,然后在用户变量中查找PYTHONPATH并将其删除。重新启动Google AppEngine,它应该可以正常运行。