jupyter-notebook and jupyter-lab 3.11 stopped working

Artemio González López artemiog at mac.com
Fri Feb 16 19:09:58 UTC 2024


Both of these python ports stopped working recently (I’m running Sonoma on a 15” 2021 MacBook Pro). For jupyter-lab, the error I get when I try to run it is:

raceback (most recent call last):
  File "/opt/local/bin/jupyter-lab-3.11", line 33, in <module>
    sys.exit(load_entry_point('jupyterlab==3.0.13', 'console_scripts', 'jupyter-lab')())
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/local/bin/jupyter-lab-3.11", line 25, in importlib_load_entry_point
    return next(matches).load()
           ^^^^^^^^^^^^^^^^^^^^
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/importlib/metadata/__init__.py", line 202, in load
    module = import_module(match.group('module'))
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<frozen importlib._bootstrap>", line 1204, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1176, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1126, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "<frozen importlib._bootstrap>", line 1204, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1176, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1147, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 690, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 940, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/jupyterlab/__init__.py", line 7, in <module>
    from .labapp import LabApp
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/jupyterlab/labapp.py", line 15, in <module>
    from jupyterlab_server import slugify, WORKSPACE_EXTENSION
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/jupyterlab_server/__init__.py", line 4, in <module>
    from .app import LabServerApp
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/jupyterlab_server/app.py", line 7, in <module>
    from jupyter_server.extension.application import ExtensionApp, ExtensionAppJinjaMixin
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/jupyter_server/extension/application.py", line 21, in <module>
    from jupyter_server.serverapp import ServerApp
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/jupyter_server/serverapp.py", line 75, in <module>
    from jupyter_server.services.contents.filemanager import AsyncFileContentsManager, FileContentsManager
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/jupyter_server/services/contents/filemanager.py", line 15, in <module>
    from anyio import run_sync_in_worker_thread
ImportError: cannot import name 'run_sync_in_worker_thread' from 'anyio' (/opt/local/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/anyio/__init__.py)

For jupyter.notebook, the error is the following:

Traceback (most recent call last):
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/notebook/traittypes.py", line 235, in _resolve_classes
    klass = self._resolve_string(klass)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/traitlets/traitlets.py", line 2015, in _resolve_string
    return import_item(string)
           ^^^^^^^^^^^^^^^^^^^
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/traitlets/utils/importstring.py", line 33, 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 "/opt/local/bin/jupyter-notebook", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/jupyter_core/application.py", line 277, in launch_instance
    return super().launch_instance(argv=argv, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/traitlets/config/application.py", line 1073, in launch_instance
    app = cls.instance(**kwargs)
          ^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/traitlets/config/configurable.py", line 583, in instance
    inst = cls(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/traitlets/traitlets.py", line 1292, in __new__
    inst.setup_instance(*args, **kwargs)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/traitlets/traitlets.py", line 1335, in setup_instance
    super(HasTraits, self).setup_instance(*args, **kwargs)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/traitlets/traitlets.py", line 1311, in setup_instance
    init(self)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/notebook/traittypes.py", line 226, in instance_init
    self._resolve_classes()
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/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'

I suspect that the problem comes from deleting some dependency of both ports running port reclaim, but I am not sure. Should I just uninstall and the install both ports, or is there a better solution?

Thanks in advance,

Artemio Gonzalez Lopez
artemiog at mac.com



Artemio Gonzalez Lopez
artemiog at mac.com

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macports.org/pipermail/macports-users/attachments/20240216/50c2bacd/attachment.htm>


More information about the macports-users mailing list