1.安装相应的编译工具
在root用户下(不要用普通用户,麻烦),全部复制粘贴过去,一次性安装即可.
yum -y groupinstall "Development tools"
yum -y install zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel gdbm-devel db4-devel libpcap-devel xz-devel
yum install -y libffi-devel zlib1g-dev
yum install zlib* -y
2.下载安装包
wget https://www.python.org/ftp/python/3.7.2/Python-3.7.2.tar.xz
注意:现在版本出到3.9了