目 录CONTENT

文章目录

centos7.6 安装 python3和pip3(最简单)

小吴
2023-01-25 / 0 评论 / 0 点赞 / 20 阅读 / 178 字

1233
安装插件

yum -y groupinstall "Development tools"

预装的依赖

yum -y install zlib zlib-devel
yum -y install bzip2 bzip2-devel
yum -y install ncurses ncurses-devel
yum -y install readline readline-devel
yum -y install openssl openssl-devel
yum -y install openssl-static
yum -y install xz lzma xz-devel
yum -y install sqlite sqlite-devel
yum -y install gdbm gdbm-devel
yum -y install tk tk-devel
yum -y install libffi libffi-devel

下载python包

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

解压安装包

tar -xvf Python-3.8.6.tar.xz

安装python3

cd Python-3.8.6
./configure --prefix=/usr/soft/python3
make && make install

创建软链接

ln -s /usr/soft/python3/bin/python3.8 /usr/bin/python3
ln -s /usr/soft/python3/bin/pip3 /usr/bin/pip3

升级pip

 pip3 install --upgrade pip

查看是否安装成功

python3 -V
pip3 list
0

评论区