# 安装依赖
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 libffi-devel
# 下载 Python 源码包
# 华为云下载地址
# https://mirrors.huaweicloud.com/python/
wget -c https://mirrors.huaweicloud.com/python/3.10.9/Python-3.10.9.tgz
# 配置
./configure --prefix=/usr/local/share/python3 --enable-optimizations
# 编译
make
make install
# 建立软连接
ln -s /usr/local/share/python3/bin/python3 /usr/bin/python3
ln -s /usr/local/share/python3/bin/pip3 /usr/bin/pip3
标签:bin,Python,share,devel,编译,usr,安装,python3
From: https://www.cnblogs.com/suuuch/p/17032620.html