编程语言
首页 > 编程语言> > 带有Python 2.7的Google App Engine-CouldNotFindModuleError

带有Python 2.7的Google App Engine-CouldNotFindModuleError

作者:互联网

我是Google App Engine的新手,因此我试图从本教程中学习

http://www.vogella.de/articles/GoogleAppEngine/article.html#installation

我遵循了所有步骤,当我运行该应用程序时,这是我进入localhost:8080后在浏览器中显示的内容

Traceback (most recent call last):
  File "C:\Program Files\Google\google_appengine\google\appengine\tools\dev_appserver.py", line 3245, in _HandleRequest
    self._Dispatch(dispatcher, self.rfile, outfile, env_dict)
  File "C:\Program Files\Google\google_appengine\google\appengine\tools\dev_appserver.py", line 3186, in _Dispatch
    base_env_dict=env_dict)
  File "C:\Program Files\Google\google_appengine\google\appengine\tools\dev_appserver.py", line 531, in Dispatch
    base_env_dict=base_env_dict)
  File "C:\Program Files\Google\google_appengine\google\appengine\tools\dev_appserver.py", line 2410, in Dispatch
    self._module_dict)
  File "C:\Program Files\Google\google_appengine\google\appengine\tools\dev_appserver.py", line 2320, in ExecuteCGI
    reset_modules = exec_script(handler_path, cgi_path, hook)
  File "C:\Program Files\Google\google_appengine\google\appengine\tools\dev_appserver.py", line 2211, in ExecuteOrImportScript
    handler_path, cgi_path, import_hook)
  File "C:\Program Files\Google\google_appengine\google\appengine\tools\dev_appserver.py", line 2112, in LoadTargetModule
    module_code = import_hook.get_code(module_fullname)
  File "C:\Program Files\Google\google_appengine\google\appengine\tools\dev_appserver.py", line 1295, in Decorate
    return func(self, *args, **kwargs)
  File "C:\Program Files\Google\google_appengine\google\appengine\tools\dev_appserver.py", line 1972, in get_code
    full_path, search_path, submodule = self.GetModuleInfo(fullname)
  File "C:\Program Files\Google\google_appengine\google\appengine\tools\dev_appserver.py", line 1295, in Decorate
    return func(self, *args, **kwargs)
  File "C:\Program Files\Google\google_appengine\google\appengine\tools\dev_appserver.py", line 1925, in GetModuleInfo
    source_file, pathname, description = self.FindModuleRestricted(submodule, fullname, search_path)
  File "C:\Program Files\Google\google_appengine\google\appengine\tools\dev_appserver.py", line 1295, in Decorate
    return func(self, *args, **kwargs)
  File "C:\Program Files\Google\google_appengine\google\appengine\tools\dev_appserver.py", line 1694, in FindModuleRestricted
    raise CouldNotFindModuleError()
CouldNotFindModuleError

所以我真的不知道出什么问题了,任何人都可以帮我吗

我正在使用python 2.7

解决方法:

您不能将Python 2.7与Google App Engine一起使用.使用Python 2.5.这就是在生产服务器上运行的内容,Google并没有努力确保SDK完全可以在Python 2.7上运行.他们已经修复了至少一个在Python 2.6上运行时发生的错误,但是考虑到2.6和2.5之间的语法变化,使用2.6作为测试环境是一个坏主意.您很有可能拥有可以在开发服务器上完美运行并且在生产中严重失败的代码.

编辑:
实验性的Python 2.7运行时现已可用于App Engine; SDK现在可以在Python 2.7上正常工作.

标签:python-2-7,google-app-engine,python
来源: https://codeday.me/bug/20191208/2093033.html