How to Install Python 3.9 on Debian 10

Python is an interpreted high-level general-purpose programming language. Python's design philosophy emphasizes code readability with its notable use of significant indentation.

First, check for any pending system updates,

apt update

apt upgrade

Install required packages.

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

Install Python 3.9 on Debian

By default, Debian 10 comes with Python version 3.7 only. In this article, we are going to install Python 3.9 on Debian 10 system.

Download Python 3.9 source archive from its official website.


Extract the downloaded file.

tar xzf Python-3.9.4.tgz 

Change to the extracted directory with following command.

cd Python-3.9.4 

Run configuration command.

./configure --enable-optimizations 

Complete the Python installation on Debian system by running the following command.

make altinstall 

To check Python version.

python3.9 --version


root@vps:~/Python-3.9.4# python3.9 --version
Python 3.9.4

Using pip on Python 3.9

Check the installed version of pip by running the following command,

pip3.9 -V 


root@vps:~/Python-3.9.4# pip3.9 -V
pip 20.2.3 from /usr/local/lib/python3.9/site-packages/pip (python 3.9)