glotzerlab / signac-dashboard

Rapidly visualize signac projects through a customizable dashboard interface.
https://signac.io
BSD 3-Clause "New" or "Revised" License
16 stars 6 forks source link

cannot import name 'url_decode' from 'werkzeug.urls #201

Closed tylerflex closed 1 year ago

tylerflex commented 1 year ago

Hopefully someone can give some guidance. Am not able to import Signac-dashboard due to something with werkzeug.urls.

Thanks in advance for your help!

Description

I installed signac signac-flow and signac-dashboard through pip. (0.6.0).

Then, I tried running the example from the documentation

from signac_dashboard import Dashboard
from signac_dashboard.modules import StatepointList, DocumentList, ImageViewer, Schema

if __name__ == '__main__':
    modules = [StatepointList(), DocumentList(), ImageViewer(context="JobContext"),
               ImageViewer(context="ProjectContext"), Schema()]
    Dashboard(modules=modules).main()

And got the following error

cannot import name 'url_decode' from 'werkzeug.urls'

full trace below

To reproduce

Run the steps above. Note: on MacOS running python 3.10

Error output

Traceback (most recent call last):
  File "/Users/twhughes/Desktop/splitter/dashboard.py", line 1, in <module>
    from signac_dashboard import Dashboard
  File "/Users/twhughes/.pyenv/versions/3.10.9/lib/python3.10/site-packages/signac_dashboard/__init__.py", line 4, in <module>
    from . import modules
  File "/Users/twhughes/.pyenv/versions/3.10.9/lib/python3.10/site-packages/signac_dashboard/modules/__init__.py", line 1, in <module>
    from .document_editor import DocumentEditor
  File "/Users/twhughes/.pyenv/versions/3.10.9/lib/python3.10/site-packages/signac_dashboard/modules/document_editor.py", line 7, in <module>
    import flask_login
  File "/Users/twhughes/.pyenv/versions/3.10.9/lib/python3.10/site-packages/flask_login/__init__.py", line 12, in <module>
    from .login_manager import LoginManager
  File "/Users/twhughes/.pyenv/versions/3.10.9/lib/python3.10/site-packages/flask_login/login_manager.py", line 33, in <module>
    from .utils import _create_identifier
  File "/Users/twhughes/.pyenv/versions/3.10.9/lib/python3.10/site-packages/flask_login/utils.py", line 14, in <module>
    from werkzeug.urls import url_decode
ImportError: cannot import name 'url_decode' from 'werkzeug.urls'

System configuration

macOS-12.5.1-arm64-arm-64bit
3.10.9 (main, Dec 30 2022, 09:25:19) [Clang 14.0.0 (clang-1400.0.29.202)]

can't import Signac-dashboard due to issue, but installed version 0.6.0. This issue persists in 0.5 werkzeug version 3.0.0

bdice commented 1 year ago

@tylerflex This thread has some context: https://github.com/glotzerlab/signac-dashboard/pull/196#issuecomment-1743821052

I think you can work around this by using werkzeug>=2.1.0, < 3.0, but signac-dashboard hasn't made a release with this pinning yet. I think we're hoping this pinning can be handled upstream of signac-dashboard.

tylerflex commented 1 year ago

Thanks for your response, what worked in the end was

werkzeug==2.3.0
flask==2.1.0

Thank you! feel free to close