'Dash ImportError: cannot import name 'get_current_traceback' from 'werkzeug.debug.tbtools'
I'm trying to run a simple dash app in a conda environment in Pycharm, however I'm running into the error in the title. Weirdly enough, I couldn't find a place on the internet which has a mention of this bug, except for here. The code is simple, as all I'm trying to run is a simple dashapp; code obtained the code from here. I have tried switching between python versions in conda (back and forth between python 3.9, 3.8 and 3.7) but the error seems to be persistent. I know I have also correctly installed all its dependencies as I'm not getting any import error. Would appreciate if anyone could help with this.
Edit: Versions of Dash installed, as requested by @coralvanda :

Basically, I just did a pip install of everything so all the versions of packages are the latest.
Solution 1:[1]
I've been in the same problem.
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:[2]
This is caused by dash and fixed in the new 2.3.1 release. So simply do:
pip install -U dash
If that doesn't help, you have to downgrade werkzeug manually, e.g.,
pip install werkzeug==2.0.3
Solution 3:[3]
This problem is not new, it effects Dash well back into the 1.x releases.
Both of the above answers have part of the solution (i.e. the one that worked for me).
It is a werkzeug error, but it is not enough to upgrade werkzeug for some reason. You must manually uninstall first, and then install the correct version next.
I am using Dash 1.20 and the latest version of werkzeug that worked for me is 2.0.3. So,
pip uninstall werkzeug
and
pip install werkzeug==2.0.3
Note: there must not be any spaces around the ==.
THIS WILL FAIL : pip install werkzeug == 2.0.3
THIS WILL work: pip install werkzeug==2.0.3
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Cesarvspr |
| Solution 2 | CGFoX |
| Solution 3 | cssyphus |

