(Dead) Snakes on a… Debian System

jhermann

Jürgen Hermann

Posted on March 10, 2020

(Dead) Snakes on a… Debian System

Build Python 3.6 / 3.7 / 3.8 Debian packages for both Stretch and Buster

The Deadsnakes PPA project originally built older Python versions for Ubuntu, so you could e.g. run unit tests on a new Ubuntu release using a Python version found on older releases (i.e. the ‘dead’ snakes).

Nowadays, the project also builds newer Python versions ahead of what a certain release offers as its default.

The packages contain the minor Python version in their name (e.g. python3.6) and can thus be installed concurrently to the default python3 ones. Originally based on the Debian source packages, they can also be used on Debian and not just on Ubuntu.

The build script and Dockerfile found here build packages for some Debian releases in their related Docker base images.

Based on this, Python 3.6 can be installed for all of Stretch, Buster, and Xenial, as a set of the usual core Python packages (python3.6, python3.6-venv, python3.6-dev, …). Note that Bionic comes with 3.6 as a default.

The same goes for Python 3.7, with Buster having it as a default.

Python 3.8 is an add-on for all the (old-)stable releases (as of March 2020). Using this version makes the most sense to me, unless you have special needs forcing you to go to 3.7 or 3.6. Being an add-on everywhere ensures a similar experience regarding any quirks you encounter, and it is (right now) the newest stable version of Python. It also fits best what you get when using Docker's python:3-slim-buster right now.

This post originally appeared on my personal blog.

💖 💪 🙅 🚩
jhermann
Jürgen Hermann

Posted on March 10, 2020

Join Our Newsletter. No Spam, Only the good stuff.

Sign up to receive the latest update from our blog.

Related