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

Outdated Dependencies - ImportError: cannot import name 'escape' from 'jinja2' #15

Open
TunaCici opened this issue Jan 18, 2024 · 0 comments · May be fixed by #16
Open

Outdated Dependencies - ImportError: cannot import name 'escape' from 'jinja2' #15

TunaCici opened this issue Jan 18, 2024 · 0 comments · May be fixed by #16

Comments

@TunaCici
Copy link

Following the guide, the application fails to launch due to "old" dependencies. Here's the exact error

Traceback (most recent call last):
  File "/home/<uname>/flask-example/app.py", line 4, in <module>
    from flask import Flask, session, url_for, redirect, render_template, request, abort, flash
  File "/home/<uname>/.local/lib/python3.9/site-packages/flask/__init__.py", line 14, in <module>
    from jinja2 import escape
ImportError: cannot import name 'escape' from 'jinja2' (/home/<uname>/.local/lib/python3.9/site-packages/jinja2/__init__.py)

Shouldn't matter too much, but here's my system information (running Ubuntu 22.04 LTS on Raspi 4b):

python3 -- version
> Python 3.9.2

python3 -m pip --version
> pip 20.3.4 from /usr/lib/python3/dist-packages/pip (python 3.9)

uname -a
> Linux raspberrypi 6.1.21-v8+ #1642 SMP PREEMPT Mon Apr  3 17:24:16 BST 2023 aarch64 GNU/Linux

lsb_release -a
> Distributor ID:	Debian
> Description:	Debian GNU/Linux 11 (bullseye)
> Release:	11
> Codename:	bullseye

I believe this is due to Flask version being too "old". Upgrading to newer version (e.g. =< 2.0) should fix the problem.

@TunaCici TunaCici changed the title Dependency Error - ImportError: cannot import name 'escape' from 'jinja2' Outdated Dependencies - ImportError: cannot import name 'escape' from 'jinja2' Jan 18, 2024
@TunaCici TunaCici linked a pull request Jan 18, 2024 that will close this issue
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

Successfully merging a pull request may close this issue.

1 participant