#下载压缩包 百度
#解压下载的压缩包
tar -xvf Python-3.6.8.tgz
#安装一些依赖包
yum -y install zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel gdbm-devel db4-devel libpcap-devel xz-devel
#配置安装目录
./configure --prefix=/usr/python/
#编译安装
make
make install
#添加软连接
ln -s /usr/python/bin/pip3 /usr/bin/pip3
ln -s /usr/python/bin/python3 /usr/bin/python3
# 查看软连接
ls -l /usr/python/bin/ | grep python
#查看版本
python3 -V

实现效果

服务器安装Python3命令_python