Manually install Python3 on CentOS

First, install minimum necessary tools:

$ sudo yum install yum-utils

Then using yum-builddep, set up a necessary build environment for python3 and install missing dependencies. The following command will automatically take care of that.

$ sudo yum-builddep python
Then download it
curl -O https://www.python.org/ftp/python/3.5.2/Python-3.5.2.tgz
Then extract it and make install
$ tar xf Python-3.5.2.tgz
$ cd Python-3.5.2
$ ./configure
$ make
$ sudo make install
Finish!!
Check for python3 version
python3 –version
PS ***

If you want to use python3 as your default Python interpreter, you can define the following alias in your .bashrc.

alias python='usr/local/bin/python3.5'