Navigation

Python comes preinstalled on most Linux distributions, and is available as a
package on all others. However there are certain features you might want to use
that are not available on your distro’s package. You can easily compile the
latest version of Python from source.

In the event that Python doesn’t come preinstalled and isn’t in the repositories as
well, you can easily make packages for your own distro. Have a look at the
following links:

If you want to compile CPython yourself, first thing you should do is get the
source. You can download either the
latest release’s source or just grab a fresh clone. (If you want
to contribute patches, you will need a clone.)

The build process consists in the usual

./configure
make
make install

invocations. Configuration options and caveats for specific Unix platforms are
extensively documented in the README file in the root of the Python
source tree.

Warning

makeinstall can overwrite or masquerade the python binary.
makealtinstall is therefore recommended instead of makeinstall
since it only installs exec_prefix/bin/pythonversion.

These are subject to difference depending on local installation conventions;
prefix (${prefix}) and exec_prefix (${exec_prefix})
are installation-dependent and should be interpreted as for GNU software; they
may be the same.

For example, on most Linux systems, the default for both is /usr.

File/directory

Meaning

exec_prefix/bin/python

Recommended location of the interpreter.

prefix/lib/pythonversion,
exec_prefix/lib/pythonversion

Recommended locations of the directories
containing the standard modules.

prefix/include/pythonversion,
exec_prefix/include/pythonversion

Recommended locations of the directories
containing the include files needed for
developing Python extensions and
embedding the interpreter.

~/.pythonrc.py

User-specific initialization file loaded
by the user module; not used by default
or by most applications.