centos7 默认安装 python2.7
1.先安装python36和对应pip
yum install python-pip #安装python2的pip yum install python36 yum install python36-pip
2.修改软链接
(1)软链接由python2变成python3
ln -snf python3 python
(2)pip默认成python3的
mv pip pip.bak ln -snf pip3 pip
3.修改#!文件
yum和urlgrabber-ext-down 需要依赖Python2
vim /usr/bin/yum vim /usr/libexec/urlgrabber-ext-down
都改成 #! /usr/bin/python2.7
手动安装的软件一般在此目录下
/usr/local
原文:https://www.cnblogs.com/buchizaodian/p/11180278.html