Python 3.11 releases now and the best part is its speed. It’s up to 60% faster than Python 3.10.

Guido van Rossum is an inventor of Python, a general-purpose, interpreted, and high-level programming language that lets you work more quickly and integrate your systems more effectively. Python is designed for ease of use, deep integration, and extensibility. Using Python, you can do a lot more with powerful libraries and tools like Django, Pygame, Matplotlib, Plotly, and so on. Python is a cross-platform programming language that runs on Linux, Windows, macOS, and BSD operating systems.

Python versions, Release Dates and EOL:

VersionsReleased DatesEnd of life
3.1124 Oct 202224 Oct 2027
3.1004 Oct 202104 Oct 2026
3.905 Oct 202005 Oct 2025
3.814 Oct 201914 Oct 2024
3.726 Jun 201827 Jun 2023
3.622 Dec 201623 Dec 2021
2.701 Oct 200829 Oct 2013
Python Released Dates and EOL

Python is a first class citizen on Linux, and now Windows has a newer version of python prepackaged, But sad part is we need to compile latest python on some Linux systems.

Steps to install latest Python 3.11 on Linux

Python 3.11 is available for download as ready-to-use packages or installers for Windows. This guide will help you on how to install latest version of python 3.11 on Linux server.

python installation steps
python installation steps

Prerequisites:

  • sudo privileges.
  • Stable internet connection.

First check server OS version then start installation as per OS version:

# egrep '^(VERSION|NAME)=' /etc/os-release

Check installed python version:

# python --version
OR
# python3 --version

Python 3.11 installation on Debian and Ubuntu:

Steps to install latest python 3.11 on Debian and Ubuntu server.

Now install the utility and add the following PPA.

# apt install software-properties-common
# add-apt-repository ppa:deadsnakes/ppa

Refresh the apt cache

# apt update

And finally install Python 3.11

# apt install python3.11

Then set installed python version path

# update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.11 1

choose which one to use as Python3

# update-alternatives --config python3

Python 3.11 installation on CentOS and related distros:

Steps to install python 3.11 on CentOS, Red Hat Enterprise Linux, Oracle Linux and Rocky Linux.

Note: The CentOS 7 Linux distribution includes Python 2 by default. However, Python 2 and CentOS reached to its EOL. While many legacy applications might require Python 2 by default and Python 3.6.8 is supported with yum repository which is also reached to EOL.

In order to install Python 3.11 from source, we need some prerequisite packages are installed on system and for building Python 3.11 requires a Openssl 1.1.1 or newer. Please check Openssl version before installing Python 3.11.

# openssl version

You can install latest Openssl from here.

For RHEL, CentOS and Oracle Linux 7 server
# yum group install 'Development Tools' -y
# yum install wget yum-utils gcc openssl-devel bzip2-devel libffi-devel xz-devel gzip unzip -y

For RHEL, CentOS, Oracle Linux or Rocky Linux 8 and 9 server
# dnf group install 'Development Tools' -y
# dnf install wget yum-utils gcc openssl-devel bzip2-devel libffi-devel xz-devel gzip unzip -y

Now  Download the latest Python version using terminal:

# cd /opt/ && wget https://www.python.org/ftp/python/3.11.4/Python-3.11.4.tgz

Next step is unzip downloaded zip file and go to unzip directory:

# tar -xzvf Python-3.11.*.tgz && rm -rf Python-3.11.*.tgz
# cd Python-3.11.*

Compile downloaded Python source code:

For CentOS 7 only
# ./configure --prefix=/opt/python311 --with-system-ffi --with-computed-gotos --enable-loadable-sqlite-extensions

For all other OS
# ./configure --prefix=/opt/python311 --enable-optimizations --with-system-ffi --with-computed-gotos --enable-loadable-sqlite-extensions

And finally, compile Python (without replacing the default version):

Note: This process might be take a while.

# make altinstall

Then set installed python version path as default path:

# update-alternatives --install /usr/bin/python3 python3 /opt/python311/bin/python3.11 1
# update-alternatives --install /usr/bin/python3-config python3-config /opt/python311/bin/python3.11-config 1
# update-alternatives --install /usr/bin/pip3 pip3 /opt/python311/bin/pip3.11 1

You can verify installed Python 3.11 with the following command:

# python3 -V

For old version use

# python -V

That’s it. Now we installed the latest version of Python on Linux system.

Uninstall Python from Linux system

To completely remove Python from a system, you must remove applications, the configuration files, and any directories containing data.

WARNING: This process will completely remove Python and its configuration. This process is not reversible, so ensure that all of your configuration and data is backed up before proceeding.

# rm -rf /opt/python311
# update-alternatives --remove /usr/bin/python3 python3 /opt/python311/bin/python3.11 1
# update-alternatives --remove /usr/bin/python3-config python3-config /opt/python311/bin/python3.11-config 1
# update-alternatives --remove /usr/bin/pip3 pip3 /opt/python311/bin/pip3.11 1

Conclusion

Congratulations! We’ve installed Latest Python 3.11 on Linux system like CentOS, RHEL, Ubuntu and Debian. We hope this 2 minutes stuff helped you and thank you for visiting our website.
Cheers!!!