centos 7安装python7

## 安装python依赖
sudo yum -y install epel-release
sudo yum -y update
sudo reboot
##
sudo yum -y groupinstall "Development Tools"
sudo yum -y install openssl-devel bzip2-devel libffi-devel xz-devel
gcc --version

## download python3.8
sudo yum -y install wget
wget https://www.python.org/ftp/python/3.8.12/Python-3.8.12.tgz
tar xvf Python-3.8.12.tgz
cd Python-3.8.12

## install python3.8
./configure --enable-optimizations
sudo make altinstall
python3.8 --version
pip3.8 --version

参考链接
https://computingforgeeks.com/how-to-install-python-3-on-centos/

你可能感兴趣的:(python,centos,linux,运维)