准备依赖环境
yum -y install zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel gcc make libffi-devel expat-devel expat-devel gdbm-devel
1、下载
wget https://www.python.org/ftp/python/3.7.6/Python-3.7.6.tgz
2、解压
tar -zxvf Python-3.7.6.tgz
3、建空文件夹
mkdir /usr/local/python3
4、执行配置文件,编译,编译安装
cd Python-3.7.6
./configure --prefix=/usr/local/python3
make && make install
5、建立软链接
ln -s /usr/local/python3/bin/python3.7 /usr/bin/python3
ln -s /usr/local/python3/bin/pip3.7 /usr/bin/pip3