How to Install Python 3.13 on AlmaLinux 10

Python is an interpreted high-level general-purpose programming language. Its design philosophy emphasizes code readability with its use of significant indentation. Its language constructs as well as its object-oriented approach aim to help programmers write clear, logical code for small and large-scale projects.

Prerequisites

  • A system with AlmaLinux 10 installed and running.

  • Have root access to the system.

  • To install the Python from the source code, you will need additional packages such as GCC compiler and other dependencies installed. Run the below command to install them.

    dnf install wget yum-utils make gcc openssl-devel bzip2-devel libffi-devel zlib-devel 

Update your System.

dnf update 

Install Python 3.13.3

At the time of writing this article, the latest version of Python available was 3.13.3.

The first step is to download the source code of Python 3.13.3. Check the latest version that is available by visiting the official site https://www.python.org/downloads/

Now, Let us download the source code by using wget as shown below,

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

Extract the file by using the below command,

tar xzf Python-3.13.3.tgz

After extracting the file, Change the directory to Python-3.10.5. Then apply the source code with the required values using the command below.

cd Python-3.13.3

./configure --with-system-ffi --with-computed-gotos --enable-loadable-sqlite-extensions 

Next, we compile the source code with make. Here nproc will provide the number of CPU cores available using the command below.

make -j ${nproc} 
make altinstall 

Once the installation is complete, Check the Python version using the following command.

python3.13 -V 

Output:

[root@vps Python-3.13.3]# python3.13 -V
Python 3.13.3

Create Virtual Environment

Create Virtual Environment and activate using the below command.

/usr/local/bin/python3.13 -m venv appenv
source appenv/bin/activate

Output:

[root@vps Python-3.13.3]# /usr/local/bin/python3.13 -m venv appenv
[root@vps Python-3.13.3]# source appenv/bin/activate

In this virtual Environment, you will be able to use the latest version of Python that was installed now. You can verify the version by running the command: python -V.

Output:

(appenv) [root@vps Python-3.13.3]# python -V
Python 3.13.3

And to exit the Virtual Environment, you can use the below command,

deactivate

This concludes the installation of the latest Python version on AlmaLinux.


CrownCloud - Get a SSD powered KVM VPS at $4.5/month!
Use the code WELCOME for 10% off!

1 GB RAM / 25 GB SSD / 1 CPU Core / 1 TB Bandwidth per month

Available Locations: LAX | MIA | ATL | FRA | AMS