centos7 安装 python3.9

1.yum安装组件

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

 2.下载并解压到文件夹

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

tar -xvf Python-3.9.0.tar.xz

3.配置编译

cd Python-3.9.0

./configure prefix=/usr/local/python3

make && make install

 4.配置软连接

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

 

你可能感兴趣的:(Python,python,linux,开发语言)