Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have python 2.7 installed

[user@localhost google_appengine]$ python  
Python 2.7 (r27:82500, Sep 16 2010, 18:03:06)   
[GCC 4.5.1 20100907 (Red Hat 4.5.1-3)] on linux2  
Type "help", "copyright", "credits" or "license" for more information.

I want to use the python 2.5.2 that is in this directory

[user@localhost Downloads]$ ls |grep "Python-2*"  

to run a python script in Khan Academy platform against a google app engine application

sudo python -a ~/workspace/GAE/google_appengine/ upload

Currently, when running the last script 2.7 python complains a lot (Google App Engine runs on 2.5.2 mostly and 2.6 almost)

I would like to do something like

sudo python env set ~/Downloads/Python-2.5.2 -a ~/workspace/GAE/google_appengine/ upload  

Is this possible? If yes, please point the way. If not, please suggest a way to call python2.5.2 WITHOUT having to uninstall python 2.7

many many thanks

share|improve this question

If you have the Python 2.5.2 installed or the binaries, just use the full path to the binary:

sudo ~/Downloads/python

instead of sudo python

Without providing the full path, you are running the binary that bash finds on the $PATH environment variable.

Also check this documentation, specially the part about $PYTHONHOME and $PYTHONPATH

share|improve this answer
I don't know Python, but you may have to have PYTHON_HOME or something similar set before execution, and maybe even a PATH change. All pretty simple, especially if you do this in a short script, but you may need to track down multiple references. – mpez0 Mar 7 '11 at 14:29
Thanks @mpez I edited my answer including the environment vars. – coredump Mar 7 '11 at 15:24

Your Answer


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.