Share your love
Install Python 3.13 on AlmaLinux and Rocky Linux: Easy Setup

This guide intends to teach you How To Install Python 3.13 on AlmaLinux and Rocky Linux. Python is widely used in AlmaLinux and Rocky Linux for system automation, scripting, software development, and server management. It is a core component of many Linux tools and is essential for administration, security tasks, and package management.
The current stable version of Python is Python 3.13. You can now proceed to the guide steps below on the Orcacore website to install Python 3.13 on AlmaLinux 8/9 and Rocky Linux 8/9.
Table of Contents
Easy Steps To Install Python 3.13 on AlmaLinux and Rocky Linux
To set up Python 3.13 on AlmaLinux and Rocky Linux, you must log in to your server as a non-root user with sudo privileges. In this guide, we use AlmaLinux 9 to show you the guide steps.
1. Install Dependencies For Python 3.13 Setup
First, you must run the system update by using the command below:
sudo dnf update -y
Then, use the command below to install the required packages and dependencies for Python 3.13 setup on AlmaLinux and Rocky Linux:
# sudo dnf install gcc openssl-devel bzip2-devel libffi-devel zlib-devel wget make tar -y
# sudo dnf groupinstall "Development Tools" -y
Once you are done, proceed to the next step to download Python 3.13 from the source.
2. Download Python 3.13 Source Package
At this point, you need to visit the Python Source Releases and get the latest stable version by using the following wget command:
sudo wget https://www.python.org/ftp/python/3.13.2/Python-3.13.2.tgz

Once your download is completed, extract your Python 3.13 package with the command below:
sudo tar -xf Python-3.13.2.tgz
Then, navigate to the Python 3.13 directory with the command below:
cd Python-3.13.2
3. Build and Install Python 3.13
At this step, you can start to build and install Python 3.13 on AlmaLinux and Rocky Linux 9. First, you need to be sure that all the dependencies work correctly for Python 3.13. To do this, run the command below:
sudo ./configure --enable-optimizations
When it is finished, in your output you will see:

Next, run the command below to check your system cores:
sudo nproc
Example Output
4
Now you can start to build Python 3.13 by using the command below and define your number of cores with the -j option:
sudo make -j 4
This will take some time to complete. Then, use the command below to install Python 3.13 on your AlmaLinux or Rocky Linux server:
sudo make altinstall
Once your installation is completed, you can verify it by checking its version:
python3.13 --version
Output
Python 3.13.2
4. Create a Test Project with Python 3.13
To verify Python 3.13 is working correctly on AlmaLinux and Rocky Linux, we want to create a test project. First, you need to create the Python project directory and switch to it with the following command:
mkdir ~/test_app && cd ~/test_app
Then, from the project directory, create a virtual environment with the following command, we named it test_app_venv:
python3.13 -m venv test_app_venv
Next, activate your virtual environment with the command below:
source test_app_venv/bin/activate
You will see that your shell prompts changes to the name of your virtual environment. For example, you can install awscli inside your virtual environment with the pip package manager for Python:
pip3.13 install awscli

To exit from your virtual environment you can use the following command:
deactivate
Conclusion
As of February 2025, Python 3.13 is the latest stable release. AlmaLinux and Rocky Linux, both derived from Red Hat Enterprise Linux (RHEL), typically include Python 3.9 in their default repositories. To install Python 3.13 on these systems, you’ll need to build it from the source. As you saw, you can easily follow the guide steps above and complete your Python 3.13 setup.
Hope you enjoy it. Please subscribe to us on Facebook, YouTube, and X.
Also, you may like to read the following articles:
Install Python 3.12 on Rocky Linux 8 AlmaLinux 8
Set up Python 3.12 on Ubuntu and Debian
FAQs
Will installing Python 3.13 affect the system’s default Python version?
No, using make altinstall ensures that the new Python version is installed alongside the default one without replacing it. The system will continue to use the default Python interpreter unless you explicitly call Python 3.13 using python3.13.
How can I set Python 3.13 as the default Python interpreter?
It’s generally recommended to keep the system’s default Python version unchanged to avoid potential issues. However, for user-specific applications, you can modify your shell profile (.bashrc or .bash_profile) and set alias python to python3.13.