As the import error comes from flask File "/usr/local/lib/python3.7/site-packages/flask/__init__.py
I tried to create a new Flask application using Flask==1.0.2
and found that the error comes from this version of Flask when it used with Jinja2>=2.10.1
.
But when you remove Flask==1.0.2
and install Flask==2.0.3
, everything works fine.
pip uninstall Flask Jinja2
pip install Flask Jinja2
Dependencies
pip freeze
click==8.0.4
Flask==2.0.3
itsdangerous==2.1.2
Jinja2==3.1.1
MarkupSafe==2.1.1
Werkzeug==2.0.3