General PyRoot Information


I looked on the ROOT site about what PyRoot was, and I am still a little bit confused. How is PyRoot different from Root? If I downloaded a binary for Root, do I only need to import it to the python environment I use, then it should be working?

Also, what is the CINT interpreter?



yes: you just need to “import ROOT” to access the entire set of classes of ROOT (and yours, too!) from Python.
Since you have also additional questions, I propose you visit our “Getting Started” section:


I tried that with some sample code and the shell says there is no module named root. Should I try saving the distribution of Root I have somewhere else?


Is the root envirnment properly set? Do you see the file in the lib directory of ROOT?


Yes it is

Are you sure you typed

. your/root/dir/bin/

What is the content of the $PYTHONPATH variable?

looks like its not set to anything. What should I set it to?


did you run the command above with the proper dir structure?


I believe so

This is odd.
The script sets that variable: …

Could you double check?


I ran the script in Terminal, and the path is now @libdir@. However I still get the same import error, claiming there is no module named ROOT. Also when I quit out of Terminal and restart it, it says the pythonpath variable is not set to anything.

Also, maybe I am trying to import it incorrectly. This is the script I am trying to run: from ROOT import gROOT, TCanvas, TF1.

What do you mean by @libdir@? A full path? If yes, is it the correct one, i.e. the one containing all root li raries and the ROOT module, i.e. the file?
The setup of the environment is of course not correctly set once opening a other terminal.
PYTHONPATH needs to be set for the ROOT module to be inportable.