升级依赖
sudo yum -y install openssl-devel bzip2-devel expat-devel gdbm-devel readline-devel sqlite-devel
下载python3.6.1编译安装
wget https://www.python.org/ftp/python/3.6.1/Python-3.6.1.tgz
tar -xzvf Python-3.6.1.tgz
cd Python-3.6.1
./configure --prefix=/usr/local
make
sudo make altinstall
python3.6程序的执行文件:/usr/local/bin/python3.6
python3.6应用程序目录:/usr/local/lib/python3.6
pip3的执行文件:/usr/local/bin/pip3.6
pyenv3的执行文件:/usr/local/bin/pyenv-3.6
更改/usr/bin/python链接
cd /usr/bin
sudo mv python python.backup
sudo ln -s /usr/local/bin/python3.6 /usr/bin/python
sudo ln -s /usr/local/bin/python3.6 /usr/bin/python3
sudo ln -s /usr/local/bin/pip3.6 /usr/bin/pip
sudo rm /usr/bin/python2
sudo rm /usr/local/bin/python
将/usr/local/bin加入PATH目录
更改yum脚本的python依赖
cd /usr/bin
ls yum*
依次将文件头部进行修改
#!/usr/bin/python 改为 #!/usr/bin/python2.6
修改gnome-tweak-tool配置文件
#vi /usr/bin/gnome-tweak-tool
#!/usr/bin/python改为#!/usr/bin/python2.6
修改urlgrabber配置文件
# vi /usr/libexec/urlgrabber-ext-down
#!/usr/bin/python改为#!/usr/bin/python2.6