5.30. Python-3.7.4

The Python 3 package contains the Python development environment. It is useful for object-oriented programming, writing scripts, prototyping large programs or developing entire applications.

Approximate build time: 1.4 SBU
Required disk space: 381 MB

5.30.1. Installation of Python

[Note]

Note

There are two package files whose name starts with python. The one to extract from is Python-3.7.4.tar.xz (notice the uppercase first letter).

This package first builds the Python interpreter, then some standard Python modules. The main script for building modules is written in Python, and uses hard-coded paths to the host /usr/include and /usr/lib directories. To prevent them from being used, issue:

sed -i '/def add_multiarch_paths/a \        return' setup.py

Prepare Python for compilation:

./configure --prefix=/tools --without-ensurepip

The meaning of the configure option:

--without-ensurepip

This switch disables the Python package installer, which is not needed at this stage.

Compile the package:

make

Compilation is now complete. The test suite requires TK and and X Windows and cannot be run at this time.

Install the package:

make install

Details on this package are located in Section 6.51.2, “Contents of Python 3.”