#确认是否存在gcc环境,没有则安装,之后编译python需要使用
gcc -v
yum -y install gcc-c++
#安装zlib,否则can't decompress data; zlib not available
um install zlib*
#下载安装包
wget https://www.python.org/ftp/python/3.8.3/Python-3.8.3.tgz
cd /usr/bin/
#在/usr/bin/下解压安装包
tar -zxvf Python-3.8.3.tgz
mv Python-3.8.3 python3.8
cd python3.8
./configure prefix=/usr/bin/python3.8
make && make install
#创建软连接
rm -rf /usr/bin/python
ln -s /usr/bin/python3.8/bin/python3 /usr/bin/python
rm -rf /usr/bin/pip
ln -s /usr/bin/python3.8/bin/pip3 /usr/bin/pip
#更新依赖
vim /usr/bin/yum
vim /usr/libexec/urlgrabber-ext-down
vim /usr/bin/yum
vim /usr/bin/yum-config-manager
#验证
python --version
pip --version
标签:bin,python,虚拟机,vim,3.8,usr,python3.8
From: https://www.cnblogs.com/jinit/p/17003374.html