Python — one of the most popular programming languages used in web development, data analysis, artificial intelligence, and much more. CentOS, a popular Linux server distribution, is often used in corporate environments. This article will show you how to install Python 3.10 on CentOS 7.
Step 1: Update CentOS 7
Before installing new software, it is recommended to update system packages to the latest versions.
To update your CentOS system, execute:
sudo yum update -y
After the update is complete, reboot the system:
sudo reboot
Step 2: Install necessary development tools
Install the necessary development tools to build Python 3.10 on CentOS 7:
sudo yum groupinstall "Development Tools" -y sudo yum install openssl-devel libffi-devel bzip2-devel -y
Check the availability of gcc:
gcc --version
Step 3: Download the Python 3.10 archive
First, install the wget command:
sudo yum install wget -y
Now download the Python 3.10 archive:
wget https://www.python.org/ftp/python/3.10.0/Python-3.10.0.tgz
Extract the archive file:
tar xvf Python-3.10.0.tgz
Navigate to the created folder:
cd Python-3.10.0
Step 4: Install Python 3.10 on CentOS 7
To start the Python installation, execute:
./configure --enable-optimizations
sudo make altinstall
After a successful installation, check the Python version:
python3.10 --version
Also, ensure the availability of pip3.10:
pip3.10 --version
Installing Python modules on CentOS 7
Python modules extend the functionality of the language. The Python package manager (PIP) can be used to install them. If PIP is not installed:
sudo yum install python3-pip
To install a specific module:
sudo pip install module-name
For example, to install the cython module:
python3 -m pip install cython
To see the list of installed packages:
pip3.10 list
Conclusion: We hope this guide on installing Python 3.10 on CentOS 7 was helpful. Now you are ready to use Python for developing various applications and programs.
We also suggest you other useful articles: