一.安裝所需包
yum -y install sqlite-devel xz gcc automake zlib-devel openssl-devel epel-releasepython
二.下載python3.6.9
https://www.python.org/ftp/python/3.6.9/
wget https://www.python.org/ftp/python/3.6.9/Python-3.6.9.tgz
tar zxvf Python-3.6.9.tgz
cd Python-3.6.9
./configure
make && make installsql
三.配置
cp /usr/local/bin/python3 /usr/bin/python3python2.7
rm -f /usr/bin/python
rm -f /usr/bin/python2ide
ln -s /usr/bin/python3 /usr/bin/python
ln -s /usr/bin/python3 /usr/bin/python2url
python -V 檢查版本sqlite
四.修改yum配置,保證yum能用
修改usr/libexec/urlgrabber-ext-down和/usr/bin/yum兩個文件
將 #!/usr/bin/python 改成 #!/usr/bin/python2.7後保存退出便可
由於python3和yum的版本不兼容,因此要改爲2.7,要否則須要升級yumssl