It looks like you're new here. If you want to get involved, click one of these buttons!
Sign In RegisterIt looks like you're new here. If you want to get involved, click one of these buttons!
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.
Start by updating your system to ensure it is up-to-date. Run the following command:
dnf update -y
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
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
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.
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
Now you can develop software using the Python 3.12, the newest release of the Python programming language.