Python version problem


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/"
     63         os.environ['PYTHONDIR']= "/afs/"
     64         os.environ['PYTHONPATH']="/afs/"%(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/ RuntimeWarning: Python C API version mismatch for module libPyROOT: This Python has API version 1012, module libPyROOT has version 1013.

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???


I don’t understand…
if $PYTHONDIR is set to "/afs/"
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?


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