1

I am working on centOS 5 Server with python's version 2.4.3

Now i installed python 2.5 (got command from SF) from link as

wget http://www.python.org/ftp/python/2.5.2/Python-2.5.2.tgz
tar fxz Python-2.5.2.tgz
cd Python-2.5.2
./configure
make
make altinstall

then i executed command python -V it says

Python 2.4.3

then i tried command to change it from this to 2.5 as i have syntax error in my file because of the lower version of python.

 python_select python-2.5.2

but it says

-bash: python_select: command not found

can any one please help me how to change it so that i can execute my .py file.

Any help will be highly appreciated.

Astha
  • 243
  • 2
  • 6
  • 15

2 Answers2

2

Use the absolute path:

/usr/local/bin/python2.5 /path/to/your/script
quanta
  • 50,327
  • 19
  • 152
  • 213
0

i wrote

#!/usr/bin/env python2.5
from __future__ import with_statement

on my python file then it took this path for execution because there was previous path set already. Thanks for the help :)

Astha
  • 243
  • 2
  • 6
  • 15