Path problem

I want to use pyROOT, but the installed ROOT modules are not in the right place. I’ve done this:

./configure --enable-soversion --enable-rpath --prefix=/usr/local --enable-python --with-python-incdir=/usr/include/python2.5 --with-python-libdir=/usr/lib64 --disable-xrootd

/usr/include/python2.5 is the directory where there is Python.h
/usr/lib64 is the directory where there is libpython2.5.so

[size=75]note that I have libpython2.5.so and not libpython.2.5.so as you say in your guide (libpython.x.y.[so][.dll], where ‘x’ and ‘y’ are the major and minor version number of Python, respectively root.cern.ch/root/HowtoPyROOT.html)
[/size]

The problem is that ROOT.py is not in /usr/include or in /usr/lib64 (or subfolders) but it is in /usr/local/lib/root and python can’t find it.

from ROOT import *
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: No module named ROOT

I prefer to not use PYTHONPATH variable.

>>> import sys
>>> sys.path
['', '/usr/lib/python25.zip', '/usr/lib64/python2.5', '/usr/lib64/python2.5/plat-linux2', '/usr/lib64/python2.5/lib-tk', '/usr/lib64/python2.5/lib-dynload', '/usr/lib64/python2.5/site-packages', '/usr/lib64/python2.5/site-packages/Numeric', '/usr/lib64/python2.5/site-packages/PIL', '/usr/lib64/python2.5/site-packages/gtk-2.0']

Hi,

as said in the other thread: without setting PYTHONPATH there is no way around this, other than symlinking or copying ROOT.py and libPyROOT.so into the system directories (presumably /usr/lib64/python2.5/site-packages/) where you would like them.

Cheers,
Wim

ok, I’ve understood, but why this task is not done by the ROOT installer?

Because no-one ever asked for it. :slight_smile: In particular, within the normal experiment setup, one does not want to touch the python directory as it prevents easy binary distribution, and as a developer one does not want it because it prevents multiple ROOT releases on one machine.

It just seems so much easier to keep all of ROOT together under $ROOTSYS and simply point an environment variable to it.

Cheers,
Wim