1、python 指向的是python2.7
2、python3 指向的python3.11
环境依赖准备
yum install zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel gcc make
3、安装python3
去官网下载编译安装包或者直接执行以下命令下载
wget https://mirrors.huaweicloud.com/python/3.11.0/Python-3.11.0.tar.xz
解压
tar -xvJf Python-3.11.0.tar.xz
切换进入
cd Python-3.11.0
编译安装
./configure prefix=/usr/local/python3
make && make install
4、建立软连接
ln -s /usr/local/python3/bin/python3 /usr/bin/python3