Python version problem

Hi,

I am trying to run a python script that imports ROOT and NumPy modules…
Goggling around I’ve found the following environment…

     62         os.environ['ROOTSYS']  = "/afs/cern.ch/sw/lcg/external/root/5.18.00a/slc4_ia32_gcc34/root/"
     63         os.environ['PYTHONDIR']= "/afs/cern.ch/sw/lcg/external/Python/2.5/slc4_ia32_gcc34"
     64         os.environ['PYTHONPATH']="/afs/cern.ch/atlas/software/builds/AtlasConditions/13.0.10/InstallArea/python:/afs/cern.ch/atlas/software/releases/14.0.0/external/NumPy/1.0.4/i686-slc4-gcc34-opt/lib/python2.5/site-packages:%s/lib"%(os.environ["ROOTSYS"])
     66         os.environ['LD_LIBRARY_PATH'] = "%s/lib:%s/lib"%(os.environ['ROOTSYS'], os.environ['PYTHONDIR'])
     67         os.environ['PATH'] = "%s/bin:%s/bin"%( os.environ['ROOTSYS'], os.environ['PYTHONDIR'])

It works fine, however one annoying warning is threw:

[quote]/afs/cern.ch/sw/lcg/external/root/5.18.00a/slc4_ia32_gcc34/root/lib/ROOT.py:88: RuntimeWarning: Python C API version mismatch for module libPyROOT: This Python has API version 1012, module libPyROOT has version 1013.
[/quote]

I got the same messages for the NumPy modules…

I am using AFS Python version: 2.3.4

How can I solve this problem? Is it possible run python 2.5 under afs, slc4???

Cheers

I don’t understand…
if $PYTHONDIR is set to "/afs/cern.ch/sw/lcg/external/Python/2.5/slc4_ia32_gcc34"
and you have $PYTHONDIR in your $PATH and $LD_LIBRARY_PATH, Python2.5 should be used…
could you check if these variables are set and post the output of “which python”, please?

Cheers,
Bertrand.

You are totally right. Thank you for the fast reply…

I was calling this script through os.execve method and for that I was using /usr/bin/python instead of just python… My mistake

Cheers