CentOS7安装python3.9 极其简单!!!

一、配置源以及解决依赖关系

yum -y install zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel gcc make
yum -y install epel-release
yum -y install python-pip

 二、下载

wget https://www.python.org/ftp/python/3.9.0/Python-3.9.0.tar.xz

 三、解包

tar -xvf Python-3.9.0.tar.xz

四、编译安装

cd Python-3.9.0
./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.9 /usr/bin/pip3

你可能感兴趣的:(linux,服务器,python)