How to Install Python 3.9 on Debian 11

How to Install Python 3.9 on Debian 11

Python is a free, open-source programming language that was originally published in 1991 and has since gained widespread adoption. It’s used for general-purpose programming which makes it perfect to create apps on your phone or computer.

In this article, we’ll cover all you need to know and do to successfully install Python 3.9 on Debian 11.


In order to install python 3.9 on your Debian 11 the server must meet the following prerequisites:

  • Acess to root or sudo user
  • A fresh Debian 11 server installed and updated to the latest packages.

Updating your system and installing dependencies.

The first step is to update your system if it’s not updated yet, so run these commands:

Need a fast and easy fix?
✔ Unlimited Managed Support
✔ Supports Your Software
✔ 2 CPU Cores
✔ 2 GB RAM
✔ 50 GB PCIe4 NVMe Disk
✔ 1854 GeekBench Score
✔ Unmetered Data Transfer

Now just $43 .99

sudo apt update -y
sudo apt upgrade -y
sudo apt dist-upgrade -y

Once the update is done, you can proceed with the dependencies installation. So you can run this command to install all the required dependencies:

sudo apt install wget build-essential libreadline-dev libncursesw5-dev libssl-dev libsqlite3-dev tk-dev libgdbm-dev libc6-dev libbz2-dev libffi-dev zlib1g-dev -y

Installing Python 3.9 on Debian 11

First of all, we need to download the source from python so we can proceed with the manual installation, so please run this command now:


When the download finishes, you can extract the files and enter them on the extracted directory:

tar xvf Python-3.9.9.tgz
cd Python-3.9.9/

And once you are inside the Directory, you need to run the configure command and the make:

 ./configure --enable-optimizations
 make altinstall

After running the make command, the installation will proceed and once it’s finished you can check the version installed running the following command:

root@server:~/Python-3.9.9# python3.9 --version
Output: Python 3.9.9

And that’s it, you have successfully installed Python 3.9 on your Debian 11 system.

Of course, you don’t have to install Python 3.9 on Debian 11. If you find it difficult, you can simply ask our expert Linux admins to install Discourse on Ubuntu 20.04 for you. They are available 24/7 and will take care of your request immediately.

Leave a Comment