准备步骤
yum -y install gcc zlib zlib-devel libffi libffi-devel bzip2-devel
yum -y install openssl-devel openssl11 openssl11-devel
yum -y install readline-devel
解压编译
wget https://www.python.org/ftp/python/3.11.3/Python-3.11.3.tgz
tar -zxvf Python-3.11.3.tgz
export CFLAGS=$(pkg-config --cflags openssl11)
export LDFLAGS=$(pkg-config --libs openssl11)
cd Python-3.11.3
./configure --prefix=/usr/local/python3 --with-ssl
make && make install
替换升级
cd /usr/bin/
unlink python3
ln -s /usr/local/python3/bin/python3 /usr/bin/python3
mv pip3 pip3-bak
ln -s /usr/local/python3/bin/pip3 /usr/bin/pip3
/usr/local/python3/bin/python3.11 -m pip install --upgrade pip
/usr/local/python3/bin/python3.11 -m pip install alibabacloud_bssopenapi20171214==2.0.10