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 

 

版权声明:
作者:鲤小牛
链接:https://www.yunweiba.com/174.html
来源:运维吧
文章版权归作者所有,未经允许请勿转载。

THE END
分享
二维码
< <上一篇
下一篇>>