'python' Bash command doesn't link to 2.1.1

Joal Heagney s713221 at student.gu.edu.au
Wed Aug 15 06:32:08 CEST 2001


root wrote:
> 
> Hello, I've decided to use Python as my first programming language (as
> per advice at http://www.tuxedo.org/~esr/faqs/hacker-howto.html ) and
> I've run into a problem during installation.  My Linux (Linux PPC 2000)
> came packaged with Python 1.5.2 but I thought I'd upgrade to the latest
> version before I got started.  I unpacked the download and followed all
> the instructions in the README (./configure then make) and everything
> seemed to go fine.
> 
> I cannot, however, run Python 2.1.1 using the 'python' terminal command
> and there is no Python man page installed.  Typing 'python' at the
> command prompt brings up the 1.5.2 interpreter.  I can run the 2.1.1
> interpreter by typing the path of the toplevel Python directory and then
> /python (e.g. /home/root/Python-2.1.1/python) but I don't want to have
> to do this every time I start the interpreter and I would also like to
> have the man page installed.
> 
> Could this be an problem with my Linux distribution, perhaps something
> to do with the directory structure?  I only started with Linux a few
> days ago so I'm probably way off - I'm making the transition from Mac OS
> to Linux.
> 
> Any help would be greatly appreciated.
> 
> Thanks,
> Tom

As the others have pointed out, you are finding python1.5 before you get
to the python2.1 version. I've installed from an srpm onto  a Mandrake
7.2 version with /usr/bin/python2 as a link to my python2.1 binary,
right beside my python 1.5 install. To do this on your present system,
as superuser:

ln -s /usr/local/bin/python /usr/bin/python2

Now you can choose to invoke python for python1.5 or python2 for
python2.1. I don't recommend overwriting your system python with
python2.1 unless you check out all the dependancies for python and
ensure that they will be supported by python2.1. (Things like pygtk and
pygnome will have to be rebuilt against the python2.1 distribution.)

By rights, python should have installed the man page, but probably under
/usr/local/man rather than /usr/man. If you don't want to fiddle around
with configuring your man paths, I'd suggest you rebuild using the
following:

./configure --prefix=/usr --altinstall
make
But it's a while since I've done it from source, so you may want to
carefully read the INSTALL documents to check things out, and type
./configure --help to get a list of options first.
--prefix ensures that python is installed under /usr instead of
/usr/local
--altinstall (or something similarly sounding) doesn't wipe out your old
python1.5 installation from /usr. (Doing ./configure --prefix=/usr;
make; make install by itself will wipe out python1.5. *grins* Guess how
I found that option out?)

Now you can either type python2.1 or as superuser
ln -s /usr/bin/python2.1 /usr/bin/python2
Leave superuser
python2
-- 
      Joal Heagney is: _____           _____
   /\ _     __   __ _    |     | _  ___  |
  /__\|\  ||   ||__ |\  || |___|/_\|___] |
 /    \ \_||__ ||___| \_|! |   |   \   \ !



More information about the Python-list mailing list