安装依赖包
yum -y groupinstall development
yum install -y libffi-devel zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel libffi-devel
下载tgz包并解压
tar xf Python-3.x.x.tgz
进入解压后文件夹
cd Python-3.x.x
配置安装路径并安装
./configure --prefix=/usr/local/python3
make && make install
添加环境变量
cd /etc/profile.d
echo ‘export PATH=$PATH:/usr/local/python3/bin/‘ > python3.sh