下载地址
https://www.python.org/ftp/python
建立目录
mkdir -p /usr/local/python3
解压
tar -zxvf Python-3.9.9
安装依赖包
yum -y install gcc
yum -y install zlib*
yum install readline-devel
配置
cd Python-3.9.9
./configure --prefix=/usr/local/python3
编译安装
make && make install
建立软链接
ln -s /usr/local/python3/bin/python3.9 /usr/bin/python3
ln -s /usr/local/python3/bin/pip3.9 /usr/bin/pip3
查看安装是否完成
python3 --version