Compiling pyRoot with Python 2.7.2 and using python 2.5.1

Hi,

I work on Fermi and currently we use ROOT v5.26.00a (yes we need to upgrade :slight_smile: )
It has come to my attention that some of our users are taking our binary distribution of ROOT built against python 2.7.2 and actually using python 2.5.1 and importing our distribution of PyROOT. Does that cause any problems? They seem to be working just fine in that mode, though my inclination would be to use the same version of python we used to build ROOT. Actually I wonder about the converse as well… running ROOT and interacting with python… I suppose it’s fine as long as we’re not utilizing any features only available in the later version of Python?

Thanks,
Heather

Heather,

b/c of the release of python v3, which is backwards incompatible with the v2 chain, python v2 has been progressively more conservative in adding new features since p2.4. In fact, as of p2.6, the majority of new features are compatibility features to help the move to p3.x. That’s why changing binaries tends to work (barring a warning about the version on some platforms) assuming that the platform’s linking mechanism supports it (Windows is out in that sense, as are older Macs), and the shared library linked against does not have the version number in its name.

In addition, some python builds are only a stub executable that immediately picks up libpython.so where all the actual functionality resides, including the main interpreter, seemingly allowing you to run the old executable, which then in actuality is the newer python living in the .so.

So personally, I’d advice against mixing version on principle, but my experience is that it either works fine (typically on most Linux boxes, with 1 minor python version apart) or it fails miserably right off the bat (so no harm done).

Cheers,
Wim

At FNAL, it is quite easy to get them to install another version of Python and Root. So users would be able to ‘setup root thisVersion; setup python thatVersion’ . This is how I was able to use PyRoot at CDF (where the default version of root is, wait for it, 4.00.08g). Even if they keep the “old” root version, having them setup the new python version shouldn’t be too hard and 2.7 is nicer than 2.5.

Cheers,
Charles

Of course, if you are on an experiment called Fermi and not at a lab called Fermi, the above information might not be as useful as I had originally intended… :smiley: