yum install zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel gcc make
tar -zvxf Python-3.6.4.tgz
mv Python-3.6.4 python-3.6.4 #修改文件名
cd python-3.6.4
# 手动编译
./configure prefix=/usr/local/python3
make && make all
#添加python3的软链接
ln -s /usr/local/python3/bin/python3.6 /usr/bin/python3
#测试是否安装成功了
python3 -V
python3 -m venv ../venv/python # 创建名为python虚拟环境 版本python3
# 进入虚拟环境
source ../venv/python/bin/activate
# 退出虚拟环境
deactivate