Python-2.2.2 install

Erik Max Francis max at alcyone.com
Mon Oct 21 21:31:15 EDT 2002


Tom wrote:

> I've downloaded and compiled the python-2.2.2 source on linux. I have
> a
> couple of questions:
> 
> I also have python1.5 installed, and I'd like a sure-fire way to keep
> the lib directories completely autonomous.

You don't have to do anything to assure this.  python2.2 and python1.5
will use completely different library paths and won't interfere with
each other, even in the event that you installed Python 1.5.x manually
too.

The only point of colllision might be the `python' executable itself. 
There won't be a collision if, for instance, Python 1.5.x were installed
by the distribution (so it's under /usr) and you installed Python 2.2.2
manually (so it's in /usr/local); in those cases the two python
executables will be in different places (e.g., /usr/bin/python and
/usr/local/bin/python).

In any case, Python will also install version-specific names, so even if
they were manually installed, you can get Python 1.5.x by running
python1.5 and Python 2.2.x by running python2.2.  By default, the python
executable is a hard link to what it just installed; you can use the
`make altinstall' target if you want it not to touch the python
executable itself.  In any event, of course, you can just set
/usr/local/bin/python to point to (via either a hard or symbolic link)
whichever one you prefer.

> I started out by renaming
> ? the
> python binary to _python, and creating two-line bash script that
> exports
> the appropriate values for the PYTHONPATH variable, but I'm wondering
> if
> there's a better way.

You don't have to do this.  Either Python installation knows where its
base library directory is, so you don't need do munge with PYTHONPATH to
tell Python where _its_ stuff is, you only need to play with it to tell
it where _your_ stuff is.

-- 
 Erik Max Francis / max at alcyone.com / http://www.alcyone.com/max/
 __ San Jose, CA, USA / 37 20 N 121 53 W / &tSftDotIotE
/  \ All delays are dangerous in war.
\__/ John Dryden
    Python chess module / http://www.alcyone.com/pyos/chess/
 A chess game adjudicator in Python.



More information about the Python-list mailing list