I'm working on a web app (Flask) and all of the sudden I started getting import error:
manage.py:
from flask.cli import FlaskGroup
from project import create_app, db
from project.api.models import User
...
...
error output:
File "/usr/src/app/manage.py", line 1, in <module>
from flask.cli import FlaskGroup
File "/usr/local/lib/python3.10/site-packages/flask/__init__.py", line 14, in <module>
from jinja2 import escape
ImportError: cannot import name 'escape' from 'jinja2' (/usr/local/lib/python3.10/site-packages/jinja2/__init__.py)
As I was checking previous commits where no import errors occurred after build, I didn't find any changes to the code that could cause this.
I've tried to upgrade the package with pip install --upgrade jinja2 even though that shouldn't be necessary since 3 commits before the import worked just fine. No change.
My requirements.txt file:
Flask==1.1.2
itsdangerous==2.0.1
Flask-RESTful==0.3.9
Flask-SQLAlchemy==2.5.1
Flask-Testing==0.8.1
Flask-DebugToolbar==0.11.0
Flask-CORS==3.0.10
Flask-Migrate==3.1.0
Flask-Bcrypt==0.7.1
gunicorn==20.1.0
psycopg2-binary==2.9.3
coverage==6.3.2
flake8==4.0.1
black==22.1.0
pyjwt==2.3.0
Thank you for any suggestions.