1. 准备环境
yum install wget xz sqlite-devel zlib-devel bzip2-devel openssl-devel ncurses-devel readline-devel gcc-c++ gcc -y
2. 下载python 3代码包
wget https://www.python.org/ftp/python/3.6.3/Python-3.6.3.tar.xz
3. 解压,编译安装
tar xf Python-3.6.3.tar.xz -C /usr/local/src/
cd /usr/local/src/Python-3.6.3/
./configure --prefix=/usr/local/python3
make -j 8 && make install
4. 做软链
ln -s /usr/local/python3/bin/python3.6 /usr/local/bin/python3
ln -s /usr/local/python3/bin/pip3 /usr/local/bin/pip