PyROOT on plain SLC5 distro


I just installed the SLC5 on a new machine with access to CERN AFS.

I set up the ROOT environment using ROOT from AFS as:

export ROOTSYS=/afs/
export PATH=$PATH:${ROOTSYS}/bin

ROOT itself is working perfectly, but then when I try to import ROOT inside Python, I get this error:

/afs/ RuntimeWarning: Python C API version mismatch for module libPyROOT: This Python has API version 1012, module libPyROOT has version 1013.
  import libPyROOT as _root

The error is caused by the default python 2.4 installed with SLC5, I guess.

So I went to the ROOT site and I tried to install the ROOT RPM marked “for SLC5”, thinking that if it was SLC5 oriented it would be targeted for Python 2.4 …but I get the same error about the missing Python 2.5 lib :slight_smile:

Now my question is:

How can I simply install ROOT+PyROOT over a standard SLC5 machine?

[maybe the RPM for SLC5 should be aware of the presence of Python 2.4 as default in SLC5…]

Maybe the easiest way is to use Python 2.5 from AFS, together with ROOT from AFS. What do you think?

And which env variables have I to set in order to use Python 2.5 from AFS, without removing the 2.4 from my machine?

Thanks a lot :slight_smile:

Best regards,



That being slc5 for the (3) LHC experiments, which then in addition have p2.5 installed as that is what is mainly used these days.

Getting python from afs should work, but installing from source ( is nothing more than the standard “./configure --prefix=/path/to/somewhere; make; make install” song and dance.

As for the environment variables from afs, these two:

export PATH=/afs/$PATH

should do the trick (this is, in fact, what we setup in ATLAS).


Many thanks Wim! :slight_smile:

actually I was just wondering which variables were set when “setting up” Athena.
Now I know… :wink:

Yes, you are right about the installation of Python, but I’m setting up a package which has to be used on various machines on AFS, thus using AFS links avoid me to install Python on all of them.

Just tried your exports and work like a charm.
Thanks a lot again,