In the past I’ve always managed to get the c++ jupyter notebook working with root, compiled against python3 by pointing the PYTHON directory variables in cmake to the appropriate versions. Also, enabled PYTHON=ON, PYTHON3=ON, CLING=ON, CXX14=ON.
This time I did the same, I explicitly pointed cmake to the executable, library, and include variables to the python3.6 versions.
root notebook server starts normally, and I can open a python 2 notebook and python 3 notebook, but when
I try and open a c++ notebook it clearly is calling python 2:
/usr/bin/python: dynamic module does not define init function (initlibPyROOT)
I did try setting an alias for my user for python=python3, but that didn’t work. From what I read, setting such aliases or making symlinks system wide is ill-advised.
Another thing you can do, if you did root --notebook, is to look in your home directory:
~/.rootnb/kernels/root/kernel.json
The ROOT kernel is by default trying to run with python. If you modify that file to use python3 instead, it should pick the right one without aliasing.
THANKS!!!
This fixed it. It was suggested in other root forums and other jupyter forums to modify the kernel.json file, but they told me to try the one either in the /usr/local/jupyter/kernels folder or in <root_install>/etc/notebook/kernels/root. No one mentioned there was a user version in the home folder!!!