> 本文作者:丁辉 # 安装Pip [Pip安装脚本](https://bootstrap.pypa.io/pip/) ## 脚本安装 1. 下载脚本 ```bash curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py ``` 2. 执行文件 ```bash python get-pip.py ``` ## 命令升级 - 使用 Python 升级 ```bash python3 -m pip install --upgrade pip ``` - 使用 Pip 升级 ```bash pip install --upgrade pip ``` ## 安装 Pip3 - Centos安装 ```bash yum install python3-pip -y ``` - Ubuntu安装 ```bash apt install python3-pip -y ``` ## 安装 Pip2 - Centos安装 ```bash yum install python2-pip -y ``` - Ubuntu安装 1. 启用 universe 源仓库 ```bash add-apt-repository universe ``` 2. 安装 Python2 ```bash apt install python2 -y ``` 3. 下载安装脚本 ```bash curl https://bootstrap.pypa.io/pip/2.7/get-pip.py --output get-pip.py ``` 4. 启用脚本 ```bash python2 get-pip.py ``` 5. 验证 ```bash pip2 --version ``` ## 安装 Pip - Centos安装 ```bash yum -y install epel-release ``` ```bash yum install python-pip ``` - Ubuntu安装 俺不知道嘿嘿嘿