1.安装依赖包
yum -y install zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel gdbm-devel xz-devel libffi-devel
2.下载python压缩包
wget https://www.python.org/ftp/python/3.8.0/Python-3.8.0.tgz
3.解压python压缩包
tar -zxvf Python-3.8.0.tgz
4.配置编译安装
cd Python-3.8.0
./configure --prefix=/usr/local/python3
make && make install
5.建立软连接
ln -s /usr/local/python3/bin/python3.8 /usr/bin/python3
ln -s /usr/local/python3/bin/pip3.8 /usr/bin/pip3
6.查看版本
python3 -V