[Tutor] OT- how to build Python 2.0 from source?

Daniel Yoo dyoo@hkn.eecs.berkeley.edu
Tue, 31 Oct 2000 21:56:39 -0800 (PST)

On Wed, 1 Nov 2000, Craig Hagerman wrote:

> A bit off target... Can anyone tell me exactly how to go about installing
> Python 2.0 FROM THE SOURCE file on a Linux machine? I did try to install
> using the RedHat RPMs (eg: rpm -ivh BeOpen-Python-2.0-1.i386.rpm) but this
> caused an error about failed dependencies (libreadline.so.3 is needed ??) so
> perhaps a source install would be better... if only I knew how to do that.

If you're new to compiling source code, it might be better to do an RPM
installation.  Python 2.0 is dependent on the readline library for making
the interpreter nice (command history and all), so that's why that
dependency exists.  Since the rpm is complaining about an uninstalled
libreadline, you'll probably need to first install the readline library.  
Here's a link to readline:


(Sorry about the long link... if you have your install CD, you should be
able to find the readline RPM in the Mandrake/RPMS directory.)

After that, your Python-2.0 rpm should install ok.


> I have looked and looked all over the Python.org site and there doesn't seem
> to be any instructions for actually installing Linux on platforms other than
> Windows. I have not been using Linux for too long and don't know how to do
> this. (I am using Mandrake 7.1 by the way.)

Installing Python via the source distribution follows the conventions of a
lot of other Unix software.  When you unzip the .tar.gz, you'll see that
it creates a Python-2.0 directory.  Within there, there are a lot of
files, but the one that you'll be looking at is called "configure".

You'll definitely want to look at the README at least once, but the
compilation itself isn't too hard.  First, you need to prepare the source
for your linux machine with the command "./configure".  It'll do some
processing, to figure out platform dependent stuff.

Next, we want to actually compile the source code and install it!  You can
do this by running "make install" as root.  It should start compiling and
install itself on your machine after it's done.

After that, just try "python" and see if things work.

Good luck!