Greetings. Python 2.7, Python 3.5, and Python 3.6 reached EOL requiring Python developers to upgrade to new releases { Python 3.7, Python 3.8, Python 3.9, Python 3.10, Python 3.11, Python 3.12, or Python 3.13 }. Python 3.12 and 3.13 are the latest stable releases.
Python is a powerful programming language that is very easy to learn. It has an elegant syntax and dynamic typing because it is an interpreted language. It has efficient high-level data structures with a fantastic approach to object-oriented programming. Developers prefer Python because of its powerful scripting capabilities. Also, Python Libraries and interpreters are freely available in source or binary form and are freely distributed. Additionally, Python supports many third-party Python modules, programs, and tools developers use for their development work.
Python interpreter is easily extendable with new functions and data types implemented in C or C++. Python is also an extension language ideal for customizable applications.
In this blog spot, we will learn how to Install Python 3.13 on Rocky Linux 9 / AlmaLinux 9. But before then you can have look at the new features in Python 3.13 by clicking on the link. Some of the features include the following:
- A brand-new, enhanced interactive interpreter built on top of PyPy that offers colorized exception tracebacks, multi-line editing, and color support.
- An experimental free-threaded build mode that permits threads to operate more concurrently by turning off the Global Interpreter Lock. The Windows and macOS installers also offer the build mode as an experimental feature.
- An experimental, preliminary JIT that lays the foundation for major performance gains.
- Debuggers can now work more reliably because the locals() builtin function (and its C equivalent) has clearly stated semantics when changing the returned mapping.
- Now included is a modified version of mimalloc, which is necessary for the free-threaded build mode and optional but enabled by default if the platform supports it.
- The leading indentation of docstrings has been removed, which lowers memory usage and the size of.pyc files. (The majority of docstring handling utilities already remove the leading indentation.)
- When generating new files, the dbm module’s new dbm.sqlite3 backend is utilized by default.
How To Install Python 3.13 on Rocky Linux 9 / AlmaLinux 9
With that background, we will now briefly learn how to install python 3.13 on Rocky Linux 9 / Alma Linux 9 both derivatives of RedHat Linux. Ensure that at least your system has the following minimum requirements.
System Minimal Requirements.
Your system should meet the following minimal requirements:-
- 2 CPUs
- 4 GiB RAM
- At least 10 GiB of storage.
- Internet access
- Hardware – 32-bit, 64-bit, and arm-64 CPU architectures. ( Intel and AMD CPUs (x86 64-bit CPU).
We will jump right in and learn how to install Python on Rocky Linux 9 / AlmaLinux 9. Begin by updating the system package repositories.
Check the system redhat release :
$ cat /etc/redhat-release
Rocky Linux release 9.5 (Blue Onyx)
Step 1: Update AlmaLinux 9 / Rocky Linux 9
Update the system packages. This is always the first step.
sudo dnf update -y
Once done with the update, check the default version installed in your system.
$ python3 -V
Python 3.9.21
By default, my system is running on Python 3.9.21
Step 2: Install the necessary packages
Install the necessary packages required to install Python 3.13. Run the command below.
sudo dnf install openssl-devel bzip2-devel libffi-devel -y
Install development tools that help the developers to create, debug, maintain, or support other programs and applications.
sudo dnf groupinstall "Development Tools"
The command installs multiple packages.
Step 3: Download Python 3.13 tarball
We will now download Python 3.13 source code. Navigate to the official Python Source Releases and copy the download link.
Download the source code.
VERSION=3.13.1
wget https://www.python.org/ftp/python/$VERSION/Python-$VERSION.tgz
Extract the file:
tar -xzf Python-$VERSION.tgz
Step 4: Install Python 3.13 on Rocky Linux 9 / AlmaLinux 9
In this step, we will install Python 3.13.
Change into the Python directory.
cd Python-$VERSION
Once in the directory, run the command below.
./configure --enable-optimizations
A sample output:
...
checking for stdlib extension module _testsinglephase... yes
checking for stdlib extension module _testexternalinspection... yes
checking for stdlib extension module xxsubtype... yes
checking for stdlib extension module _xxtestfuzz... yes
checking for stdlib extension module _ctypes_test... yes
checking for stdlib extension module xxlimited... yes
checking for stdlib extension module xxlimited_35... yes
configure: creating ./config.status
config.status: creating Makefile.pre
config.status: creating Misc/python.pc
config.status: creating Misc/python-embed.pc
config.status: creating Misc/python-config.sh
config.status: creating Modules/Setup.bootstrap
config.status: creating Modules/Setup.stdlib
config.status: creating Modules/ld_so_aix
config.status: creating pyconfig.h
configure: creating Modules/Setup.local
configure: creating Makefile
Allow the command to run to completion.
Finally, compile Python with the code below.
sudo make altinstall
The compilation process might run for some time. Please be patient.
Check Python 3.13 installation on Rocky Linux 9 / AlmaLinux 9
After successful installation, check the version installed on Rocky Linux 8 / AlmaLinux 8 by the following command.
$ python3.13 --version
Python 3.13.1
Version 3.11 is successfully installed.
During Python installation, pip is also installed. Check the pip version installed by running this command.
$ pip3.11 --version
pip 24.3.1 from /usr/local/lib/python3.13/site-packages/pip (python 3.13)
Pip 24.3.1 was installed. Upgrade pip by this command.
$ /usr/local/bin/python3.13 -m pip install --upgrade pip
Requirement already satisfied: pip in /usr/local/lib/python3.13/site-packages (24.3.1)
The latest version of Pip is installed, hence no upgrade has been made.
To install a package using pip, use the syntax below.
python3 -m pip install "package_name"
#or
pip3.13 install awscli --user
Usage example:
[root@rocky9 ~]# pip3.13 install awscli --user
Collecting awscli
Downloading awscli-1.36.28-py3-none-any.whl.metadata (11 kB)
Collecting botocore==1.35.87 (from awscli)
Downloading botocore-1.35.87-py3-none-any.whl.metadata (5.7 kB)
Collecting docutils<0.17,>=0.10 (from awscli)
Downloading docutils-0.16-py2.py3-none-any.whl.metadata (2.7 kB)
Collecting s3transfer<0.11.0,>=0.10.0 (from awscli)
Downloading s3transfer-0.10.4-py3-none-any.whl.metadata (1.7 kB)
Collecting PyYAML<6.1,>=3.10 (from awscli)
Downloading PyYAML-6.0.2-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (2.1 kB)
Collecting colorama<0.4.7,>=0.2.5 (from awscli)
Downloading colorama-0.4.6-py2.py3-none-any.whl.metadata (17 kB)
Collecting rsa<4.8,>=3.1.2 (from awscli)
Downloading rsa-4.7.2-py3-none-any.whl.metadata (3.6 kB)
Collecting jmespath<2.0.0,>=0.7.1 (from botocore==1.35.87->awscli)
Downloading jmespath-1.0.1-py3-none-any.whl.metadata (7.6 kB)
Collecting python-dateutil<3.0.0,>=2.1 (from botocore==1.35.87->awscli)
Downloading python_dateutil-2.9.0.post0-py2.py3-none-any.whl.metadata (8.4 kB)
Collecting urllib3!=2.2.0,<3,>=1.25.4 (from botocore==1.35.87->awscli)
Downloading urllib3-2.3.0-py3-none-any.whl.metadata (6.5 kB)
Collecting pyasn1>=0.1.3 (from rsa<4.8,>=3.1.2->awscli)
Downloading pyasn1-0.6.1-py3-none-any.whl.metadata (8.4 kB)
Collecting six>=1.5 (from python-dateutil<3.0.0,>=2.1->botocore==1.35.87->awscli)
Downloading six-1.17.0-py2.py3-none-any.whl.metadata (1.7 kB)
Downloading awscli-1.36.28-py3-none-any.whl (4.6 MB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 4.6/4.6 MB 7.9 MB/s eta 0:00:00
Downloading botocore-1.35.87-py3-none-any.whl (13.3 MB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 13.3/13.3 MB 29.6 MB/s eta 0:00:00
Downloading colorama-0.4.6-py2.py3-none-any.whl (25 kB)
Downloading docutils-0.16-py2.py3-none-any.whl (548 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 548.2/548.2 kB 21.3 MB/s eta 0:00:00
Downloading PyYAML-6.0.2-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (759 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 759.5/759.5 kB 29.1 MB/s eta 0:00:00
Downloading rsa-4.7.2-py3-none-any.whl (34 kB)
Downloading s3transfer-0.10.4-py3-none-any.whl (83 kB)
Downloading jmespath-1.0.1-py3-none-any.whl (20 kB)
Downloading pyasn1-0.6.1-py3-none-any.whl (83 kB)
Downloading python_dateutil-2.9.0.post0-py2.py3-none-any.whl (229 kB)
Downloading urllib3-2.3.0-py3-none-any.whl (128 kB)
Downloading six-1.17.0-py2.py3-none-any.whl (11 kB)
Installing collected packages: urllib3, six, PyYAML, pyasn1, jmespath, docutils, colorama, rsa, python-dateutil, botocore, s3transfer, awscli
Successfully installed PyYAML-6.0.2 awscli-1.36.28 botocore-1.35.87 colorama-0.4.6 docutils-0.16 jmespath-1.0.1 pyasn1-0.6.1 python-dateutil-2.9.0.post0 rsa-4.7.2 s3transfer-0.10.4 six-1.17.0 urllib3-2.3.0
To install a specific package version, use the syntax below.
python3 -m pip install "package_name==1.4"
To install greater than or equal to one version and less than another:
python3 -m pip install "package_name>=1,<2"
To upgrade an already installed package.
python3 -m pip install --upgrade package_name
Final Call
Our guide has demonstrated how to Install Python 3.13 on Rocky Linux 9 / AlmaLinux 9. We looked at some key features associated with Python 3.13 and a step-by-step approach to how to install Python 3.13 on Rocky Linux 9 / AlmaLinux 9. Finally, we looked at an example of using pip to install a package. I hope the guide was helpful.
To read more on Python, see our guides below.