Problems getting PyROOT to work

I am trying to get PyROOT to work. So I follow the (somewhat confusing) directions on

root.cern.ch/drupal/content/pyroot

I use this to configure, and it works fine

./configure linuxx8664gcc --enable-python --with-python-incdir=/usr/include/python2.7/ --with-python-libdir=/usr/lib/x86_64-linux-gnu/

and make builds everything without any errors.

These are my python and root related env. variables:

[quote]>echo $PYTHONPATH
~/python:/usr/local/farm/root_v5.34.18/lib

echo $LD_LIBRARY_PATH
/usr/local/farm/CLHEP/2.0.4.7/lib:/usr/local/farm/root_v5.34.18/lib
[/quote]

I suppose the only part missing is the PYTHONDIR env. variable – the instructions were
completely unclear as to what it’s supposed to point at.

In python, when I try to import TCanvas using

I get segfault.

Is this because the PYTHONDIR (whatever it is) is not included in LD_LIBRARY_PATH? And if so, what should that variable point to?

If you use ./configure and “make”, then in the ./bin directory there should be scripts called “thisroot.sh” and “thisroot.csh”. Use the “source” command on the appropriate script for (.sh for bash, .csh for C-shell) and it should set up all those variables for you.

Jean-François

Hi,

there should ordinarily be no reason to set incdir/libdir (and certainly not PYTHONDIR) if the python available from $PATH is the correct one. If you set incdir/libdir, than these need to match the python in PATH.

Other than that, as Jean-François says, normally none of these options needs to be specified on a linux box.

If a segfault persists, at least post a stack trace that we can look into.

Cheers,
Wim