乳宁这个代码后,我发现导入错误: -蟒蛇导入错误“无模块命名appengine.ext”
from google.appengine.ext import webapp
from google.appengine.ext.webapp.util import run_wsgi_app
class MainPage(webapp.RequestHandler):
def get(self):
self.response.headers['Content-Type'] = 'text/plain'
self.response.out.write('Hello, webapp World!')
application = webapp.WSGIApplication([('/', MainPage)],debug=True)
def main():
run_wsgi_app(application)
if __name__ == "__main__":
main()
如何使用google.apengine.ext
你是如何安装它的?检查它是否在你的PYTHONPATH上。 – StoryTeller
如果您试图在交互式Python环境中运行它,您将不得不修改sys.path,如下面的注释中所述。如果您打算提供Web应用程序,那么您应该使用dev_appserver.py运行您的应用程序。命令将是 /platform/google_appengine/dev_appserver.py app.yaml –
我不知道你为什么删除了我的答案。我有完全相同的错误,并有文件google.py导致这个问题。所以对我来说就是答案。可能不是你的确切案例的答案,但它是我的情况的答案。还有,我的错误信息完全一样:“python import error”没有名为appengine.ext的模块“,所以请将我的答案返回给我。 – makkasi