You are not logged in.

#1 2021-03-24 07:35:57

arnuld
Member
From: INDIA
Registered: 2005-12-19
Posts: 220
Website

[SOLVED] Jupyter Notebook runs fine but Jupyter Lab crashes

Jupyter Lab keeps on crashing everything I run it. Jupyter Notebook runs fine:

[arnuld@arch64 ~]$ jupyter-lab
Traceback (most recent call last):
  File "/usr/lib/python3.9/site-packages/pkg_resources/__init__.py", line 568, in _build_master
    ws.require(__requires__)
  File "/usr/lib/python3.9/site-packages/pkg_resources/__init__.py", line 886, in require
    needed = self.resolve(parse_requirements(requirements))
  File "/usr/lib/python3.9/site-packages/pkg_resources/__init__.py", line 777, in resolve
    raise VersionConflict(dist, req).with_context(dependent_req)
pkg_resources.ContextualVersionConflict: (jupyter-packaging 0.8.0 (/usr/lib/python3.9/site-packages), Requirement.parse('jupyter_packaging~=0.7.3'), {'jupyterlab'})

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/bin/jupyter-lab", line 33, in <module>
    sys.exit(load_entry_point('jupyterlab==3.0.12', 'console_scripts', 'jupyter-lab')())
  File "/usr/bin/jupyter-lab", line 25, in importlib_load_entry_point
    return next(matches).load()
  File "/usr/lib/python3.9/importlib/metadata.py", line 77, in load
    module = import_module(match.group('module'))
  File "/usr/lib/python3.9/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
  File "<frozen importlib._bootstrap>", line 972, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
  File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
  File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 790, in exec_module
  File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
  File "/usr/lib/python3.9/site-packages/jupyterlab/__init__.py", line 7, in <module>
    from .labapp import LabApp
  File "/usr/lib/python3.9/site-packages/jupyterlab/labapp.py", line 15, in <module>
    from jupyterlab_server import slugify, WORKSPACE_EXTENSION
  File "/usr/lib/python3.9/site-packages/jupyterlab_server/__init__.py", line 4, in <module>
    from .app import LabServerApp
  File "/usr/lib/python3.9/site-packages/jupyterlab_server/app.py", line 16, in <module>
    from .handlers import add_handlers, LabConfig
  File "/usr/lib/python3.9/site-packages/jupyterlab_server/handlers.py", line 24, in <module>
    from .translations_handler import TranslationsHandler
  File "/usr/lib/python3.9/site-packages/jupyterlab_server/translations_handler.py", line 16, in <module>
    from .translation_utils import get_language_pack, get_language_packs, is_valid_locale, translator
  File "/usr/lib/python3.9/site-packages/jupyterlab_server/translation_utils.py", line 15, in <module>
    import pkg_resources
  File "/usr/lib/python3.9/site-packages/pkg_resources/__init__.py", line 3243, in <module>
    def _initialize_master_working_set():
  File "/usr/lib/python3.9/site-packages/pkg_resources/__init__.py", line 3226, in _call_aside
    f(*args, **kwargs)
  File "/usr/lib/python3.9/site-packages/pkg_resources/__init__.py", line 3255, in _initialize_master_working_set
    working_set = WorkingSet._build_master()
  File "/usr/lib/python3.9/site-packages/pkg_resources/__init__.py", line 570, in _build_master
    return cls._build_from_requirements(__requires__)
  File "/usr/lib/python3.9/site-packages/pkg_resources/__init__.py", line 583, in _build_from_requirements
    dists = ws.resolve(reqs, Environment())
  File "/usr/lib/python3.9/site-packages/pkg_resources/__init__.py", line 772, in resolve
    raise DistributionNotFound(req, requirers)
pkg_resources.DistributionNotFound: The 'jupyter_packaging~=0.7.3' distribution was not found and is required by jupyterlab
[arnuld@arch64 ~]$ 

It complains about Jupyter packaging version which is older than what is available with pacman. Also, I have nothing installed in my ~/.local, no bin and lib there:

[arnuld@arch64 ~]$ ls ~/.local/
share/

[arnuld@arch64 ~]$ which pip
/usr/bin/pip

[arnuld@arch64 ~]$ which jupyter-lab
/usr/bin/jupyter-lab


[arnuld@arch64 ~]$ pacman -Q jupyterlab
jupyterlab 3.0.12-1

[arnuld@arch64 ~]$ pacman -Q python-jupyter_packaging
python-jupyter_packaging 0.8.0-1

I have removed all python and jupyter related files and directories in my ~/.cache and ~/.config but still problem persists.

Last edited by arnuld (2021-03-25 03:13:09)

Offline

#2 2021-03-24 07:51:38

d_fajardo
Member
Registered: 2017-07-28
Posts: 1,687

Re: [SOLVED] Jupyter Notebook runs fine but Jupyter Lab crashes

I am also having trouble with jupyterlab. It seems the python-jupyter_packaging needs to be updated.
When I run jupyter lab build, I get this:

