1、下载安装包
下载地址: https://www.python.org/downloads/release/python-392/
2、下载Python3编译的依赖包
yum install -y gcc patch libffi-devel python-devel zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel gdbm-devel db4-devel libpcap-devel xz-devel
3、解压源码包
tar -zxvf Python-3.9.2.tgz
4、编译且安装
cd Python-3.9.2/
./configure --prefix=/usr/local/dev/python392 # 指定安装目录为/usr/local/dev/python392