PyROOT using root-system.deb

I was having some prooblems installing from source on Ubuntu Feisty, so I used the .deb install from BNL. I also installed root-plugin-python. Python could not load ROOT.py fresh from the install. I triedexport ROOTSYS=/usr/include/root export PATH=$PATH:$ROOTSYS/bin:$PYTHONDIR/lib export LD_LIBRARY_PATH=$ROOTSYS/lib:$PYTHONDIR/lib:$LD_LIBRARY_PATH export PYTHONPATH=$ROOTSYS/lib:PYTHONPATH
But python still said ROOT did not exist. I found ROOT.py in /lib and tried to run python from there. I recievd the following error:[code]>>> import ROOT
Traceback (most recent call last):
File “”, line 1, in
File “ROOT.py”, line 83, in
import libPyROOT as _root
ImportError: ./libPyROOT.so: undefined symbol: ZNK7TObject6SaveAsEPKcS1

[/code]

Hi,

I’m not familiar with the .deb install, but it seems like libPyROOT.so isn’t linked with libCore.so. Can you verify with ldd libPyROOT.so?

Cheers,
Wim

Thank you for the help here is the output.
Should one of my system varibale be pointing here(/usr/lib/root/5.15/)?

ldd /usr/lib/root/5.15/libPyROOT.so
        linux-gate.so.1 =>  (0xffffe000)
        libCore.so.5.15 => /usr/lib/root/libCore.so.5.15 (0xb77a7000)
        libCint.so.5.15 => /usr/lib/root/libCint.so.5.15 (0xb720d000)
        libRIO.so.5.15 => /usr/lib/root/libRIO.so.5.15 (0xb70d8000)
        libNet.so.5.15 => /usr/lib/root/libNet.so.5.15 (0xb6fe0000)
        libHist.so.5.15 => /usr/lib/root/libHist.so.5.15 (0xb6d3e000)
        libGraf.so.5.15 => /usr/lib/root/libGraf.so.5.15 (0xb6b08000)
        libGraf3d.so.5.15 => /usr/lib/root/libGraf3d.so.5.15 (0xb69f7000)
        libGpad.so.5.15 => /usr/lib/root/libGpad.so.5.15 (0xb691e000)
        libTree.so.5.15 => /usr/lib/root/libTree.so.5.15 (0xb6751000)
        libMatrix.so.5.15 => /usr/lib/root/libMatrix.so.5.15 (0xb650c000)
        libReflex.so.5.15 => /usr/lib/root/libReflex.so.5.15 (0xb6463000)
        libdl.so.2 => /lib/tls/i686/cmov/libdl.so.2 (0xb645f000)
        libpython2.5.so.1.0 => /usr/lib/libpython2.5.so.1.0 (0xb6327000)
        libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0xb623d000)
        libm.so.6 => /lib/tls/i686/cmov/libm.so.6 (0xb6215000)
        libgcc_s.so.1 => /lib/libgcc_s.so.1 (0xb6209000)
        libpthread.so.0 => /lib/tls/i686/cmov/libpthread.so.0 (0xb61f2000)
        libc.so.6 => /lib/tls/i686/cmov/libc.so.6 (0xb60b1000)
        libz.so.1 => /usr/lib/libz.so.1 (0xb609d000)
        libpcre.so.3 => /usr/lib/libpcre.so.3 (0xb607d000)
        libcrypt.so.1 => /lib/tls/i686/cmov/libcrypt.so.1 (0xb604e000)
        libfreetype.so.6 => /usr/lib/libfreetype.so.6 (0xb5fe3000)
        /lib/ld-linux.so.2 (0x80000000)
        libutil.so.1 => /lib/tls/i686/cmov/libutil.so.1 (0xb5fdf000)

Hi,

the output of ldd shows that you have some older installed version of ROOT on your system. Since it is installed in a system directory (/usr/lib), it takes precedence.

Note that in your earlier environment settings, you have $PATH before $ROOTSYS/bin in the new PATH, so you’ll likely get the old root.exe, but that shouldn’t matter for python.

Now, I’m not quite sure what ROOTSYS should be in the setup that you have here (typically, one finds include, lib, bin, and etc under $ROOTSYS, which doesn’t appear to be the case in your system), but this is roughly what it should look like:export LD_LIBRARY_PATH=/usr/lib/root/5.15:$LD_LIBRARY_PATH export PYTHONPATH=/usr/lib/root/5.15:$PYTHONPATHassuming that ROOT.py is installed with the other libs. No further changes to variables have to be made for python itself as you seem to have the system one (that is at least what it looked like in another thread). You may need to modify PATH to point to current (5.15) root.exe.

Cheers,
Wim

No, ROOT.py is in /lib/.

Thank you so much. I had tried those system variable earlier with no luck–the proper ROOT version ran, but import ROOT failed in python. However when you said [quote]assuming that ROOT.py is installed with the other libs[/quote]
I realised that that was the problem ROOT.py was installed in /lib/ not in /usr/lib/root/5.15/ like everything else. So I just copied ROOT.py from /lib/ into /usr/lib/root/5.15/

sudo cp /lib/ROOT.py /usr/lib/root/5.15/

with your proposed enviromental settings. It loads just fine now; I will test it out today.

I just recieved a reply from Christian Holm Christensen:

[quote]On Tue, 2007-07-03 at 15:49 +0200, David Layton wrote:

What needs to be done to use PyROOT if you install from *.deb?

   sudo apt-get install root-system-doc python2.4-pyroot
   cp /usr/share/doc/root/tutorials/python/hsimple.py .
   python hsimple.py

That’s it. No need for environment variable, and ladida.[/quote]

The packages are broken for my system, but it appears that python2.4-pyroot is the correct package. Hope this helps others who make the same mistake.

[quote]
The packages are broken for my system, but it appears that python2.4-pyroot is the correct package. Hope this helps others who make the same mistake.[/quote]

The problem is, that Ubuntu’s dh_python script outputs the wrong dependencies when building the packages. It is well known, and we’re awaiting an upstream fix for this.

For know, you can try to force the installation of libroot-python-dev.

Note, that the packages work perfectly on Debian GNU/Linux sid (unstable).

Some comments on the thread so far

To Wim: The lastest packages available for Debian and Ubuntu is 5.15/07, so the output of Davids ldd is entirely correct. That is, those are not old libraries.

To Wim and David: Note, that when you install the Debian/Ubuntu/RPM packages, you should not set ROOTSYS, or include any special directories in LD_LIBRARY_PATH, and PATH. When installing packages, the files are put into the system directories (respecting the FHS):
[ul]
/etc/root Configuration files
/usr/bin Programs, etc.
/usr/include/root Headers
/usr/lib/root libraries
/usr/lib/root/<version> Plug-ins
[i]/usr/share/root[/code] Data files
/usr/share/doc/root Documentation
/usr/share Data files for other programs (Emacs, Python, Autoconf, etc.)
[/ul]

To David: The ROOT.py is in /usr/lib/root/5.15, and there’s a symbolic link to this from /usr/share/python-support/root/. If you have ROOT.py in /lib you either copied it there yourself, it is left over from an old install, or some other thing.

Yours,

Christian

I know my ROOT.py is fom an old install. I am just glad it works. I tried to force the package installation:[code]
sudo apt-get -f -m --force-yes install libroot-python-dev
Reading package lists… Done
Building dependency tree
Reading state information… Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.

Since you only requested a single operation it is extremely likely that
the package is simply not installable and a bug report against
that package should be filed.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
libroot-python-dev: Depends: python (< 2.5) but 2.5.1-0ubuntu3 is to be installed
E: Broken packages
[/code]