Python – Jinja2 cannot be imported on Google App Engine

Jinja2 cannot be imported on Google App Engine… here is a solution to the problem.

Jinja2 cannot be imported on Google App Engine

I’m reading the Google App Engine tutorial for python 2.7 and ran into a roadblock. I can’t get jinja2 to import, so every time I add import jinja2 to my code, the app won’t load.

I also installed jinja2 locally but it didn’t work out. I’m not sure what else to do, I’ve been looking around for a while, but what I’ve read doesn’t seem to be helpful.

Solution

Add library dependencies in your app.yaml

Example:

libraries:
- name: jinja2
  version: latest
- name: markupsafe
  version: latest
- name: django
  version: latest

Related Problems and Solutions