1.安装依赖包
# yum -y install gcc gcc-c++ zlib-devel openssl-devel readline-devel \
libffi-devel sqlite-devel tcl-devel tk-devel
2.编译安装
# tar -xf Python-3.6.7.tgz
# cd Python-3.6.7/
# ./configure --prefix=/usr/local
# make && make install
3.配置python支持终端tab补齐
# cat >/usr/local/bin/tab.py<<EOF
from rlcompleter import readline
readline.parse_and_bind('tab:complete')
EOF
# source /root/.bashrc
ps:原有python2版本需要保留,不可覆盖或删除!!!