How to install Python 3.10 on Debian 11?

Everything Linux, A.I, IT News, DataOps, Open Source and more delivered right to you.
Subscribe
"The best Linux newsletter on the web"

Hello friends. In this rather short post, we will help you to install Python 3.10 on Debian 11.

Debian 11 has Python, do I have to upgrade?

The answer to this question depends on the needs of each user. Some users are developers in this language and therefore need to take advantage of the latest features of this; On the other hand, there are also the testers who with their expertise help the growth of the language and the applications that use it.

There is also a third group more focused on server administration. These are more careful at the moment of making any new installation, but they can also be forced to instate it in favor of some scripts, libraries, or programs that require it.

On the opposite side are the desktop users who are not forced to do this. If you are an occasional system user or do not belong to any of this group then it is not strictly necessary leaving the decision up to you,

So, let’s go for it. The process is fast and secure.

Install Python 3.10 on Debian 11

Let’s start by upgrading the system completely. So, open a terminal or connect via SSH.

sudo apt update
sudo apt upgrade

Note: In case you can’t use sudo then you have to run these commands as root user.

After that, install all these packages which are the dependencies to compile and install Python 3.10.

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

Now we have to download the Python source code. To do this we will use the wget command

wget https://www.python.org/ftp/python/3.10.0/Python-3.10.0.tgz
1.- Download Python 3.10 on Debian 11
1.- Download Python 3.10 on Debian 11

Extract it with the tar command

tar xzf Python-3.10.0.tgz 

Access to the folder that has been created

cd Python-3.10.0

Now start the compilation as follows

sudo ./configure --enable-optimizations
2.- Install Python 3.10 on debian 11
2.- Install Python 3.10 on debian 11

It is recommended not to replace the version of Python that is on the system. This can be done with the command

sudo make altinstall 
3.- Python on debian
3.- Python on debian

This will install the new version of Python but without replacing the existing one.

Then we can verify the installation with the following command:

python3.10 -V 

Sample output

Python 3.10.0

This will also install PIP and therefore we can test it.

pip3.10 -V
pip 21.2.3 from /usr/local/lib/python3.10/site-packages/pip (python 3.10)

So, enjoy it.

Conclusion

Having a recent version of Python is possible that not everyone can take advantage of it but it is always good to know it so that when we can, make an update to take advantage of it. In this post, you have learned how to install Python 3.10 on Debian 11.

Everything Linux, A.I, IT News, DataOps, Open Source and more delivered right to you.
Subscribe
"The best Linux newsletter on the web"
Angelo
Angelo
I am Angelo. A systems engineer passionate about Linux and all open-source software. Although here I'm just another member of the family.

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Latest articles

Join us on Facebook