没有名为flask(GAE)的模块

时间:2015-10-11 13:40:46

标签: python google-app-engine flask

我试图在这里运行vanilla gae-init项目https://github.com/gae-init/gae-init/,开始玩Flask和GAE。我一直收到这个错误 -

INFO     2015-10-11 13:28:25,924 devappserver2.py:763] Skipping SDK update check.
INFO     2015-10-11 13:28:26,001 api_server.py:205] Starting API server at: http://localhost:48281
INFO     2015-10-11 13:28:26,024 dispatcher.py:197] Starting module "default" running at: http://127.0.0.1:8080
INFO     2015-10-11 13:28:26,026 admin_server.py:116] Starting admin server at: http://localhost:8081
ERROR    2015-10-11 13:28:28,552 wsgi.py:263] 
Traceback (most recent call last):
  File "/media/thomas/2CCC2F86CC2F4982/Dev Stuff/SDKs/google_appengine/google/appengine/runtime/wsgi.py", line 240, in Handle
    handler = _config_handle.add_wsgi_middleware(self._LoadHandler())
  File "/media/thomas/2CCC2F86CC2F4982/Dev Stuff/SDKs/google_appengine/google/appengine/runtime/wsgi.py", line 299, in _LoadHandler
    handler, path, err = LoadObject(self._handler)
  File "/media/thomas/2CCC2F86CC2F4982/Dev Stuff/SDKs/google_appengine/google/appengine/runtime/wsgi.py", line 85, in LoadObject
    obj = __import__(path[0])
  File "/media/thomas/2CCC2F86CC2F4982/Linux/Python/gae-init/main/main.py", line 3, in <module>
    import flask
ImportError: No module named flask
INFO     2015-10-11 13:28:28,560 module.py:786] default: "GET /_ah/warmup HTTP/1.1" 500 749

我已尝试将PYTHONPATH添加到我的.bashrc文件中export PYTHONPATH=$PYTHONPATH:/usr/local/lib/python2.7/dist-packages(dist-packages因为pip似乎在安装我所有的东西?我看到提及site-packages,但该文件夹中没有任何内容)

我试过运行pip install -r requirements.txt -t lib因为据我所知,dev_server.py根本找不到烧瓶。

我已经检出了答案herehere,但他们没有多大帮助。第二个似乎很有希望,但我运行Ubuntu而不是Windows。

我是Python的初学者,因此我试图在我进行时弄清楚这一点。

感谢您的帮助!

1 个答案:

答案 0 :(得分:3)

您必须通过向项目根目录添加appengine_config.py来告知您的应用在第三方库中的位置。

https://cloud.google.com/appengine/docs/python/tools/libraries27#vendoring