Translation(s): English - Français - Italiano - 한국어 - Português


Official Python logo

Introduction

Python, the high-level, interactive object oriented language, includes an extensive class library with lots of goodies for network programming, system administration, sounds and graphics. Debian provides the latest stable Python 3 release; it also provides the latest stable Python 2 release, but Python 2 is unsupported by the Python Foundation since 2020-01-01 and is being removed as of Debian 11 (Bullseye). It may also provide additional versions, as well as tons of third party packages. Python is an important part of the Debian ecosystem.

Python is very easy to learn. You can begin with the DebianWomen/PythonTutorial or the official online tutorial if you want to get started programming in Python. You might also be interested in the Python wiki, the Python FAQ, and the online documentation.

Software written in the Python programming language is executed by the Python interpreter. It is usually compiled into platform-independent bytecode files to increase performance. Python compiles and writes bytecode *.pyc files alongside the *.py sources. Extension modules can also be written in C, which are distributed as .so shared libraries.

Therefore, software written in pure Python can be distributed as source code or as compiled bytecode. The latter is similar to Java.

Python in Debian

Sources available: ssh://git.debian.org//git/git/python-modules/misc/python-debian-artwork.git

As such, with hundreds of Python modules and multiple versions of Python supported, Debian is the largest "integrated Python distribution". Users of other operating systems (e.g. Windows and OS X) can also benefit from this integrative effort by means of virtualization (e.g. see NeuroDebian VM page for easy way to start)

Please also refer to the packaging style guide and Python Packaging wiki pages.

As of 2015-10-09 we now maintain all of our packages in Git. Here is team policy for using git for team packages.

NOTE: Debian 11 (bullseye) has removed the "python" package and the '/usr/bin/python' symlink due to the deprecation of Python 2. No packaged scripts should depend on the existence of '/usr/bin/python': if they do, that is a bug that should be reported to Debian. You can use the 'python-is-python3' or 'python-is-python2' packages to restore an appropriate '/usr/bin/python' symlink for third-party or legacy scripts. See also Python/FAQ#Python_2_support.

Maintainers

Within the Debian project, Python packages are maintained by individual developers and two main teams:

There are also :

Supported Python Versions

Those links list the distribution(s) that ship the given versions of python:

Debian Python Policy for Python developers

The Debian Python Policy describes conventions for packaging and distributing Python code in Debian.

Feel free to ask any questions on debian-python@lists.debian.org mailing list.

If you want to maintain a Python package, you have to know how the Debian Development works.

Deviations from upstream

Debian distributions modify upstream Python in a few ways that are important to understand. Of course, where at all possible, we try to minimize deviations from upstream, but here is an enumeration of the changes you might encounter on a Debian system (and derivatives, such as Ubuntu).

Encouraged practices

Installing from Source

If you want the latest version, or a development version of Python, you will likely need to install it from source. In order to do that, first make sure you have build dependencies. As root, run: "aptitude build-dep python3"

Pick your version and download the "Gzipped source tarball" of the version of your choice from Python download page. Once you have the archive, extract it using "tar -xvf Python-<FULL VERSION NAME>.tgz". Once that is done, go to that directory with "cd Python-<FULL VERSION NAME>" and use the following command to compile Python from source: "./configure && make && make test" (as regular user). To install it globally without damaging system Python installed with APT, use the altinstall target (as root): "make altinstall".

See also


CategorySoftware | CategoryProgramming