1

I'm trying to run the vanilla gae-init project here https://github.com/gae-init/gae-init/ to start playing around with Flask and GAE. I keep getting this error -

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

I've tried adding the PYTHONPATH to my .bashrc file with export PYTHONPATH=$PYTHONPATH:/usr/local/lib/python2.7/dist-packages (dist-packages because that's where pip seems to be installing all my stuff? I saw mentions of site-packages, but there's nothing in that folder)

I've tried running pip install -r requirements.txt -t lib because as far as I can tell, dev_server.py cannot find flask at all.

I've checked out answers here and here but they didn't help much. The second one seems promising, but I'm running Ubuntu and not Windows.

I'm quite a beginner with Python so trying to figure this out as I go along.

Thanks for any help!

Community
  • 1
  • 1
iLikeBreakfast
  • 1,545
  • 23
  • 46
  • When it comes to gae-init though.. all you have to do is to fulfill the [requirements](http://docs.gae-init.appspot.com/requirement/) and then run `gulp`... – Lipis Apr 18 '16 at 01:48

1 Answers1

3

You have to tell your app where third-party libraries are by adding appengine_config.py to your project root.

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

Skywave
  • 193
  • 1
  • 7
  • 1
    https://cloud.google.com/appengine/docs/standard/python/tools/built-in-libraries-27 On this page I see that flask 0.12 is included in the appengine runtime. Does this mean I still have to add it to my vendor lib? – MartijnvdB Jan 27 '18 at 11:37