1. Download and unzip
Download the installation package through the command wget
wget https://www.python.org/ftp/python/3.6.3/Python-3.6.3.tgz
2. Unzip
tar Python-3.6.3.tgz
3. Enter the decompressed directory and execute the installation configuration
./configure --prefix=/usr/python3
Install it to the /usr/python3 file
The python that comes with the system is installed in /usr/bin/python
4. Execute the compile command
make
5. Execute the installation command
make install
may report an error
Solution:
yum install zlib zlib-devel -y
Re-execute the third step
6. Check
python
7. Establish a soft connection
ln -s /usr/python3/bin/python3 /usr/bin/python3