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

[size=75]note that I have and not 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

The problem is that 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/', '/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']


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


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.