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

ImportError: cannot import name 'escape' from 'werkzeug.utils' #158

Open
sungakim816 opened this issue Apr 24, 2022 · 4 comments
Open

ImportError: cannot import name 'escape' from 'werkzeug.utils' #158

sungakim816 opened this issue Apr 24, 2022 · 4 comments

Comments

@sungakim816
Copy link

Encountered on flask run command

Traceback (most recent call last):
File "C:\Users\sunga.virtualenvs\spaceflask-ZdvwGELI\lib\site-packages\flask\cli.py", line 234, in locate_app
import(module_name)
File "C:\Users\sunga\Documents\Repositories\spaceflask\spaceflask\app.py", line 51, in
blog_engine.init_app(app=app, storage=sql_storage)
File "C:\Users\sunga.virtualenvs\spaceflask-ZdvwGELI\lib\site-packages\flask_blogging\engine.py", line 98, in init_app
from .views import create_blueprint
File "C:\Users\sunga.virtualenvs\spaceflask-ZdvwGELI\lib\site-packages\flask_blogging\views.py", line 13, in
from feedwerk.atom import AtomFeed
File "C:\Users\sunga.virtualenvs\spaceflask-ZdvwGELI\lib\site-packages\feedwerk\atom.py", line 25, in
from werkzeug.utils import escape
ImportError: cannot import name 'escape' from 'werkzeug.utils' (C:\Users\sunga.virtualenvs\spaceflask-ZdvwGELI\lib\site-packages\werkzeug\utils.py)

@mar1ad
Copy link
Contributor

mar1ad commented Apr 24, 2022

apparently werkzeug deprecated werkzeug.utils.escape in v2.0.0 [1] and removed it in v2.1.0 [2].
The changelog says: "Remove escape and unescape. Use MarkupSafe instead."

A temporary workaround would be to use werkzeug<2.1.0

[1] pallets/werkzeug@e13b8fb
[2] https://werkzeug.palletsprojects.com/en/2.1.x/changes/#version-2-1-0%20[3]%20https://github.com/crossbario/crossbar/pull/1974

@mar1ad
Copy link
Contributor

mar1ad commented Apr 24, 2022

Created PR with project uniphil/feedwerk#2

@uniphil
Copy link

uniphil commented Apr 24, 2022

Fixes should be live in feedwerk == 1.1.0!

@mar1ad
Copy link
Contributor

mar1ad commented May 1, 2022

A fresh install, with Werkzeug==2.1.2 and feedwerk==1.1.0, works.
Thanks @sungakim816 for reporting and @uniphil for the quick release.

@gouthambs, this issue can be closed.

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

3 participants