centos编译安装python3
安装依赖
yum install zlib zlib-devel libffi-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel gcc make wget
下载安装包
wget https://www.python.org/ftp/python/3.9.6/Python-3.9.6.tar.xz
解压安装
xz -d Python-3.9.6.tar.xz
tar -xf Python-3.9.6.tar
cd Python-3.9.6
./configure prefix=/usr/local/python3
make && make install
创建系统连接
ln -s /usr/local/python3/bin/python3.9 /usr/bin/python3
ln -s /usr/local/python3/bin/pip3 /usr/bin/pip3