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,
- A machine with Centos 7.x installed be it either Vagrant or Virtual machine or physical laptop/desktop
- A working internet connection with wget installed or Python 3.6.x tarball downloaded from here.
- sudo permission
Lets begin,
Method 1: From source tar ball
- 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…