1.安装依赖
yum -y install zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel gcc make libffi-devel
2.下载软件包
wget https://www.python.org/ftp/python/3.6.8/Python-3.9.7.tar.xz 下载列表:https://www.python.org/ftp/python/
3.编译安装
xz -d Python-3.9.7.tar.xz tar -xf Python-3.9.7.tar cd Python-3.9.7 ./configure --prefix=/usr/local/python3.9 make && make install
4.配置PATH及验证
vim ~/.bash_profile PATH=/usr/local/python3.9/bin:$PATH:$HOME/bin . ~/.bash_profile env python3
标签:tar,Python,devel,centos7,编译,PATH,python,python3,3.9 From: https://www.cnblogs.com/panwenbin-logs/p/17137542.html