1 更新系统
yum update
2. 安装Python3依赖项
yum install zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel libffi-devel gcc make
3. 下载python3.7
wget https://www.python.org/ftp/3.7.0/Python-3.7.0.tar.xz
4. 编译Python3.7
tar -xvJf Python-3.7.0.tar.xz #解压 cd Python-3.7.0 #进入目录 ./configure --prefix=/usr/local/python3.7.0 #配置编译 ./configure --enable-optimizations #启用优化 make && make altinstall #编译安装,保留之前安装的python版本
5. 在系统目录下添加软连接或者添加环境变量