二,解压并编译安装
1,解决依赖关系 yum -y install epel-release libffi-devel zlib* 2,解压编译 tar xf Python-3.7.0.tgz cd Python-3.7.0 ./configure --prefix=/usr/local/ && make && make install 3,替换原路径,修改yum配置文件 mv /usr/bin/python /usr/bin/python_old ln -s /usr/local/bin/python3.7 /usr/bin/python ln -s /usr/local/bin/python3.7 /usr/bin/python3 vim /usr/bin/yum
#!/usr/bin/python2 (首行修改为python2)
vim /usr/libexec/urlgrabber-ext-down
#!/usr/bin/python2 (首行修改为python2)
4,验证
python -V