Python之pip
发布于 2017-11-24 · 本文总共 550 字 · 阅读大约需要
2 分钟
Python有两个著名的包管理工具easy_install.py和pip。在Python2.7的安装包中,easy_install.py是默认安装的,而pip需要我们手动安装。 pip可以运行在Unix/Linux, OS X, and Windows平台上,支持CPython versions 2.6, 2.7, 3.1, 3.2, 3.3, 3.4 and also pypy
下载
pip的安装包get-pip.py,下载地址:https://pip.pypa.io/en/latest/installing.html#id7
安装
Windows
Linux
Ubuntu
sudo apt-get install python-pip
CentOS
sudo yum install python-pip
update
Linux
pip install -U pip
Windows
python -m pip install -U pip
用法
pip install SomePackage
可以使用==, >=, <=, >, <来指定一个版本号
requirement
pip install -r requirements.txt
upgrade
pip install --upgrade SomePackage
显示安装文件
pip show --files SomePackage