Devops: Install Python3 on CentOS 7 (RHEL)

In this article, we will see how to install python3 on Linux like RHEL, centos 7. By default, all of the Linux distributions come with pre-installed Python 2.x. not Python 3.x.

Step 1 – Download latest Python archive

Download source code from Python website on your server using tools like wget. You can find latest release here. Un-archive downloaded file and navigate to created directory. Also, make sure you have gcc package installed on your system.

root@devopstechie$ wget https://www.python.org/ftp/python/3.6.3/Python-3.6.3.tar.xz
root@devopstechie$ tar xf Python-3.6.3.tar.xz

Step 2 – Compile Source Code

Execute configure script in Python-3.6.3 directory. Next run make followed by make install to complete installation.

root@devopstechie$ ./configure
root@devopstechie$ make
root@devopstechie$ make install

Step 3 – Check Python installed version

Following output  Python 3.6.3 shows installed python v3.

root@devopstechie$ python3
Python 3.6.3 (default, Nov  23 2017, 12:28:06)
[GCC 4.8.5 20150623 (Red Hat 4.8.5-16)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>>

Avinash Pawar

DevOps Practitioner interested in learning new technologies and interested in sharing the knowledge with others.

More Posts - Website

Follow Me:
TwitterFacebookLinkedInGoogle Plus

Avinash Pawar

DevOps Practitioner interested in learning new technologies and interested in sharing the knowledge with others.

One thought to “Devops: Install Python3 on CentOS 7 (RHEL)”

Leave a Reply