Traceback (most recent call last):
  File "/usr/lib/python3.9/site-packages/pkg_resources/__init__.py", line 568, in _build_master
    ws.require(__requires__)
  File "/usr/lib/python3.9/site-packages/pkg_resources/__init__.py", line 886, in require
    needed = self.resolve(parse_requirements(requirements))
  File "/usr/lib/python3.9/site-packages/pkg_resources/__init__.py", line 777, in resolve
    raise VersionConflict(dist, req).with_context(dependent_req)
pkg_resources.ContextualVersionConflict: (jupyter-packaging 0.8.0 (/usr/lib/python3.9/site-packages), Requirement.parse('jupyter_packaging~=0.7.3'), {'jupyterlab'})

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/bin/jupyter-lab", line 33, in <module>
    sys.exit(load_entry_point('jupyterlab==3.0.12', 'console_scripts', 'jupyter-lab')())
  File "/usr/bin/jupyter-lab", line 25, in importlib_load_entry_point
    return next(matches).load()
  File "/usr/lib/python3.9/importlib/metadata.py", line 77, in load
    module = import_module(match.group('module'))
  File "/usr/lib/python3.9/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
  File "<frozen importlib._bootstrap>", line 972, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
  File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
  File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 790, in exec_module
  File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
  File "/usr/lib/python3.9/site-packages/jupyterlab/__init__.py", line 7, in <module>
    from .labapp import LabApp
  File "/usr/lib/python3.9/site-packages/jupyterlab/labapp.py", line 15, in <module>
    from jupyterlab_server import slugify, WORKSPACE_EXTENSION
  File "/usr/lib/python3.9/site-packages/jupyterlab_server/__init__.py", line 4, in <module>
    from .app import LabServerApp
  File "/usr/lib/python3.9/site-packages/jupyterlab_server/app.py", line 16, in <module>
    from .handlers import add_handlers, LabConfig
  File "/usr/lib/python3.9/site-packages/jupyterlab_server/handlers.py", line 24, in <module>
    from .translations_handler import TranslationsHandler
  File "/usr/lib/python3.9/site-packages/jupyterlab_server/translations_handler.py", line 16, in <module>
    from .translation_utils import get_language_pack, get_language_packs, is_valid_locale, translator
  File "/usr/lib/python3.9/site-packages/jupyterlab_server/translation_utils.py", line 15, in <module>
    import pkg_resources
  File "/usr/lib/python3.9/site-packages/pkg_resources/__init__.py", line 3243, in <module>
    def _initialize_master_working_set():
  File "/usr/lib/python3.9/site-packages/pkg_resources/__init__.py", line 3226, in _call_aside
    f(*args, **kwargs)
  File "/usr/lib/python3.9/site-packages/pkg_resources/__init__.py", line 3255, in _initialize_master_working_set
    working_set = WorkingSet._build_master()
  File "/usr/lib/python3.9/site-packages/pkg_resources/__init__.py", line 570, in _build_master
    return cls._build_from_requirements(__requires__)
  File "/usr/lib/python3.9/site-packages/pkg_resources/__init__.py", line 583, in _build_from_requirements
    dists = ws.resolve(reqs, Environment())
  File "/usr/lib/python3.9/site-packages/pkg_resources/__init__.py", line 772, in resolve
    raise DistributionNotFound(req, requirers)
pkg_resources.DistributionNotFound: The 'jupyter_packaging~=0.7.3' distribution was not found and is required by jupyterlab

As you can see, it is looking for 0.7.3 version while the updated version is 0.8.0.. I haven't tried downgrading the package hoping there might be another jupyter update.

Offline

#3 2021-03-24 09:20:47

lrz
Member
Registered: 2019-12-12
Posts: 7

Re: [SOLVED] Jupyter Notebook runs fine but Jupyter Lab crashes

Same problem here. I downgraded to jupyter_packaging 7.12 and it now works.

(If it can help someone:

sudo pacman -U /var/cache/pacman/pkg/python-jupyter_packaging-0.7.12-1-any.pkg.tar.zst

)

Offline

#4 2021-03-24 13:11:05

arnuld
Member
From: INDIA
Registered: 2005-12-19
Posts: 220
Website

Re: [SOLVED] Jupyter Notebook runs fine but Jupyter Lab crashes

Someone has opened a bug report on this: FS#70142. For now, I will wait for it to be solved.

Offline

#5 2021-03-24 17:00:15

teXnican
Member
Registered: 2018-09-21
Posts: 28

Re: [SOLVED] Jupyter Notebook runs fine but Jupyter Lab crashes

I can confirm the crash.

Offline

#6 2021-03-24 19:18:15

d_fajardo
Member
Registered: 2017-07-28
Posts: 1,687

Re: [SOLVED] Jupyter Notebook runs fine but Jupyter Lab crashes

I can confirm with the latest updates jupyter lab build ran without problems anymore. Fixed.

Offline

#7 2021-03-24 20:20:30

lrz
Member
Registered: 2019-12-12
Posts: 7

Re: [SOLVED] Jupyter Notebook runs fine but Jupyter Lab crashes

Thanks arojas for the quick fix! (And also thank you for all the packaging work related to jupyter and sagemath, extremely useful to me.)

Offline

Board footer

Powered by FluxBB