[Solved] Dash ImportError: cannot import name 'get_current_traceback' from 'werkzeug.debug.tbtools'

Python Mohit Mozumder

Problem:

I am getting the Dash application error when using versions dash<2.3.1 and werkzeug>=2.1.0. 

ImportError: cannot import name 'get_current_traceback' from 'werkzeug.debug.tbtools' 

This issue is discussed in GitHub at https://github.com/plotly/dash/issues/1992.


Solution 1:

firstly you can try this-

Uninstall the wrong version with:

pip uninstall werkzeug

Install the right one with:

pip install -v https://github.com/pallets/werkzeug
/archive/refs/tags/2.0.1.tar.gz

Solution 2:

This is caused by dash and fixed in the new 2.3.1 release. So try it-

pip install -U dash

If that doesn't help, you have to downgrade werkzueg manually, e.g.,

pip install werkzeug==2.0.3

Note: there must not be any spaces around the ==.
you have to write like this

pip install werkzeug==2.0.3


Thank you for reading the article. If you have any further problem feel free to ask us.