安装依赖包:
yum -y install gcc
安装其它依赖包:
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
下载依赖的包:
https://www.python.org/ftp/python/
解压:
tar -xvf Python-3.7.9.tar
创建空文件夹:
mkdir /usr/local/python3
执行配置文件,编译,编译安装
cd Python-3.7.0 ./configure --prefix=/usr/local/python3 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