#安装依赖
yum -y groupinstall development
yum -y install zlib-devel
#安装编译工具(也可以用yum或apt-get)
aptitude -y install gcc make zliblg-dev
下载安装包
点我https://www.python.org/ftp/python/查找自己想要的版本
#下载python安装包
wget https://www.python.org/ftp/python/3.6.0/Python-3.6.0.tar.xz
# 解压
tar xJf Python-3.6.0.tar.xz
cd Python-3.6.0
# 编译安装
./configure
make
make install
执行完输入
which python3
python3 -V
python3