一、安装
(一)yum 安装
# 阿里云的yum源
yum -y install epel-release
yum repolist
# 执行安装
yum -y install python36
# 或执行安装
yum install -y python3 python3-devel
(二)检查环境
python3
yum repolist
(三)更改默认版本
1.系统自带2.7更改为3.x版本
whereis python
python: /usr/bin/python2.7 /usr/bin/python /usr/bin/python3.4 /usr/bin/python3.4m /usr/lib/python2.7 /usr/lib/python3.4 /usr/lib64/python2.7 /usr/lib64/python3.4 /etc/python /usr/include/python2.7 /usr/include/python3.4m /usr/share/man/man1/python.1.gz
cd /usr/bin/
rm /usr/bin/python
ln -s /usr/bin/python3.6 usr/python/python
2.安装Python2 和 Python3 的pip工具并更新到最新版本
[user@kubernetes ~]$ curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py && python3 get-pip.py && python get-pip.py
pip --version