运行dev_appserver时,版本1.7.6在sanbox.py的第890行导入错误

时间:2013-03-20 08:43:19

标签: python google-app-engine

我在运行1.7.6时遇到了一些困难。得到以下错误:

INFO     2013-03-20 08:39:10,233 admin_server.py:117] Starting admin server at: http://localhost:8086
ERROR    2013-03-20 08:39:13,768 wsgi.py:219] 
Traceback (most recent call last):
  File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/runtime/wsgi.py", line 196, in Handle
    handler = _config_handle.add_wsgi_middleware(self._LoadHandler())
  File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/api/lib_config.py", line 353, in __getattr__
    self._update_configs()
  File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/api/lib_config.py", line 289, in _update_configs
    self._registry.initialize()
  File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/api/lib_config.py", line 164, in initialize
    import_func(self._modname)
  File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/devappserver2/python/sandbox.py", line 890, in load_module
    raise ImportError
ImportError

2 个答案:

答案 0 :(得分:5)

我遇到了同样的问题。我在appengine问题跟踪器中提出了一个问题:

https://code.google.com/p/googleappengine/issues/detail?id=9008&sort=-id&colspec=ID%20Type%20Component%20Status%20Stars%20Summary%20Language%20Priority%20Owner%20Log

问题似乎是项目目录中的旧pyc文件。我用以下方法删除了它们:

找到。 -name" * .pyc" -exec rm -rf {} \;

重新启动服务器之后,问题就解决了。

如果这没有帮助,您可以使用旧的开发服务器:run" old_dev_appserver.py。" +你现在需要的任何论据。

答案 1 :(得分:0)

在这里,我决定了一些启动问题,删除项目并添加现有项目。我做了,我的应用程序正常启动。