Pyroot on lxplus

Hi,

after setting the following environment variables

export ROOTSYS=/afs/cern.ch/sw/lcg/app/releases/ROOT/5.20.00/slc4_amd64_gcc34/root export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$ROOTSYS/lib export PATH=$PATH:$ROOTSYS/bin export PYTHONPATH=$PYTHONPATH:$ROOTSYS/lib

I tried to load pyroot. But I got the following error:

>>> from ROOT import * Traceback (most recent call last): File "<stdin>", line 1, in ? File "/afs/cern.ch/sw/lcg/app/releases/ROOT/5.20.00/slc4_amd64_gcc34/root/lib/ROOT.py", line 85, in ? import libPyROOT as _root ImportError: libpython2.5.so.1.0: cannot open shared object file: No such file or directory

Did I make an error, or is there something wrong with the root installation on lxplus?

Cheers

Felix

Hi,

ok. I can answer this myself. Root on afs is compiled versus the LCG-python. So I had to set

#LCG python machine_path=slc4_amd64_gcc34 export PATH=/afs/cern.ch/sw/lcg/external/Python/2.5/$machine_path/bin:$PATH export LD_LIBRARY_PATH=/afs/cern.ch/sw/lcg/external/Python/2.5/$machine_path/lib:$LD_LIBRARY_PATH

Cheers

Felix[/code]

I’d like to use pyroot on lxplus5 cern machines.

Looks like the default python doesn’t know about ROOT:

[code]lxplus301 > which python
/afs/cern.ch/project/gd/LCG-share/3.1.25-0/external/usr/bin/python
lxplus301 > python
Python 2.3.4 (#1, Jul 30 2008, 01:34:10)
[GCC 3.4.6 20060404 (Red Hat 3.4.6-9)] on linux2
Type “help”, “copyright”, “credits” or “license” for more information.

import ROOT
Traceback (most recent call last):
File “”, line 1, in ?
ImportError: No module named ROOT[/code]
What should I do?

Hi,

You need to add $ROOTSYS/lib to the PYTHONPATH

Cheers,
Philippe.

We’re getting closer, but I’m still getting an error when trying to import ROOT:

[code]lxplus258 > which python
/afs/cern.ch/project/gd/LCG-share/3.1.25-0/external/usr/bin/python

lxplus258 > python
impPython 2.3.4 (#1, Jul 30 2008, 01:34:10)
[GCC 3.4.6 20060404 (Red Hat 3.4.6-9)] on linux2
Type “help”, “copyright”, “credits” or “license” for more information.

import ROOT
Traceback (most recent call last):
File “”, line 1, in ?
File “/afs/cern.ch/sw/lcg/app/releases/ROOT/5.26.00/x86_64-slc5-gcc34-opt/root/lib/ROOT.py”, line 86, in ?
import libPyROOT as _root
ImportError: /afs/cern.ch/sw/lcg/app/releases/ROOT/5.26.00/x86_64-slc5-gcc34-opt/root/lib/libPyROOT.so: wrong ELF class: ELFCLASS64[/code]

Here is what is in my ~/.bash_profile

source /afs/cern.ch/sw/lcg/contrib/gcc/4.3/x86_64-slc5-gcc43-opt/setup.sh export ROOTSYS=/afs/cern.ch/sw/lcg/app/releases/ROOT/5.26.00/x86_64-slc5-gcc34-opt/root export PATH=$PATH:$ROOTSYS/bin export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$ROOTSYS/lib export PYTHONPATH=$PYTHONPATH:$ROOTSYS/lib

Maybe it’s a problem with 64 bit stuff. Can I use a 32 bit ROOT on an lxplus5 machine, and if so, which one?

Hi,

Simply use the system python (/usr/bin/python) which is compiled in 64 bit mode.

Cheers,
Philippe.

The system python gives this error then:

[code]lxplus301 > /usr/bin/python
Python 2.4.3 (#1, Sep 4 2009, 16:48:22)
[GCC 4.1.2 20080704 (Red Hat 4.1.2-44)] on linux2
Type “help”, “copyright”, “credits” or “license” for more information.

import ROOT
Traceback (most recent call last):
File “”, line 1, in ?
File “/afs/cern.ch/sw/lcg/app/releases/ROOT/5.26.00/x86_64-slc5-gcc43-opt/root/lib/ROOT.py”, line 86, in ?
import libPyROOT as _root
ImportError: libpython2.5.so: cannot open shared object file: No such file or directory[/code]

Hi,

the afs installations of ROOT utilize p2.5 b/c that’s what the experiments want. If libpyroot2.5.so is missing, then LD_LIBRARY_PATH is missing a directory pointing to it.

You’ll find the various p2.5’s on afs here:

/afs/cern.ch/sw/lcg/external/Python/2.5.4p2/

Select your platform from under there and add the ‘bin’ directory to PATH and the ‘lib’ directory to LD_LIBRARY_PATH.

Cheers,
Wim

Thanks, this is what I now have in my ~/.bash_profile
to load up ROOT 5.26.00 and Python 2.5.4p2,
and it seems to work for me on lxplus5 machines:

source /afs/cern.ch/sw/lcg/contrib/gcc/4.3/x86_64-slc5-gcc43-opt/setup.sh export ROOTSYS=/afs/cern.ch/sw/lcg/app/releases/ROOT/5.26.00/x86_64-slc5-gcc43-opt/root export PATH=/afs/cern.ch/sw/lcg/external/Python/2.5.4p2/x86_64-slc5-gcc43-opt/bin:$ROOTSYS/bin:$PATH export LD_LIBRARY_PATH=$ROOTSYS/lib:/afs/cern.ch/sw/lcg/external/Python/2.5.4p2/x86_64-slc5-gcc43-opt/lib:$LD_LIBRARY_PATH export PYTHONPATH=$PYTHONPATH:$ROOTSYS/lib