ImportError: cannot import name ‘safe_str_cmp’ from ‘’

The problem

any ideas why this error?

my project was working fine, i copied it to an external drive and onto my laptop to work on the road, it worked fine. i copied back to my desktop and had a load of issues with invalid interpreters etc, so i made a new project and copied just the scripts in, made a new requirements.txt and installed all the packages, but when i run i get this error

Traceback (most recent call last):
File "E:\Dev\spot_new\flask_blog\", line 1, in
from flaskblog import app
File "E:\Dev\spot_new\flask_blog\flaskblog\", line 3, in
from flask_bcrypt import Bcrypt
File "E:\Dev\spot_new\venv\lib\site-packages\", line 21, in
from import safe_str_cmp
ImportError: cannot import name 'safe_str_cmp' from '' (E:\Dev\spot_new\venv\lib\site-packages\werkzeug\

i’ve tried uninstalling python, anaconda, pycharm, deleting every reg key and environment variable i can find that looks pythonic, reinstalling all from scratch but still no dice.

any input greatly appreciated!


Answer 1:

Werkzeug released v2.1.0 today, removing

You can probably resolve this issue by pinning Werkzeug~=2.0.0 in your requirements.txt file (or similar).