简体   繁体   English

使用Python 2.7的Google App Engine - CouldNotFindModuleError

[英]Google App Engine with Python 2.7 - CouldNotFindModuleError

I am new to Google App Engine, so i was trying to learn from this tutorial 我是Google App Engine的新手,因此我尝试从本教程中学习

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

and i followed all the steps, and when i run the application this is what appears in the browser when i got to localhost:8080 我按照所有步骤操作,当我运行应用程序时,这是当我到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

so i really dont know what is the problem , can any one help me please 所以我真的不知道是什么问题,任何人都可以帮助我

i am using python 2.7 我正在使用python 2.7

You cannot use Python 2.7 with Google App Engine. 您不能将Python 2.7与Google App Engine一起使用。 Use Python 2.5. 使用Python 2.5。 This is what runs on the production servers, and Google makes no effort to ensure that SDK will work at all on Python 2.7. 这是在生产服务器上运行的,而Google不会努力确保SDK在Python 2.7上完全可用。 They have fixed at least one bug that occurred when running with Python 2.6, but considering the syntax changes between 2.6 and 2.5, using 2.6 as a testing environment is a bad idea; 他们修复了使用Python 2.6运行时发生的至少一个错误,但考虑到2.6和2.5之间的语法更改,使用2.6作为测试环境是一个坏主意; you're fairly likely to have code that runs perfectly on the dev server and fails horribly in production. 你很可能拥有在开发服务器上完美运行的代码,并且在生产中失败可怕。

EDIT: An experimental Python 2.7 runtime is now available for App Engine; 编辑:App Engine现在可以使用实验性Python 2.7运行时; the SDK may now work fine with Python 2.7. SDK现在可以正常使用Python 2.7。

我也发现了同样的问题,然后我改为本教程 ,也许如果问题没有得到解决,你可能想要阅读上面提到的那个。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM