Home  »  ArticlesGuidesHow ToProgrammingTechnology   »   How to Install Python 3.12 on AlmaLinux 8.10 Systems

How to Install Python 3.12 on AlmaLinux 8.10 Systems

Python, the high-level, interpreted programming language known for its readability and efficiency, has released its version 3.12. For those using AlmaLinux 8.10, upgrading to this latest version can bring several benefits, including new features and security improvements. This guide provides a step-by-step process to install Python 3.12 on AlmaLinux 8.10 systems.

Prerequisites

Before proceeding with the installation, ensure that you have access to your server as a non-root user with sudo privileges. It’s also essential to have an internet connection to download the necessary files from Python’s official website.

Step 1: Installing Dependencies

The first step involves updating your system and installing the required packages and dependencies for Python 3.12. Use the following commands to update your system and install the dependencies:

$ sudo dnf update -y
$ sudo dnf install gcc openssl-devel bzip2-devel libffi-devel zlib-devel wget make tar -y

Step 2: Downloading Python 3.12

Next, download the latest stable Python package from the official Python website using the wget command:

$ sudo wget https://www.python.org/ftp/python/3.12.1/Python-3.12.1.tgz

After downloading, extract the file using:

$ sudo tar -xf Python-3.12.1.tgz

Step 3: Building and Installing Python 3.12

Navigate to the Python directory and begin the installation process:

$ cd Python-3.12.1
$ sudo ./configure --enable-optimizations

Find the number of cores in your system to optimize the build process:

$ sudo nproc

With the number of cores determined, start the build process using:

$ sudo make -j <number_of_cores>

Replace <number_of_cores> with the actual number you obtained from the previous command. Once the build is complete, install Python 3.12 with:

$ sudo make altinstall

Step 4: Verifying the Installation

To ensure that Python 3.12 has been installed correctly, check the version:

$ python3.12 --version

If the output displays Python 3.12.x, congratulations, you have successfully installed Python 3.12 on your AlmaLinux 8.10 system.

Conclusion

By following these steps, you can enjoy the latest features and improvements that Python 3.12 offers. Whether you’re developing software, building websites, or working on data analysis, Python 3.12 will provide a robust and versatile programming environment for your projects.

For more detailed instructions and troubleshooting tips, you can refer to the comprehensive guides provided in the official AlmaLinux documentation and Python documentation.

Found this article interesting? Follow Brightwhiz on Facebook, Twitter, and YouTube to read and watch more content we post.