首先需要安装依赖
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 libffi-devel
然后去官网下载python包:https://www.python.org/
python3.7.3 : https://www.python.org/downloads/release/python-373/
tar -xvf Python-3.7.3.tgz
cd python-3.7.3
./configure --prefix=/usr/local/python3 --with-ssl
make && make install
#建立软连接
ln -s /usr/local/python3/bin/python3.7 /usr/bin/python3
ln -s /usr/local/python3/bin/pip3.7 /usr/bin/pip3
#然后验证下python
python3