如何在 CentOS 上安装 Python 3

Installing Python 3 on CentOS 8

To install Python 3 on CentOS 8 run the following command as root or sudo user in your terminal:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
sudo dnf install python3 -y

#该命令还会安装 pip 。

#To verify the installation, check the Python version by typing:

python3 --version

pip3 --version


#Python 3 模块包的名称以“python3”为前缀。例如,要安装paramiko 模块,您将运行:

sudo dnf install python3-paramiko -y



# To be able to install and build Python modules with pip, you need to install the Development tools

sudo yum install python3-devel -y
sudo yum groupinstall 'development tools' -y
阅读更多

如何在 Ubuntu 上安装 Python 3

ubuntu安装python3的方法:

1
2
3
4
5
6
7
8
9
10
11
12
## remove old version 
apt-get remove --auto-remove

#1、安装python3 -y

apt-get install python3
#2、安装pip3

apt-get install python3-pip -y

# pip3 install docker-compose

阅读更多