1、安装依赖包
#yum install -y openssl openssl-devel openssl-static
#yum groupinstall -y "Development tools"
若未安装该静态库会导致python3自带的pip3安装失败
2、下载源码包
#wget https://www.python.org/ftp/python/3.6.0/Python-3.6.0.tar.xz
#tar xvf Python-3.6.0.tar.xz
3、编译安装
#cd Python-3.6.0
#./configure
#make
#make install
4、设置PATH
#vim /etc/profile
export PATH=$PATH:/usr/local/bin
#source /etc/profile
5、验证
#python3 -V