Python is one of the most popular programming languages today. It has a simple syntax that is easy for beginners to understand. Python is a good choice for developing simple as well as complex applications.
By default, Python is not installed on CentOS 8, but this tutorial guides you through the installation process. The two most popular versions of Python are Python 2 and Python 3. Python 2 is an old version that will expire in 2020, and Python 3 is the latest version and is used in many applications. In the previous CentOS releases, an unversioned Python command was available by default, allowing users to easily set the default version of Python to their own preference. However, CentOS 8/RHEL does not have an unversioned Python standard command anymore. This is because it prevents users from locking themselves to a particular version of Python. Therefore, CentOS 8 gives the user the choice to install and configure a particular version of Python according to their needs or install both versions side by side.
Some important features of Python are listed below
The system manager tool YUM and DNF packages use Python in system libraries. In this article, you will learn how to install Python 2 and Python 3 on CentOS 8. Before you can begin installing Python 2 and Python 3, there are a few prerequisites that must be met.
The following steps are involved to install Python 2 on CentOS 8.0:
To ensure all packages are up to date in your system, the Yum package manager provides facility to CentOS 8 users to install all the latest updates related to software. For this purpose, run the following command:
$ sudo yum update
After updating all Yum packages, install Python 2 on CentOS 8.0. Run the following command on the terminal to install Python 2:
$ sudo yum install python2
The installation of Python 2 has been completed. In Python 2 different types of versions are included. To know what Python version is installed on your system. Type the following command on terminal:
$ python2 --version
Here, Python 2.7.16 has installed on my CentOS 8.0 system.
To verify the installation that Python 2 is installed on your system or not, run the following command on terminal:
$ python2
Python 2 has successfully installed on your system. By default, the python-pip package is also installed during Python 2 installation. So, now you should be able to work on Python packages.
Take the following steps to install Python 3 on CentOS 8.0.
It is the best practice to keep the system packages up to date. So, again update all yum packages to run the following command:
$ sudo yum update
Now, install Python 3 on CentOS 8.0. Run the following command on terminal:
$ sudo yum install python3
To verify which version of Python 3 is installed on your system, type the following command on terminal:
$ python3 --version
After completing the installation of Python 3, you can check whether Python 3 is installed on your system correctly or not. Type the following command to run Python 3 on terminal:
$ python3
In this tutorial, you learned about the installation of yum updates. More we have explored how to install Python 2 and Python 3 on CentOS 8.0. I hope this article would be helpful for you. Now, I’m sure you would be able to install any type of version of Python on the CentOS 8 system.
Magento is a free and open-source e-commerce platform written in PHP. It is simple, easy…
ISPConfig is an open-source control panel that allows users to manage multiple servers from a…
As a Linux administrator, you may find it necessary to troubleshoot or test your Simple…
Ubuntu 24.04, like many modern Linux distributions, relies on the NetworkManager for managing network connections.…
Restic is a modern, open-source backup program designed for efficiency, security, and simplicity. It enables…
phpMyAdmin is a popular free tool written in PHP intended to administer MySQL and MariaDB…