centOS 默认是已经装了 python2 的版本
本节介绍 CentOS7使用Yum源安装Python3.6
IUS软件源中包含了Python3.6,可以使用IUS软件源安装Python3.6
- 安装IUS软件源
#安装EPEL依赖
sudo yum install epel-release
#安装IUS软件源
sudo yum install https://centos7.iuscommunity.org/ius-release.rpm
- 安装Python3.6
sudo yum install python36u
//安装Python3完成后的shell命令为python3.6,为了使用方便,创建一个到python3的符号链接
sudo ln -s /bin/python3.6 /bin/python3
- 安装pip3
sudo yum install python36u-pip
//安装pip完成后的shell命令为pip3.6,为了使用方便,创建一个到pip3的符号链接
sudo ln -s /bin/pip3.6 /bin/pip3
- 检查版本
python -V
python3 -V
pip3 -V
参考文章 https://www.yuzhi100.com/tutorial/centos/centos-anzhuang-python36
网友评论