Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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.

share|improve this question

2 Answers 2

up vote 0 down vote accepted

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 :)

share|improve this answer

Use the absolute path:

/usr/local/bin/python2.5 /path/to/your/script
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.