【发布时间】:2018-08-05 00:16:32
【问题描述】:
我是 GAE 新手,在学习课程时,我需要在我的系统上安装它。我按照 GAE 网站上的说明操作,它成功安装在我的 Ubuntu 17.04 系统上。现在,我创建了一个名为 first-app 的文件夹,其中包含文件 first-app.py 和 app.yaml。
每当我尝试运行 dev_appserver.py first-app 时,都会收到以下错误:
Traceback (most recent call last):
File "/usr/bin/dev_appserver.py", line 11, in <module>
import bootstrapping.bootstrapping as bootstrapping
File "/usr/lib/google-cloud-sdk/bin/bootstrapping/bootstrapping.py", line 9, in <module>
import setup
ModuleNotFoundError: No module named 'setup'
我同时安装了 python 2.7 和 python 3.5,默认的 python 是 2.7.13。
下面是first-app.py的内容:
import webapp2
class Mainpage(webapp2.RequestHandler):
def get(self):
self.response.write("Hello World")
app=webapp2.WSGIApplication([('/', Mainpage), ], debug=True)
而app.yaml文件的内容是:
runtime: python
api_version: 1
threadsafe: true
handlers:
- url: /
script: first-app.app
- url: /index\.html
script: home.app
我应该怎么做才能让它工作?
【问题讨论】:
-
能不能把app.yaml放在这里
-
我已经把app.yaml的内容放到问题里了。
标签: google-app-engine google-cloud-platform google-app-engine-python google-cloud-sdk dev-appserver