yum install wget gcc make zlib-devel readline-devel
wget https://www.python.org/ftp/python/3.6.5/Python-3.6.5.tar.xz
xz -d Python-3.6.1.tar.xz
tar -xvf Python-3.6.1.tar
cd Python-3.6.1
./configure --prefix=/usr/local/python3.6 --enable-optimizations
make
make install
/usr/local/python3.6/bin/python3 --version
ln -s /usr/local/python3.6/bin/python3 /usr/bin/python3
参考:https://segmentfault.com/a/1190000009922582