参考文档: https://www.linuxidc.com/Linux/2018-05/152390.htm
本文只讲重点!
# 1. 安装Pip
我们将使用apt包管理器为 Python 2 pip 和 Python 3 pip3 安装 pip.
任何时候,要安装先 Update:
sudo apt update
- PIP For Python 2.x:
sudo apt install python-pip
验证下? pip --version
- PIP For Python 3.x:
sudo apt install python3-pip
# 2. 安装开发工具
For Python 2.x:
sudo apt install build-essential python-dev python-setuptools
For Python 3.x:
sudo apt install build-essential python3-dev python3-setuptools
# 3. Pip用法
- 安装卸载名为 foobar 的包:
pip install foobar
pip uninstall foobar
- 从PyPI搜索软件包:
pip search "search_query"
- 列出已安装的软件包:
pip list
- 要列出过期的软件包:
$pip list --outdated