Python is most popular programming language. It uses many methods to create different types of applications. Python 3.11 is the latest major release of the Python language. It includes many new features such as new
dict operators, new
str functions, support for IANA time zone, and more. This tutorial describes multiple ways to install Python 3.11 on Debian 11 system.
Install Python on Debian 11
By default, Python 3.11 is not available in the standard Debian 11 repositories so we will download it from Python source.
Perform the following steps to install Python 3.11 on your system:
Step 1 – Install Libraries
To install Python from source, you need to install some development libraries to compile Python source code. Execute below commands:
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
Step 2 – Download Python 3.11
Download the latest Python source code from the Python official site with wget. Check the latest version at the time of downloading:
Once the download is complete, extract the downloaded source archive file.
tar xzf Python-3.11.1.tgz
Step 3 – Building Python
Now go to the Python source directory and run the configure script and
altinstall command as sudo user to build Python source code:
sudo make altinstall
It will check that all of the dependencies on your system are installed.
Note : Do not use the standard
make install as it will overwrite the default system python3 binary.
Step 4 – Verify Python Version
To verify it by type:
Congratulations! Python 3.11 is installed on your Debian system and ready to be use.
This guide explained you how to install Python 3.11 on Debian 11 system.
If you have any questions or feedback, please leave a comment below.
Leave a Reply