How to Install Python 3.13 on Almal Linux 10

Estimated reading: 2 minutes 1144 views

Introduction

This guide explains how to install Python 3.13 on RHEL 10 or AlmaLinux 10 by compiling it from source, since it is not available in the default repositories. The steps include preparing the system, installing required development packages, building Python, and verifying the installation.

Step 1: Update the system

Keeping the system updated ensures compatibility during the build process.

sudo yum -y update

Step 2: Install development tools and dependencies

Python 3.13 requires several libraries and build tools. Install the necessary packages:

sudo yum -y install wget make cmake gcc bzip2-devel libffi-devel zlib-devel

Install the Development Tools group to provide compilers, linkers, and other utilities required for building software:

sudo yum -y groupinstall "Development Tools"

Verify that GCC is available:

gcc --version

Step 3: Download, build, and install Python 3.13

Download the Python 3.13.4 source code:

wget https://www.python.org/ftp/python/3.13.4/Python-3.13.4.tgz

Extract the archive:

tar xvf Python-3.13.4.tgz

Navigate into the extracted directory:

cd Python-3.13*/

Configure the build with optimizations and shared library support:

./configure --enable-optimizations --prefix=/usr/local --enable-shared LDFLAGS="-Wl,-rpath /usr/local/lib"

Compile the source code:

make

Note:
The compilation process can take a significant amount of time depending on the system’s CPU performance. On typical VPS or dedicated servers, building Python from source usually requires 10 to 30 minutes, but it may vary depending on your hardware configuration.

Install Python without overriding the system version:

sudo make altinstall

Verify the installation:

python3.13 --version

Verify OpenSSL support

Run Python:

python3.13

Inside the Python shell:

import ssl

ssl.OPENSSL_VERSION

Test basic functionality:

print ("Hello World")

Step 4: Install Python packages using pip3.13

Check pip installation:

pip3.13 --version

Upgrade pip:

pip3.13 install --upgrade pip

Install any Python module:

pip3.13 install <module-name>

Example using awscli:

pip3.13 install awscli --user

Inspect package details:

pip3.13 show awscli

Install a specific version:

python3.13 -m pip install "package_name==1.4"

Install using a version range:

python3.13 -m pip install "package_name>=1,<2"

Upgrade an installed package:

python3.13 -m pip install --upgrade package_name

Conclusion

Python is a great option for anyone wishing to learn or adopt a programming language for a variety of applications and projects due to its adaptability, simplicity, and capabilities. There are many libraries, frameworks, and tools available that let you create creative applications quickly.

Share this Doc

How to Install Python 3.13 on Almal Linux 10

Or copy link

CONTENTS