编译工具

yum -y groupinstall "Development tools"
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
yum install -y libffi-devel zlib1g-dev
yum install zlib* -y

编译

mkdir -p  /usr/local/python3 
cd /root
wget https://www.python.org/ftp/python/3.9.1/Python-3.9.1.tgz
tar zxvf Python-3.9.1.tgz
cd Python-3.9.1
./configure --prefix=/usr/local/python3 --enable-optimizations --with-ssl 
make && make install

链接

ln -s /usr/local/python3/bin/python3 /usr/local/bin/python3
ln -s /usr/local/python3/bin/pip3 /usr/local/bin/pip3

验证

python3 -V
pip3 -V

发表评论

您的电子邮箱地址不会被公开。 必填项已用*标注

Captcha Code