< BACKMake Note | BookmarkCONTINUE >
156135250194107072078175030179198180024228156016206217188240240204173116073160160126010177

Installing Python

Platforms with ready-to-install binaries require only the file download and initiation of the installation application. If a binary distribution is not available for your platform, you need to obtain and compile the source code manually. This is not as bad an option as it may seem at first. Manually building your own binaries offers the most flexibility.

You can choose what features to put into your interpreter and which to leave out. The smaller your executable, the faster it will load and run. For example, on Unix systems, you may wish to install the GNU readline module. This allows you to scroll back through Python commands and use Emacs- or vi-like key bindings to scroll through, access, and perhaps edit previous commands. Other popular options include incorporating Tkinter so that you can build GUI applications or the threading library to create multi-threaded applications. All of the options we described can be added by editing the Modules/Setup file found in your source distribution.

In general, these are the steps when building your own Python interpreter:

  • download and extract files, customizing build files (if applicable)

  • run ./configure script

  • make

  • make install

Python is usually installed in a standard location so that you can find it rather easily. On Unix machines, the executable is usually installed in /usr/local/bin while the libraries are in /usr/local/lib/python1.x where the 1.x is the version of Python you are using.

On DOS and Windows, you will usually find Python installed in C:\Python or C:\Program Files\Python. Since DOS does not support long names like "Program Files," it is usually aliased as "Progra~1," so if you are in a DOS window in a Windows system, you will have to use the short name to get to Python. The standard library files are typically installed in C:\Program Files\Python\Lib.


Last updated on 9/14/2001
Core Python Programming, © 2002 Prentice Hall PTR

< BACKMake Note | BookmarkCONTINUE >

© 2002, O'Reilly & Associates, Inc.