Python 3 Installation on Centos 7

GK
2 min readApr 3, 2018

Good day folks. This read shows simple steps to install python 3.x version in your Centos 7.x machine.

I assume that you have,

  1. A machine with Centos 7.x installed be it either Vagrant or Virtual machine or physical laptop/desktop
  2. A working internet connection with wget installed or Python 3.6.x tarball downloaded from here.
  3. sudo permission

Lets begin,

Method 1: From source tar ball

  1. You need gcc to compile the python from its source
$ sudo yum install gcc

2. Download the latest python version 3.6.5

$ wget https://www.python.org/ftp/python/3.6.5/Python-3.6.5.tgz

3. User gunzip to unzip and tar to extract the files

$ gunzip Python-3.6.5.tgz && tar -xvf Python-3.6.5.tar
$ cd Python-3.6.5

4. Set the installation directory to /usr/local or whichever path that you like

$ ./configure -prefix=/usr/local/

5. Build with make and Install using altinstall. It will get installed within /usr/local/bin directory

$ sudo make altinstall

6. Make a link for easy access

$ sudo ln -s /usr/local/bin/python3.6 /usr/bin/python3
(or if /usr/local/bin is already available in path)
$ sudo ln -s /usr/local/bin/python3.6…

--

--

GK

So Called : Engineer — Well knowns : Linux, Shell, Python, Django, ReactJs, React Native, Java, DevOps, Network & Infor. Security. First few steps: ML, DL, BC