-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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 'get_current_traceback' from 'werkzeug.debug.tbtools' #1992
Comments
Update. I have downgraded the werkzeug version to 2.0.0 and it works. For some reason, 2.1.0 doesn't. FYI. Thanks for your efforts. |
Just commenting that I hit the same issue with Werkzeug--pinning 2.0.3 seemed to resolve--Linux Mint 20.3 |
From Werkzeug 2.1.0 release notes (https://werkzeug.palletsprojects.com/en/2.1.x/changes/#version-2-1-0):
|
It seems that I simply replaced |
I can't downgrade. I have Python 3.8.8 If I run I get Looking in indexes: Werkzeug== |
you have a space between the |
@Bachibouzouk I did this initially in #1993, but that would mean giving up Python 3.6 compatibility. I'm not sure what the Dash view is on this, given it's EOL (I couldn't find any open issues about it on GitHub), but I figured we should just bound the dependencies until there's an explicit agreement to drop 3.6. |
|
Pinning a dependency’s max version is a good idea in the following situations:
It’s not a good medium or even long term solution for a library like dash. Library projects should have conditional code that copes with both new and old dependency versions if possible, and if not, raise minimum dependency versions (in this case, Python’s) see here for reasons: https://iscinumpy.dev/post/bound-version-constraints/ |
@deepyaman Thanks for attempting a PR fix on this. I haven't looked at the details yet (except pinning version in our CI), but if it is only the name that has changed of what is imported, would something like the common import catching pattern try:
from werkzeug.debug.tbtools import DebugTraceback
except ImportError: # temporary fallback for werkzeug<2.1
from werkzeug.debug.tbtools import get_current_traceback as DebugTraceback (together with replacing |
@anders-kiaer - this work to get rid of the error, I am not sure it keeps the desired functionality (The |
@anders-kiaer I think it would work with a bit more effort. def DebugTraceback(e: Exception):
return get_current_traceback() or something like that (very rough here). |
Interesting article, thanks for sharing. Just for context, I was alerted this this issues due to a tool we've been working on called edgetest. It helps automate the upper pins and is in the same realm of GitHub's dependabot. Full disclosure I'm one of the devs who works on this package. Just sharing incase this could be useful to anyone. At a minimum it will test the latest versions and bump them up only if your CICD testing passes. There is also an action to help automate some of this. |
Actually, there's some other work that would need to be done. Working on an implementation, but here's another change from: to: But I can account for this. |
You are life saver bro. Thanks a lot:) |
@alexcjohnson @T4rk1n plotly/jupyter-dash#83 is a very similar issue. I've tried to use #1995 as the basis for a similar proposed fix in plotly/jupyter-dash#82. The other possibility is to not reimplement the logic over there, and refactor the |
I'm facing a similar issue here. Whenever I try to import I've tried to downgrade the werkzeug version from 2.2.3 to 2.0.0 as suggested by the initial poster here by running
and
|
@noble-g versions of Dash since 2.3.1 that include the fix for this in #1995 don’t import |
I am working on a Dash app and it was working great till yesterday. When I tried today, I am seeing the following:
Traceback (most recent call last):
File "/app/app-v2.py", line 12, in
import dash
File "/usr/local/lib/python3.9/site-packages/dash/init.py", line 5, in
from .dash import Dash, no_update # noqa: F401,E402
File "/usr/local/lib/python3.9/site-packages/dash/dash.py", line 18, in
from werkzeug.debug.tbtools import get_current_traceback
ImportError: cannot import name 'get_current_traceback' from 'werkzeug.debug.tbtools' (/usr/local/lib/python3.9/site-packages/werkzeug/debug/tbtools.py)
I am running the app on macOS Catalina. Happy to provide more details.
The text was updated successfully, but these errors were encountered: