Centos8(最小化安装)全新安装Python3.8+pip的方法教程

时间:2022-04-30 03:40:14

最小化安装Python8后安装Python3.8.1,网上找了一圈教程,没有一个能完全成功的。或者能安装成功,但pip无法使用。最后根据多个教程整理了一份命令,测试成功,安装使用完全没有问题。

?
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
yum -y install wget
yum -y install setup
yum -y install perl
yum install openssl-devel -y
yum install zlib-devel -y
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
yum install libffi-devel -y
wget https://www.python.org/ftp/python/3.8.1/Python-3.8.1.tar.xz
tar -xvJf Python-3.8.1.tar.xz
mkdir /usr/local/python3
cd Python-3.8.1
./configure --prefix=/usr/local/python3 --enable-optimizations --with-ssl
make && make install
ln -s /usr/local/python3/bin/python3 /usr/local/bin/python3
ln -s /usr/local/python3/bin/pip3 /usr/local/bin/pip3
pip3 install --upgrade pip

 今天看了一下宝塔的安装程序,发现用下面一行命令就可以快速安装Python3.6

?
1
2
yum install python3 python3-devel -y
ln -sf /usr/bin/python3 /usr/bin/python

安装完用下面的命令升级PIP就可以正常使用了。

pip3 install --upgrade pip

总结

以上所述是小编给大家介绍的Centos8(最小化安装)全新安装Python3.8+pip的方法教程,希望对大家有所帮助!

原文链接:https://blog.csdn.net/mayans005/article/details/104159929