Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

getting ImportError: cannot import name 'escape' from 'jinja2' with python3 src/server.py #23

Open
zinyosrim opened this issue Jun 12, 2023 · 2 comments

Comments

@zinyosrim
Copy link

zinyosrim commented Jun 12, 2023

Traceback (most recent call last):
  File "/Users/deniz/Dev/shopify-flask-example/src/server.py", line 6, in <module>
    from flask import Flask, redirect, request, render_template
  File "/Users/deniz/Dev/shopify-flask-example/.venv/lib/python3.9/site-packages/flask/__init__.py", line 14, in <module>
    from jinja2 import escape
ImportError: cannot import name 'escape' from 'jinja2' (/Users/deniz/Dev/shopify-flask-example/.venv/lib/python3.9/site-packages/jinja2/__init__.py)

Can be quick fixed with:

pip uninstall flask
pip install flask

Solution:
Remove Flask version dependency in requirements.txt or use 2.3.2

@garettB
Copy link
Owner

garettB commented Jun 12, 2023

Thanks for the post and solution. I do need to update the sample in a few areas, notably upgrading flask to v2.

If updating the version works as-is for you and you are able to submit a PR I would greatly appreciate it! I'm hoping to have some time to update the sample this summer.

@zinyosrim
Copy link
Author

You're welcome. The issue is documented here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants