(B) centos install python3
You can refer to https://blog.csdn.net/u010510962/article/details/80690084
Use root to facilitate later operations su
Install some dependency packages of python3.6
yum install opensll-devel bzip2-devel expat-devel gdbm-devel readline-devel sqlit-devel
Install wget
yum install wget
Download python3.6 to compile and install (to check whether the network is available at this time)
wget https://www.python.org/ftp/python/3.6.0/Python-3.6.0.tgz
Unzip-C, the file storage path after decompression
tar -xzvf Python-3.6.0.tgz -C/usr/local
Enter the file just unzipped
cd /usr/local
Install gcc first
yum install gcc
Compile if compile error error1, missing zlib dependency package yum install zlib * -y
./configure prefix=/usr/local/python3
make && make install
Configure soft links
mv /usr/bin/python /usr/bin/python2.7 //自带python版本
ln -s /usr/local/python3/bin/python3.6.0 /usr/bin/python
ln -s /usr/local/bin/python3.6 /usr/bin/python3
Change the following two files
vi /usr/bin/yum
vi /usr/libexec/urlgrabber-ext-down
ESC: save and exit with wq
Check it, you can use