清风客栈 - 妖孽同学博客
centos7 安装python3
2022-05-14

1.准备安装环境

yum -y install zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel libffi-devel gcc make

2.下载源码并编译安装

wget  https://www.python.org/ftp/python/3.10.4/Python-3.10.4.tgz
tar -zxvf Python-3.10.4.tgz
cd  Python-3.10.4
./configure --prefix=/usr/local/python3 
make && make install
//添加软件链接
ln -s /usr/local/python3/bin/python3 /usr/bin/python3
ln -s /usr/local/python3/bin/pip3 /usr/bin/pip3
//查看安装是否成功
python3 --version

本文名称:centos7 安装python3
版权声明:清风客栈发布