1. First install the environment
yum install xz
yum -y install zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel gdbm-devel db4-devel libpcap-devel xz-devel
2. Download https: //www.python.org/ftp/python/3.6.0/Python-3.6.5.tar.xz
and upload it to the linux system
Unzip : tar xvf Python-3.6.5.tar.xz
Enter the python directory, cd Python -3.6.5
3. Execute the command:
./configure --prefix=/usr/local/python3 Be sure to specify the installation directory
make
make install
4. Create a soft link for python3
ln -s /usr/local/python3/bin/python3 /usr/bin/python3
ln -s /usr/local/python3/bin/pip3 /usr/bin/pip3
enter python3 test