Issue with using ROOT in Jupyter

I am using binary for ubuntu downloaded CERN.

Standalone I can start root.

When I try to use is as “Import ROOT” in Jupyter I get the following

ModuleNotFoundError: No module named ‘ROOT’

I see that others have also reported this issue but I have not been able to find a solution that worked. I am using python 3.9 with Ubuntu 21. I have also tried with ubuntu 20 same problem.

ROOT Version: 6.24.04
Platform: Ubuntu
Compiler: Not Provided


Hello,

You need to configure your environment first by running source $ROOT_INSTALLATION_DIR/bin/thisroot.sh.

Then you should be able to run root --notebook, which will spawn a Jupyter notebook where you will be able to use ROOT.

Hi Etejedor,

Great help.

I just had to do root –notebook to get the web base interface working.

Two additional questions:

Sorry I didn’t get the questions?

Two additional questions:

  1. It looks like the latest version of root is build with python 3.8, I have 3.9 on my Ubuntu 20.04. I would downgrade it, unless you have plans to release a python 3.9 version.

  2. I have been using the jupyter desktop app for my work. What is the equivalent of root –notebook to use the desktop app.

jupyterlab desktop is available from github. As a new user I cannot add link here.

I just posted in on root-forum.cern.ch

Shekhar

Yes the binaries are built for python3.8, so you’ll need to use that version or build ROOT from sources for Python3.9.

Regarding the question about root --notebook, there’s no equivalent for the desktop app. But you can alwyays make sure PYTHONPATH is set to point to the ROOT installation when running the desktop app.

Can you please tell me where the PYTHONPATH is ?

It’s an environment variable that tells Python where to search for modules. You can try setting it at the terminal by running source $ROOT_INSTALLATION_DIR/bin/thisroot.sh before running the desktop app from the terminal.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.