1.1卸载python2

使用yum remove命令卸载失败(注意)

yum remove python2


应该使用rpm命令

rpm -e --nodeps python

1.2 安装python3

1.2.1 安装

yum install -y python3

1.2.2 验证

python3

1.3 创建链接,使用python直接调用python3

1.3.1 查看python命令地址

which python3


1.3.2 创建软连接

ln -s /usr/bin/python3.6 /usr/bin/python

1.3.3 查看结果

python


更多推荐

Python | Centos卸载python2并安装python3,并设置默认python为python3