全部操作都在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 \
libpcap-devel \
xz-devel
yum install libffi-devel -y
下载安装包并解压
cd
wget https://www.python.org/ftp/python/3.7.4/Python-3.7.4.tar.xz
tar -xvJf Python-3.7.4.tar.xz
编译安装
mkdir /usr/local/python3
cd Python-3.7.4
./configure --prefix