vatlab / sos

SoS workflow system for daily data analysis
http://vatlab.github.io/sos-docs
BSD 3-Clause "New" or "Revised" License
274 stars 45 forks source link

kernel dead after launching jupyter or jupyterlab on macbook pro M1 #1504

Closed bayeslearner closed 2 years ago

bayeslearner commented 2 years ago

Doesn't run.

bayeslearner commented 2 years ago

Here is the error. Issue with Python 3.10?

[I 2022-11-07 14:47:47.727 ServerApp] Kernel started: 2cd0fd6e-56c9-4786-90e4-a423c6a1c81e
Traceback (most recent call last):
  File "/opt/homebrew/Caskroom/miniforge/base/lib/python3.10/runpy.py", line 196, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/opt/homebrew/Caskroom/miniforge/base/lib/python3.10/runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "/opt/homebrew/Caskroom/miniforge/base/lib/python3.10/site-packages/sos_notebook/kernel.py", line 34, in <module>
    from .completer import SoS_Completer
  File "/opt/homebrew/Caskroom/miniforge/base/lib/python3.10/site-packages/sos_notebook/completer.py", line 11, in <module>
    from .magics import SoS_Magics
  File "/opt/homebrew/Caskroom/miniforge/base/lib/python3.10/site-packages/sos_notebook/magics.py", line 10, in <module>
    from collections import Sized, OrderedDict, Sequence
ImportError: cannot import name 'Sized' from 'collections' (/opt/homebrew/Caskroom/miniforge/base/lib/python3.10/collections/__init__.py)
[I 2022-11-07 14:47:50.715 ServerApp] AsyncIOLoopKernelRestarter: restarting kernel (1/5), new random ports
Traceback (most recent call last):
  File "/opt/homebrew/Caskroom/miniforge/base/lib/python3.10/runpy.py", line 196, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/opt/homebrew/Caskroom/miniforge/base/lib/python3.10/runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "/opt/homebrew/Caskroom/miniforge/base/lib/python3.10/site-packages/sos_notebook/kernel.py", line 34, in <module>
    from .completer import SoS_Completer
  File "/opt/homebrew/Caskroom/miniforge/base/lib/python3.10/site-packages/sos_notebook/completer.py", line 11, in <module>
    from .magics import SoS_Magics
  File "/opt/homebrew/Caskroom/miniforge/base/lib/python3.10/site-packages/sos_notebook/magics.py", line 10, in <module>
    from collections import Sized, OrderedDict, Sequence
ImportError: cannot import name 'Sized' from 'collections' (/opt/homebrew/Caskroom/miniforge/base/lib/python3.10/collections/__init__.py)
[I 2022-11-07 14:47:53.741 ServerApp] AsyncIOLoopKernelRestarter: restarting kernel (2/5), new random ports
Traceback (most recent call last):
  File "/opt/homebrew/Caskroom/miniforge/base/lib/python3.10/runpy.py", line 196, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/opt/homebrew/Caskroom/miniforge/base/lib/python3.10/runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "/opt/homebrew/Caskroom/miniforge/base/lib/python3.10/site-packages/sos_notebook/kernel.py", line 34, in <module>
    from .completer import SoS_Completer
  File "/opt/homebrew/Caskroom/miniforge/base/lib/python3.10/site-packages/sos_notebook/completer.py", line 11, in <module>
    from .magics import SoS_Magics
  File "/opt/homebrew/Caskroom/miniforge/base/lib/python3.10/site-packages/sos_notebook/magics.py", line 10, in <module>
    from collections import Sized, OrderedDict, Sequence
ImportError: cannot import name 'Sized' from 'collections' (/opt/homebrew/Caskroom/miniforge/base/lib/python3.10/collections/__init__.py)
BoPeng commented 2 years ago

This is related to Python 3.10 (should import Sized from collections.abc). I am submitting a patch.

BoPeng commented 2 years ago

This has been fixed quite a while ago (https://github.com/vatlab/sos-notebook/pull/337). Could you please upgrade to the latest version of sos-notebook?