Import ROOT error

Hi,

I’m getting a ImportError: No module named ROOT message when I try and run pyROOT, which is also happening in the python interactive mode. I’ve seen many a topic on this, but none of the solutions helped me with my problem. Here are my paths as defined in my bashrc:

export ROOTSYS=/opt/root
export LD_LIBRARY_PATH=$ROOTSYS/lib:$PYTHONDIR/lib:$LD_LIBRARY_PATH
export PYTHONPATH=$ROOTSYS/lib:$PYTHONPATH
export PATH=${PATH}:${ROOTSYS}/bin

I’m running ROOT 5.34/01, Python 2.7.2+, GCC 4.6.1 on Linux Mint/Ubuntu.

I’ve also tried to source $ROOTSYS/bin/thisroot.sh, without any luck. Does anyone have any suggestions on what I might do next to diagnose my problem?

You can test an existing ROOT installation if it provides python bindings. Try “root-config --features” and see if the output contains “python”, or try “root-config --has-python” and see if you get “yes”.
If your current ROOT installation does not provide python bindings, you need to rebuild it from scratch, configuring it with “–enable-python” (note: “binary” and “development” packages of python >= 2.2 required). After the “configure” step, make sure that the “config.log” file contains “Result: Enabled support for … python, …” somewhere near its end.

[quote=“Pepe Le Pew”]You can test an existing ROOT installation if it provides python bindings. Try “root-config --features” and see if the output contains “python”, or try “root-config --has-python” and see if you get “yes”.
If your current ROOT installation does not provide python bindings, you need to rebuild it from scratch, configuring it with “–enable-python” (note: “binary” and “development” packages of python >= 2.2 required). After the “configure” step, make sure that the “config.log” file contains “Result: Enabled support for … python, …” somewhere near its end.[/quote]

Thanks, I noticed that python bindings were not enabled, even though they were enabled by default at the configure time. Python-dev was not installed, so the configure must have skipped this step (I got no warning or error however!). Everything appears to be working now though.