1

R kernel is not working under SoS Notebook (under a regular notebook there is no error).

The following error appear for any command:

cannot import name 'Sequence' from 'collections' (/usr/lib/python3.10/collections/__init__.py)

and the console shows the warning:

WARNING: Failed to locate subkernel R with kernel "ir" and language "R": cannot import name 'Sequence' from 'collections' (/usr/lib/python3.10/collections/__init__.py)

Error using R kernel in SoS

Here some details of my installation:

$ jupyter kernelspec list
Available kernels:
  bash       /home/leoca/.local/share/jupyter/kernels/bash
  ir         /home/leoca/.local/share/jupyter/kernels/ir
  octave     /home/leoca/.local/share/jupyter/kernels/octave
  python3    /home/leoca/.local/share/jupyter/kernels/python3
  sos        /home/leoca/.local/share/jupyter/kernels/sos

$ pip list | grep sos
sos                               0.23.4
sos-bash                          0.20.0
sos-notebook                      0.23.4
sos-r                             0.19.6
LEo
  • 477
  • 5
  • 14
  • Same issue for me... – bli Jan 27 '23 at 18:07
  • This seems to be a python version issue. With 3.6, I can do `from collections import Sequence`. With 3.10, I get an `ImportError: cannot import name 'Sequence' from 'collections`. See https://stackoverflow.com/a/69598162/1878788 – bli Jan 27 '23 at 18:39
  • Someone proposed a bug fix: https://github.com/vatlab/sos-r/pull/29/commits/242e0b2a3faa3782a6c1caafa098ef9280845390 However, it is not integrated in the main code yet, so meanwhile, you can edit your `lib/python3.10/site-packages/sos_r/kernel.py` file manually. – bli Jan 28 '23 at 08:09

0 Answers0