Dual Python Installed Environments..

Yu-Xi Lim yuxi at ece.gatech.edu
Fri Oct 26 02:43:27 CEST 2007

sam wrote:
> Hey Diez...
> So you're saying it's as simple as creating an env var, and setting it to
> the python version...
> ok.. (and yeah, we're talking fedora)

No, env doesn't create an environment variable. It creates a modified 
environment. The goal here is to have the proper PATH variable set up. 
env is the preferred method of invoking the Python (and other) 
interpreter since it may not always be at /usr/bin/python.

In distributions like Fedora, /usr/bin/python is usually a symlink to 
one of python2.5, python2.4, or python2.3 (or whatever have you), each 
one corresponding to the appropriate Python version. So you're just 
running the Python interpreter with the version number you desire 
directly. Without the version number, you will be using the system default.

Thus the actual contents of the script running under Python 2.4 is:

#!/usr/bin/env python2.4

print "Hello, World!"

More information about the Python-list mailing list