python3.8.3安装

安装依赖

  • 安装其它依赖包
1
2
3
4
yum -y groupinstall "Development tools"
yum -y install zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel gdbm-devel db4-devel libpcap-devel xz-devel
yum install -y libffi-devel zlib1g-dev
yum install zlib* -y
  • 下载安装包
1
wget https://www.python.org/ftp/python/3.8.5/Python-3.8.5.tar.xz

安装python3.8.3

  • 创建安装目录,例:
1
2
3
# mkdir /usr/local/python3

注:安装路径可变
  • 解压下载的安装包
1
2
3
# tar zxvf /Python-3.7.3.tgz .

注: 解压路径可自行指定
  • 进入解压后的目录,编译安装
1
2
3
4
# cd Python-3.8.3
# ./configure --prefix=/usr/local/python3
...
# make && make altinstall

建立软链接

1
2
# ln -s /usr/local/python3/bin/python3 /usr/bin/python3
# ln -s /usr/local/python3/bin/pip3 /usr/bin/pip3

测试

1
2
3
# python3

# pip3
-------------本文结束感谢您的阅读-------------