0

My AppEngine environment doesn't recognize any of the preinstalled modules that it's supposed to. I've tried manually pip installing them, pip updating them, adding them to the libraries section of the app.yaml file, creating an appengine_config file, and nothing has worked. I just get an error along the lines of "ImportError: No module named jinja2.environment" for example.

savsample
  • 35
  • 1
  • 6
  • Python 2.7 or 3.7? Could be a duplicate of: https://stackoverflow.com/questions/51799366/how-to-get-credentials-in-google-appengine-python37/51801781#51801781 PIP installing into a lib directory should fix that. – GAEfan Sep 29 '18 at 22:43
  • Python 2.7. I tried pip installing it into a lib directory too. At this point I feel like I should just reinstall AppEngine completely. – savsample Sep 30 '18 at 19:49
  • Related: https://stackoverflow.com/questions/52503620/dev-appserver-py-app-yaml-produces-importerror-importing-the-multiarray-numpy/52520995#52520995 – Dan Cornilescu Oct 01 '18 at 01:41

1 Answers1

1

jinja2 is a built-in 3rd party library in GAE Std. In app.yaml, have:

libraries:
- name: jinja2
  version: "2.6"

Then, in your views.py, import directly:

from jinja2 import ...

To avoid confusion and conflicts, do not pip install them into a lib directory.. You can delete them if you did.

GAEfan
  • 11,244
  • 2
  • 17
  • 33