RELEASED Python 2.4 (final)

Harry George harry.g.george at boeing.com
Tue Nov 30 09:15:31 EST 2004


"Dave Merrill" <dmerrillq at usaq.netq> writes:

> Newb question: Is it possible/recommended  to have multiple versions of
> Python installed simultaneously? Earlier, I installed 2.4rc1, and a number
> of things in my 2.3.3 install stopped working. Are there known techniques
> for managing multiple versions?
> 
> Thanks,
> 
> Dave Merrill
> 
> 

I can only speak for *NIX systems; don't know about MS Win** systems.
The quick answer is "Yes, it can be done".

1. Build and install as 
      make altinstall

This installs, e.g.:
      /usr/local/
          bin/
            python2.3
          lib/
            python2.3
          

It does NOT also make an entry at /usr/local/bin/python.  Thus any
scripts which call for "python" or "/usr/bin/env python" get the
default version.

2. Make a wrapper script, e.g. /usr/local/bin/py23:
      unset PYTHONHOME PYTHONPATH
      /usr/local/bin/python2.3 "$@"

3. Use "py23" to build site-packages.  Since you need to do this
repeatedly, it is best to save the build scripts on a python-version
basis.  E.g., a "go23" script.  Inside the scripts, use "py23" as
appropriate wherever you would have used "python".  e.g.:

      ....
      export PKGVER=Numeric-23.0
      ln -s ../${PKGVER}.tar.gz .
      gzip -cd  ${PKGVER}.tar.gz | gtar xvf -
      cd  ${PKGVER}

      py23 setup.py build
      py23 setup.py install
      cd ..
      ....

4. When another python version shows up, copy the go23 to go24, edit
it for py23-->py24, and start building.  Use either version at the
commmand line or in other scripts via py23 or py24.  NOTE: In cgi's,
give the full path, e.g.:

      #!/usr/local/bin/python2.3


-- 
Harry George
harry.g.george at boeing.com 6-6M21 BCA CompArch Design Engineering
Phone: (425) 294-4718



More information about the Python-list mailing list