I checked and that can’t work because our Jupyter server only looks for kernels in:
/scratch/username/.local/share/jupyter/kernels
Actually, when I use the env script above I see that both the python and the ROOT kernel that are present in the folder above are configured to use the python of the ATLAS stack. That still does not work because both python stacks (ATLAS’ and LCG’s) are still mixed:
Traceback (most recent call last):
File "/cvmfs/atlas.cern.ch/repo/sw/software/0.0/StatAnalysis/0.0.2/InstallArea/x86_64-centos7-gcc11-opt/lib/JupyROOT/kernel/rootkernel.py", line 22, in <module>
from metakernel import MetaKernel
File "/cvmfs/atlas.cern.ch/repo/sw/software/0.0/StatAnalysis/0.0.2/InstallArea/x86_64-centos7-gcc11-opt/lib/ROOT/_facade.py", line 153, in _importhook
return _orig_ihook(name, *args, **kwds)
File "/cvmfs/sft.cern.ch/lcg/views/LCG_101swan/x86_64-centos7-gcc8-opt/lib/python3.9/site-packages/metakernel/__init__.py", line 1, in <module>
from ._metakernel import (
File "/cvmfs/atlas.cern.ch/repo/sw/software/0.0/StatAnalysis/0.0.2/InstallArea/x86_64-centos7-gcc11-opt/lib/ROOT/_facade.py", line 153, in _importhook
return _orig_ihook(name, *args, **kwds)
File "/cvmfs/sft.cern.ch/lcg/views/LCG_101swan/x86_64-centos7-gcc8-opt/lib/python3.9/site-packages/metakernel/_metakernel.py", line 22, in <module>
from ipykernel.kernelapp import IPKernelApp
File "/cvmfs/atlas.cern.ch/repo/sw/software/0.0/StatAnalysis/0.0.2/InstallArea/x86_64-centos7-gcc11-opt/lib/ROOT/_facade.py", line 153, in _importhook
return _orig_ihook(name, *args, **kwds)
File "/cvmfs/sft.cern.ch/lcg/views/LCG_101swan/x86_64-centos7-gcc8-opt/lib/python3.9/site-packages/ipykernel/__init__.py", line 2, in <module>
from .connect import *
File "/cvmfs/atlas.cern.ch/repo/sw/software/0.0/StatAnalysis/0.0.2/InstallArea/x86_64-centos7-gcc11-opt/lib/ROOT/_facade.py", line 153, in _importhook
return _orig_ihook(name, *args, **kwds)
File "/cvmfs/sft.cern.ch/lcg/views/LCG_101swan/x86_64-centos7-gcc8-opt/lib/python3.9/site-packages/ipykernel/connect.py", line 12, in <module>
import jupyter_client
File "/cvmfs/atlas.cern.ch/repo/sw/software/0.0/StatAnalysis/0.0.2/InstallArea/x86_64-centos7-gcc11-opt/lib/ROOT/_facade.py", line 153, in _importhook
return _orig_ihook(name, *args, **kwds)
File "/cvmfs/sft.cern.ch/lcg/views/LCG_101swan/x86_64-centos7-gcc8-opt/lib/python3.9/site-packages/jupyter_client/__init__.py", line 4, in <module>
from .connect import *
File "/cvmfs/atlas.cern.ch/repo/sw/software/0.0/StatAnalysis/0.0.2/InstallArea/x86_64-centos7-gcc11-opt/lib/ROOT/_facade.py", line 153, in _importhook
return _orig_ihook(name, *args, **kwds)
File "/cvmfs/sft.cern.ch/lcg/views/LCG_101swan/x86_64-centos7-gcc8-opt/lib/python3.9/site-packages/jupyter_client/connect.py", line 21, in <module>
import zmq
File "/cvmfs/atlas.cern.ch/repo/sw/software/0.0/StatAnalysis/0.0.2/InstallArea/x86_64-centos7-gcc11-opt/lib/ROOT/_facade.py", line 153, in _importhook
return _orig_ihook(name, *args, **kwds)
File "/cvmfs/sft.cern.ch/lcg/views/LCG_101swan/x86_64-centos7-gcc8-opt/lib/python3.9/site-packages/zmq/__init__.py", line 103, in <module>
from zmq import backend
File "/cvmfs/atlas.cern.ch/repo/sw/software/0.0/StatAnalysis/0.0.2/InstallArea/x86_64-centos7-gcc11-opt/lib/ROOT/_facade.py", line 153, in _importhook
return _orig_ihook(name, *args, **kwds)
File "/cvmfs/sft.cern.ch/lcg/views/LCG_101swan/x86_64-centos7-gcc8-opt/lib/python3.9/site-packages/zmq/backend/__init__.py", line 32, in <module>
raise original_error from None
File "/cvmfs/sft.cern.ch/lcg/views/LCG_101swan/x86_64-centos7-gcc8-opt/lib/python3.9/site-packages/zmq/backend/__init__.py", line 27, in <module>
_ns = select_backend(first)
File "/cvmfs/sft.cern.ch/lcg/views/LCG_101swan/x86_64-centos7-gcc8-opt/lib/python3.9/site-packages/zmq/backend/select.py", line 32, in select_backend
mod = import_module(name)
File "/cvmfs/atlas.cern.ch/repo/sw/software/0.0/StatAnalysis/0.0.2/InstallArea/x86_64-centos7-gcc11-opt/lib/python3.8/importlib/__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "/cvmfs/sft.cern.ch/lcg/views/LCG_101swan/x86_64-centos7-gcc8-opt/lib/python3.9/site-packages/zmq/backend/cython/__init__.py", line 6, in <module>
from . import (
ImportError: cannot import name 'constants' from partially initialized module 'zmq.backend.cython' (most likely due to a circular import) (/cvmfs/sft.cern.ch/lcg/views/LCG_101swan/x86_64-centos7-gcc8-opt/lib/python3.9/site-packages/zmq/backend/cython/__init__.py)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/cvmfs/atlas.cern.ch/repo/sw/software/0.0/StatAnalysis/0.0.2/InstallArea/x86_64-centos7-gcc11-opt/lib/python3.8/runpy.py", line 194, in _run_module_as_main
return _run_code(code, main_globals, None,
File "/cvmfs/atlas.cern.ch/repo/sw/software/0.0/StatAnalysis/0.0.2/InstallArea/x86_64-centos7-gcc11-opt/lib/python3.8/runpy.py", line 87, in _run_code
exec(code, run_globals)
File "/cvmfs/atlas.cern.ch/repo/sw/software/0.0/StatAnalysis/0.0.2/InstallArea/x86_64-centos7-gcc11-opt/lib/JupyROOT/kernel/rootkernel.py", line 25, in <module>
raise Exception("Error: package metakernel not found.(install it running 'pip install metakernel')")
Exception: Error: package metakernel not found.(install it running 'pip install metakernel')
metakernel
is a dependency of the ROOT C++ kernel that is not present in the ATLAS stack, but it is found in the LCG stack. metakernel
uses zmq
(via ipykernel
) which ends up erroring out. A similar thing happens with the python kernel.
For this to work, we would probably need metakernel
, ipykernel
and zmq
installed in the ATLAS stack for its python, to prevent going to the LCG stack. I am happy to help test this and make it work.
Note that when we will allow users to configure alternative stacks in SWAN for their sessions, the LCG environment will no longer be set underneath, so the alternative stack will be “on its own”. This means it will need to provide everything to make Jupyter kernels work. This is also a good reason to install the aforementioned packages in the ATLAS stack.