duelling pythons

Gerhard Häring gerhard at bigfoot.de
Mon Apr 1 00:42:13 EST 2002


Gil wrote in comp.lang.python:
> I think my original install of Python1.5 with RedHat 7.1 is not
> playing nice with a later install of Python2.2. How do I troubleshoot
> this?

What does "python -V" say? 1.5.2 or 2.2?

What does "which python1.5" say? /usr/bin ?
What does "which python2.2" say? also /usr/bin?

If both python1.5 and python2.2 are in /usr/bin and "python -V" says
2.2, you could just "rm /usr/bin/python" and
"ln -s /usr/bin/python1.5 /usr/bin/python" to make 1.5.2 your default
Python. If you want to use Python 2.2 for your scripts later on, just
put:

#!/usr/bin/env python2.2

at the top instead.

Note that there are two flavours of the Python 2.2 RPMs - you'll want
the python2-... one in the future. It installs a "python2" instead of
a "python" symlink in /usr/bin in order to not confuse Redhat's really
clever software.

If the Redhat people cared for Python programmers, they'd simply not
use /usr/bin/python in their scripts but hard-code the required
version.

Gerhard
-- 
mail:   gerhard <at> bigfoot <dot> de       registered Linux user #64239
web:    http://www.cs.fhm.edu/~ifw00065/    OpenPGP public key id 86AB43C0
public key fingerprint: DEC1 1D02 5743 1159 CD20  A4B6 7B22 6575 86AB 43C0
reduce(lambda x,y:x+y,map(lambda x:chr(ord(x)^42),tuple('zS^BED\nX_FOY\x0b')))



More information about the Python-list mailing list