In this tutorial, we will show you how to install Python 3.10 on AlmaLinux 8. For those of you who didn’t know, Python is one of the most popular high-level languages, focusing on high-level and object-oriented applications from simple scrips to complex machine learning algorithms. Python comes with clear syntax and predictable semantics, and a large standard library.
This article assumes you have at least basic knowledge of Linux, know how to use the shell, and most importantly, you host your site on your own VPS. The installation is quite simple and assumes you are running in the root account, if not you may need to add ‘sudo
‘ to the commands to get root privileges. I will show you the step-by-step installation of the Python programming language on AlmaLinux 8. You can follow the same instructions for CentOS and Rocky Linux.
Prerequisites
- A server running one of the following operating systems: AlmaLinux 8, CentOS, and Rocky Linux 8.
- It’s recommended that you use a fresh OS install to prevent any potential issues.
- SSH access to the server (or just open Terminal if you’re on a desktop).
- A
non-root sudo user
or access to theroot user
. We recommend acting as anon-root sudo user
, however, as you can harm your system if you’re not careful when acting as the root.
Install Python 3.10 on AlmaLinux 8
Step 1. First, let’s start by ensuring your system is up-to-date.
sudo dnf update sudo dnf install epel-release sudo dnf install gcc openssl-devel bzip2-devel libffi-devel zlib-devel wget make
Step 2. Installing Python 3.10 on AlmaLinux 8.
Now we download the latest version of Python 3.10 from the official page by running the below command:
wget https://www.python.org/ftp/python/3.10.0/Python-3.10.0.tar.xz
Next, extract the contents of the compressed file and move it into the extracted directory:
tar -xf Python-3.10.0.tar.xz cd Python-3.10.0 && ./configure --enable-optimizations
After that, run the following command to configure the build:
make -j 2 nproc sudo make altinstall
Now check the Python version using the following command:
python3.10 --version
Output:
Python 3.10.0
Step 3. Create Virtual Environment.
Nowadays Python virtual environment is a great tool and almost necessary for every Python project. It enables you to have more isolated Python spaces on one Linux box:
mkdir ~/testing_app cd ~/testing_app python3.10 -m venv testing_app_venv
Next, activate the virtual environment using the following command below:
source testing_app_venv/bin/activate
Congratulations! You have successfully installed Python. Thanks for using this tutorial for installing Python 3.10 programming language on your AlmaLinux 8 system. For additional help or useful information, we recommend you check the official Python website.