Skip to content
This repository has been archived by the owner on Nov 9, 2023. It is now read-only.

ImportError: cannot import name 'escape' from 'jinja2' #8

Open
bizimunda opened this issue Nov 2, 2022 · 5 comments
Open

ImportError: cannot import name 'escape' from 'jinja2' #8

bizimunda opened this issue Nov 2, 2022 · 5 comments

Comments

@bizimunda
Copy link

bizimunda commented Nov 2, 2022

I am getting this error message

Traceback (most recent call last):
File "/Users/hamid/GitLab/Gitlab_Techworld_nina/python-demoapp/src/run.py", line 2, in
from app import create_app
File "/Users/hamid/GitLab/Gitlab_Techworld_nina/python-demoapp/src/app/init.py", line 1, in
from flask import Flask
File "/Users/hamid/GitLab/Gitlab_Techworld_nina/python-demoapp/src/.venv/lib/python3.9/site-packages/flask/init.py", line 14, in
from jinja2 import escape
ImportError: cannot import name 'escape' from 'jinja2' (/Users/hamid/GitLab/Gitlab_Techworld_nina/python-demoapp/src/.venv/lib/python3.9/site-packages/jinja2/init.py)
make: *** [run] Error 1

and this is what I have in my requirement file

Flask==2.1.0
py-cpuinfo==7.0.0
psutil==5.8.0
gunicorn==20.1.0
black==20.8b1
flake8==3.9.0
pytest==7.1.2

@3ika3ika
Copy link

@benc-uk do you have solution for that ? Would be highly appreciated !

@benc-uk
Copy link
Owner

benc-uk commented Jan 22, 2023

Hi, This repo and app is really something I'm no longer supporting or using in anyway
Sorry

@leonidkiritschenko
Copy link

my solution from stackoverflow:

requirements.txt

Flask==2.1.0
py-cpuinfo==7.0.0
psutil==5.8.0
gunicorn==20.1.0
black==20.8b1
flake8==3.9.0
pytest==6.2.5

Sources:

  1. https://stackoverflow.com/a/71735103/3388671
  2. https://stackoverflow.com/a/69569206/3388671

@main-voice
Copy link

The solution from leonidkirischenko works well!

@Dustin-Wang
Copy link

Yeah, change the requirement.txt to
Flask>=2.2.2
py-cpuinfo==7.0.0
psutil==5.8.0
gunicorn==20.1.0
black==20.8b1
flake8==3.9.0
pytest==6.2.2
fix the issue

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

No branches or pull requests

6 participants