1. Install some of the dependencies I have encountered (if there are dependencies on the prompts to install):
Yum install xz gcc zlib zlib-devel
2. Download the source package on official website
Address: Https://www.python.org/ftp/python/3.6.1/Python-3.6.1.tar.xz
3. Extracting files
Xz-d PYTHON-3.6.1.TAR.XZ
TAR-XVF Python-3.6.1.tar
4. Go to the file directory
CD Python-3.6.1
5. Start the installation compilation
./configure--prefix=/usr/python3.6 Make do install
6. Let the CENTOS7 system use python3.6 by default
CD/USR/BIN/MV python python.bakln-s/usr/python3.6/bin/python3/usr/bin/python
7. Since Yum is using Python2, replacing python3 may result in a failure to work properly, Continue to use this python2.7.5 because Yum uses python2, so replacing it with Python3 may not work, continue using this python2.7.5
Therefore, the Yum configuration file (Vim/usr/bin/yum) is modified. Change the #!/usr/bin/python of the file head to #!/usr/bin/python2.7 save exit
CentOS 7.3 Installation Configuration python3.6.1