Start using PyRoot

I have Ubuntu 22.04
I installed python 3.10.6 and ROOT 6.28/04
But when I try to import ROOT in Python prompt, I get an error

ModuleNotFoundError: No module named ‘ROOT’

How do I start using ROOT in python

Hi @lapan ,

Easiest way:

conda create -n myenv -c conda-forge root

This will create a working conda environment with ROOT.

Faster version

Other things you may be doing (not recommended)

Maybe the reason why you get the ModuleNotFoundError is because you tried to install ROOT manually (e.g. by compiling the source code). I suggest you try one of the normal installation modes at Installing ROOT - ROOT

Cheers,
Vincenzo

Another common reason is that in the terminal where you started the python prompt you forgot to run source path/to/root/bin/thisroot.sh (see step 4 at Installing ROOT - ROOT ).