Home | News | Documentation | Download

I can't import ROOT on jupyter notebook

I’m trying to use ROOT on Jupyter notebook but I can’t import it.


ModuleNotFoundError Traceback (most recent call last)
in
----> 1 import ROOT

ModuleNotFoundError: No module named ‘ROOT’

I’ve installed root with home-brew and I’m using anaconda

ROOT Version: 6.22.08_2
Platform: MacBook Air
Compiler:


Hi Kerb,

I suspect that some of the ROOT devs & experts may be able to help more, but there are perhaps a few things you could check to see where the problem might be.

Have you tried using PyROOT in an interactive Python session – in either your system python, or whichever Python was installed by anaconda? I don’t know all the details of installing ROOT with home-brew, but I think it has to identify your Python install in order to set up PyROOT and it might not have picked your anaconda install. For more information, see this page on PyROOT setup details.

Perhaps one “easy” workaround to your problem would be to install ROOT using conda as well, if that’s the package manager you’re using for Python:

conda install -c conda-forge root

I think it’s generally a good practice to keep things “within” conda when possible (I know for example there can be issues if you use conda and try to access packages installed with your system Python’s pip instead of conda’s pip).

The suggestion to use conda is good, there seems to be some problem with the brew installation (the ROOT python module can’t be found).

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