Skip to content
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

traitlets needs to be pinned to 5.9.0 #49

Open
bakeromso opened this issue Dec 28, 2023 · 1 comment
Open

traitlets needs to be pinned to 5.9.0 #49

bakeromso opened this issue Dec 28, 2023 · 1 comment

Comments

@bakeromso
Copy link

I get the error

$ python -m jupyter notebook
Traceback (most recent call last):
  File "/home/user/.pyenv/versions/cw/lib/python3.9/site-packages/notebook/traittypes.py", line 235, in _resolve_classes
    klass = self._resolve_string(klass)
  File "/home/user/.pyenv/versions/cw/lib/python3.9/site-packages/traitlets/traitlets.py", line 2018, in _resolve_string
    return import_item(string)
  File "/home/user/.pyenv/versions/cw/lib/python3.9/site-packages/traitlets/utils/importstring.py", line 31, in import_item
    module = __import__(package, fromlist=[obj])
ModuleNotFoundError: No module named 'jupyter_server.contents'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/user/.pyenv/versions/cw/bin/jupyter-notebook", line 8, in <module>
    sys.exit(main())
  File "/home/user/.pyenv/versions/cw/lib/python3.9/site-packages/jupyter_core/application.py", line 281, in launch_instance
    super().launch_instance(argv=argv, **kwargs)
  File "/home/user/.pyenv/versions/cw/lib/python3.9/site-packages/traitlets/config/application.py", line 1075, in launch_instance
    app = cls.instance(**kwargs)
  File "/home/user/.pyenv/versions/cw/lib/python3.9/site-packages/traitlets/config/configurable.py", line 583, in instance
    inst = cls(*args, **kwargs)
  File "/home/user/.pyenv/versions/cw/lib/python3.9/site-packages/traitlets/traitlets.py", line 1294, in __new__
    inst.setup_instance(*args, **kwargs)
  File "/home/user/.pyenv/versions/cw/lib/python3.9/site-packages/traitlets/traitlets.py", line 1337, in setup_instance
    super(HasTraits, self).setup_instance(*args, **kwargs)
  File "/home/user/.pyenv/versions/cw/lib/python3.9/site-packages/traitlets/traitlets.py", line 1313, in setup_instance
    init(self)
  File "/home/user/.pyenv/versions/cw/lib/python3.9/site-packages/notebook/traittypes.py", line 226, in instance_init
    self._resolve_classes()
  File "/home/user/.pyenv/versions/cw/lib/python3.9/site-packages/notebook/traittypes.py", line 238, in _resolve_classes
    warn(f"{klass} is not importable. Is it installed?", ImportWarning)
TypeError: warn() missing 1 required keyword-only argument: 'stacklevel'

As suggested by https://stackoverflow.com/questions/77549493/modulenotfounderror-no-module-named-jupyter-server-contents, this is solved by uninstalling traitlets and reinstalling to fixed version of 5.9.0. I suggest to add it to requirements.txt, but I can´t test it right. However, reinstalling and installing to this version fixes this issue for me.

@prockallsyms
Copy link

This is no longer the case, instead notebook should be pinned at 6.5.6 due to recent patches.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants