1.官网下载对应的安装包

wget https://www.python.org/ftp/python/3.7.5/Python-3.7.5.tgz

2.解压

tar -zvxf Python-3.7.5.tgz

cd Python-3.7.5

mkdir /usr/local/python3.7

3.然后编译安装

./configure --prefix=/usr/local/python37

make &&make install

4.建立python3的软连接

ln -s /usr/local/python37/bin/python3  /usr/bin/python

python -V

 

5.解决一下yum 不可用这个问题

vi /usr/bin/yum

把文件头部的

!/usr/bin/python 改成 !/usr/bin/python2.7



posted on 2019-11-07 18:42  冷枫孤雪  阅读(3937)  评论(0编辑  收藏  举报