frame

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Sign In Register

How To Install Python 3.12 on AlmaLinux/Rocky Linux 9

MichailMichail Moderator
edited January 29 in Various Tutorials

Introduction

Python is among the most popular programming languages today, known for its ease of learning, versatility, and a wide range of plugins.

This guide will walk you through installing Python version 3.12 on AlmaLinux 9 and Rocky Linux 9.

Installation Guide

1. Update the system

Start by updating your system to ensure it is up-to-date. Run the following command:

dnf update -y

2. Ensure Required Dependencies Are Installed

Install the necessary dependencies for building Python:

dnf install gcc openssl-devel bzip2-devel libffi-devel wget tar make -y
dnf groupinstall "Development Tools" -y
dnf install zlib-devel bzip2 readline-devel openssl-devel xz xz-devel tk-devel gdbm-devel libuuid-devel libnsl2-devel -y
yum install sqlite-devel -y

3. Download Source Code

Run this command to download the Python source code:

cd /tmp
wget https://www.python.org/ftp/python/3.12.0/Python-3.12.0.tgz

Then extract the archive:

tar -xf Python-3.12.0.tgz

4. Configure and Compile Python

Next, run the following commands to configure Python:

cd /tmp/Python-3.12.0
./configure --enable-optimizations
make
make altinstall

This will take some time.

5. Verify Python Installation

Check if Python 3.12 was installed successfully:

python3.12 --version

If it returns the correct version, the installation is successful:

Python 3.12.0

Conclusion

Now you can develop software using the Python 3.12, the newest release of the Python programming language.

Sign In or Register to comment.

Time4VPS

Learn how to install a web and database server, email, FTP client or other applications. Discover and share information on server security or optimization recommendations.
Feel free to join our constantly expanding community, participate in discussions, strengthen your knowledge on Linux and Windows server management!
© 2013 - 2025 Time4VPS. All rights reserved.

Get In Touch