How to install Python 3.9 on Debian 10 to 13 [Quickly]

Here's how to install Python on Debian

Let’s see how to install the latest version of Python 3.9 on Debian 10/11/12/13. If you are completely new to this, don’t worry. It won’t take more than 3 minutes to install Python on Debian.

Python is undoubtedly the most used and easy-to-learn programming language out there. The syntax of python is very similar to that of English and hence a beginner won’t find it that tough to learn the language.

Python 3.9 is the latest version of Python with some excellent features like new dictionary operators, new string methods, new parser, etc. You can find a detailed list of all newly added features and options on Python’s official website.

You may also like – How to Open tar files in Linux

You may also like – How to Fix Bash Command Not Found

Get Python 3.9 on Debian 10

As mentioned earlier, installing Python is as simple as executing a few lines of commands. Even if you are new to this, you won’t find it challenging.

Follow the steps by step guide given below to install Python 3.9 on Debian quickly.

Learn all the zip commands

Firstly, you need to install all the necessary dependencies required to build Python. Use the following command for the same:

sudo apt update
sudo apt install build-essential zlib1g-dev libncurses5-dev libgdbm-dev libnss3-dev libssl-dev libsqlite3-dev libreadline-dev libffi-dev curl libbz2-dev

Next, you need to download the latest version of Python from the official repository. You may use the wget command for it.


Now, extract the downloaded archive file using the command given below.

tar -xf Python-3.9.1.tgz

Use cd command to navigate to Python directory.

cd Python-3.9.1

Execute the configure script using the command. The below-given command is used to optimize the Python binary and to make sure all necessary dependencies are present.

./configure --enable-optimizations

Now to start the Python 3.9 build process use the command given below. (You may also replace -j with the number of cores in your processor to speed up the build process dramatically)

make -j 2

Finally, use the altinstall command to install Python binaries and you are all good to go.

sudo make altinstall

We have successfully installed Python 3.9 on Debian.

The next step is to verify the installation and make sure whether it is working properly or not.

To verify the installation and to display the Python version, just execute the command given below.

python --version
Check Python Version
Check Python Version

If the command returns the Python version then the installation is successful and you can start using Python.

You May Also like – How to add Kali Linux Tools on Ubuntu [Katoolin]

You may also like – How to install Photoshop on Linux

Frequently Asked Questions on Python Installation

Here are some frequently asked questions about Python installation on Debian and its answers

How to install a different version of Python on Debian?

In order to install a different version of Python on Debian, just replace the the URL on wget command. You may find the links on the download page.

How to check the Python version?

You may use the –version, -V or -VV command to check the version of Python.