calling a different python interpreter from bash command line

Posted by Dennis Daniels on Server Fault See other posts from Server Fault or by Dennis Daniels
Published on 2011-03-07T14:04:36Z Indexed on 2011/03/07 16:12 UTC
Read the original article Hit count: 483

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*"  
Python-2.5.2
Python-2.5.2.tgz

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

sudo python sample_data.py -a ~/workspace/GAE/google_appengine/appcfg.py 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 sample_data.py -a ~/workspace/GAE/google_appengine/appcfg.py 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
Dennis

© Server Fault or respective owner

Related posts about linux

Related posts about bash