问题
I downloaded madpgraph5, but when I run it I get the following error:
ERROR: ROOT file called 'ROOT.py' or 'ROOT.pyc' is not found
ERROR: Please check that ROOT is properly installed.
When I try locate ROOT.py
and locate ROOT.pyc
, I get nothing.
I have root 5.34 installed and it runs smoothly. I also have python 2.7.6 installed.
I downloaded rootpy, but have no idea how to include and enable PyROOT. I searched and I think I have to edit something to do with the path in bashrc, but before I do it I need to be sure of what I am doing.
Can anyone help?
回答1:
You have probably figured out how to use it already, so just in case someone else stumbles over this question.
First make sure you built ROOT with Python support, root-config --features
should list python.
There are a few possibilities how to successfully use import ROOT
in Python:
- Add
export PYTHONPATH=$PYTHONPATH:$ROOTSYS/lib
to your .bashrc where$ROOTSYS
is the path to your ROOT installation. - The first way is the easiest, but in case you want to do something like
sudo pip install rootpy
, your local$PYTHONPATH
isn't used. Another way is to copy the filesROOT.py
andlibPyROOT.so
from path_to_root_installation/lib to /usr/lib/pythonX (replace X with your Python version). - Similar to the method above. But in case you recompile ROOT or change something else, a symbolic link might be better:
sudo ln -s /path_to_root/lib/ROOT.py /usr/lib/pythonX/ROOT.py
and for libPyROOT.so as well.
回答2:
You should install libroot-bindings-python-dev
-- it solves the issue.
来源:https://stackoverflow.com/questions/29979179/enable-pyroot-ubuntu-14-04