0%

在centos7安装python3环境

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
# wget源码
wget https://www.python.org/ftp/python/3.8.0/Python-3.8.0.tar.xz
# 解压tar.xz
tar -xvJf Python-3.8.0.tar.xz
# cd进入解压后的目录
cd Python-3.8.0
# 安装一些编译需要的依赖
yum -y groupinstall "Development Tools"
yum -y install zlib*
# 编译安装,prefix后跟的目录是你的安装目录
./configure prefix=/usr/local/python3
make && make install
# 设置软链接
rm /usr/bin/python3
ln -s /usr/local/python3/bin/python3.8 /usr/bin/python3
ln -s /usr/local/python3/bin/pip3 /usr/bin/pip3