'python' Bash command doesn't link to 2.1.1

Harry George hgg9140 at seanet.com
Wed Aug 15 17:54:42 EDT 2001


Richard Jones <richard at bizarsoftware.com.au> writes:

> On Tuesday 14 August 2001 10:23, 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.
> 
> Marvellous idea :)
> 
> 
> > 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.
> 
> By default, python will be installed to /usr/local/bin. Your system will have 
> python 1.5.2 installed in /usr/bin. That binary will be found first when you 
> type "python" at the command line. To force using python 2.1.1, run 
> "/usr/local/bin/python".
> 
> Or, do the following (as root):
> 
>  cp /usr/bin/python /usr/bin/python1.5
>  cd /home/root/Python-2.1.1/
>  make distclean
>  ./configure --prefix=/usr
>  make install
> 

An alternative, allowing you to run several different verisons of
python:

as root edit a file "/usr/local/bin/py21":
#---edit------------
export PYTHONHOME=/usr/local
export PYTHONPATH=${PYTHONHOME}/lib/python2.1:${PYTHONHOME}/lib/python2.1/site-apckages
${PYTHONHOME}/bin/python2.1 $@
#---end edit-----------
and do
   chmod +755 py21

Then you can run python 2.1 stuff with "py21" and python 1.5.2 with
"python".  This may be important if some system scripts depend on one
version or the other.


> the --prefix=/usr tells the install to place python in /usr/bin (and the 
> library files will go in /usr/lib/python2.1). Note, you'll want to remove the 
> "other" python2.1 installation too (/usr/local/bin/python and 
> /usr/local/lib/python2.1). The first command above just keeps the old python 
> around just in case you need it in the future.
> 
> Then you will be able to run "python" at the command prompt and get 2.1.1 :)
> 
> 
>    Richard
> 

-- 
Harry George
hgg9140 at seanet.com



More information about the Python-list mailing list