Can't import ROOT using PyROOT

Hi All,

I intend to use PyRoot in analyzing a ROOT file, but I get the following error:

File "", line 1, in <module>
import ROOT
ModuleNotFoundError: No module named 'ROOT'

As per this post, executing root-config --has-python on WSL gives me a no

I am able to use ROOT though. Can anyone please assist me in installing PyRoot to a system with already-installed ROOT?

I think @etejedor can help you.


PyROOT cannot be installed separately from ROOT as of today, I would recommend you do a second installation of ROOT if the one you have does not have PyROOT.

conda could be a good option:

Note that the correct option in recent ROOT versions is --has-pyroot, not --has-python :grimacing: (EDIT: even more recent ROOT versions will actually complain when root-config is passed an invalid option rather than just replying “no”).

How did you install ROOT? Can you start the prompt running the root command from the terminal?

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