Miscellaneouss

How to Install Python 3.5 on CentOS/RHEL 6/7

install-python
mm
Written by Santosh Prasad

Python is a general-purpose programming language which can be used for a wide variety of applications. A great language for beginners because of its readability and other structural elements designed to make it easy to understand, Python is not limited to basic usage. In fact, it powers some of the world’s most complex applications and website.

The default Python version 2.7 is still same on latest CentOS 7. It is also not available in base repositories.

In this article I will show how to install python 3.5 on CentOS/RHEL 6/7.

Install Python 3.5

Follow the below steps to install python 3.5 on CentOS/RHEL 6/7.

1. Install Required Packages

First of all install all required packages. Run the below command to install packages.

# yum install gcc

2. Download Python 3.5

After installing required packages now download the the python using below command.

# cd /opt
# wget https://www.python.org/ftp/python/3.5.1/Python-3.5.1.tgz

3. Extract Archive File and Compile

Use below commands to extract Python source code and compile it on your system using altinstall.

# tar xzf Python-3.5.1.tgz
# cd Python-3.5.1
# ./configure
# make altinstall

make altinstall is used to prevent replacing the default python binary file /usr/bin/python.

4. Check Python Version

Now check the latest installed python version using below command.

# python3.5 -V
Or
# python3.5 --version

You will get some output like below.

Python 3.5.1
Thank you! for visiting Look Linux.

If you find this tutorial helpful please share with your friends to keep it alive. For more helpful topic browse my website www.looklinux.com. To become an author at Look Linux Submit Article. Stay connected to Facebook.

About the author

mm

Santosh Prasad

Hi! I'm Santosh and I'm here to post some cool article for you. If you have any query and suggestion please comment in comment section.

Leave a Comment