How to Install Python 3 on CentOS

Python 2.7 is installed by default on CentOS but we can install other versions like Python 3.9 and 3.10 . In this tutorial, we will install python

How to Install Python 3 on CentOS

Introduction

Python is a high level, dynamic, general purpose language. It was developed by Guido Van Rossum in 1991. Python's syntax allows developers to use fewer lines of code than any other programming language. It basically focuses on the code readability of program. Python 2.7 is installed by default on CentOS but we can install other versions like Python 3.9 and 3.10 . In this tutorial, we are learning how to install Python 3.6.3 on CentOS.

Prerequisites

  • CentOS
  • Login as an administrator on the terminal
  • Yum must be configured on the system.

Installation

Installation includes following steps.

1. Install IUS community Repository

In order to install Python 3.6 on CentOS, we need to first install IUS community repository which provides extra packages for Enterprise Linux. Execute the following command to install IUS community repository.

  1. $ sudo yum -y install https://centos7.iuscommunity.org/ius-release.rpm   
CentOS How to Install Python 3 on CentOS

2. Install Python 3

Execute the following command to install python 3.6 on CentOS.

  1. $ sudo yum install python36u   
CentOS How to Install Python 3 on CentOS 1

3. Verify Python

To verify if we have installed correct version of python, we just need to type python3.6 -V on the terminal. The command will show the version installed which is 3.6.4 in my case.

CentOS How to Install Python 3 on CentOS 2

4. Working on Python's script mode

Just type python3.6 on the terminal to enter the Python's script mode. We can execute the python statements on this shell. Since, python 2 is by default installed on CentOS, hence typing python on the terminal takes us to the python2 shell, hence we have to type python3.6 to work on the desired python shell.

CentOS How to Install Python 3 on CentOS 3

Execute the valid python statements which get interpreted and show the desired output on the terminal as shown below.

CentOS How to Install Python 3 on CentOS 4

Hence, we have installed and get started with Python 3.

Installation on MacOS

To install python3 on MacOS, visit the link https://coderpad.blogspot.com/2022/11/how-to-install-python3-on-macos.html and follow the instructions given in the tutorial.

Installation on Windows

To install Python3 on CentOS, visit the link https://coderpad.blogspot.com/2022/11/how-to-install-python-on-windows.html and follow the instructions given in the tutorial.

Installation on Ubuntu

To install Python3 on Ubuntu, visit the link https://coderpad.blogspot.com/2022/11/how-to-install-python-on-ubuntu-2004-lts.html and follow the instructions given in the tutorial.

 

 

Men' fashion , Dating Tips , Relationship Advice

Post a Comment