1.1 安装系统依赖包
sudo dnf install wget yum-utils make gcc openssl-devel bzip2-devel libffi-devel zlib-devel -y
1.2 下载Python
wget https://www.python.org/ftp/python/3.7.8/Python-3.7.8.tgz
1.3 解压
tar xzf Python-3.7.8.tgz
1.4 安装
cd Python-3.7.8
sudo ./configure --enable-optimizations --prefix=/usr/local/python3.8
sudo make install
1.5 配置python环境变量
# 让系统识别python3.7 修改~/.bash_profile
PATH=/opt/python3.7/bin
. ~/.bash_profile