Python is one of the most widely used programming and scripting languages. With the use of the Internet of Things (IoT) & Artificial Intelligence (AI) on the rise, python has become one of the most widely sought computing languages. Python is a high-level programming language used for general-purpose programming.
Python emphasizes on code readability & is very easy to pick up & learn. Moreover, there is a very active community for python & you can start from thousands of projects available for free depending on your use-case.
Recommended Read: How to install JAVA on Ubuntu
Also Read: Simple guide to install MongoDB on Ubuntu 18.04
Python support for versions 2 aka python 2 has been discontinued from 1st Jan, 2020 & now only python version 3.5+ will be supported. In this tutorial, we will learn to install Python on CentOS & RHEL systems.
Install Python on CentOS/RHEL
Default repositories for CentOS do not always contain the latest python versions installed & we need to install community maintained repositories to install python. There are two community maintained repositories that we can use & we will discuss them one by one.
IUS Community
Install the rpm for this community with the following commands,
# sudo yum install yum-utils
# yum install https://centos7.iuscommunity.org/ius-release.rpm
Once this repository has been installed, Now install python with the following command,
# yum install python37u
SCL community
This method is specific for CentOS & is not tested by me on RHEL. SCL or software collections, allow us to install multiple versions of software on the system & it will not affect the default packages as well. Install SCL with the following command,
# yum install centos-release-scl
Now install python with the following command,
# yum install rh-python37
Now to use the latest version, open a new bash shell & use the following command,
# enable rh-python37 bash
You can use python 3.7 on this shell session, on new shell the default python version will be a system installed only.
Installing from Source
We have created a dedicated tutorial to install Python from Source. Please refer it.
That’s it for now, you can reach us for any question, query or a suggestion using the comment box below.