Python 包安装和管理工具:pip

jopen 11年前

pip 是安装和管理 Python 包的工具。

快速入门

安装一个包:

$ pip install SomePackage==1.0    [...]    Successfully installed SomePackage

显示安装了哪些文件:

$ pip show --files SomePackage    Name: SomePackage    Version: 1.0    Location: /my/env/lib/pythonx.x/site-packages    Files:     ../somepackage/__init__.py     [...]

List what packages are outdated:

$ pip list --outdated    SomePackage (Current: 1.0 Latest: 2.0)

升级一个包:

$ pip install --upgrade SomePackage    [...]    Found existing installation: SomePackage 1.0    Uninstalling SomePackage:      Successfully uninstalled SomePackage    Running setup.py install for SomePackage    Successfully installed SomePackage

卸载一个包:

$ pip uninstall SomePackage    Uninstalling SomePackage:      /my/env/lib/pythonx.x/site-packages/somepackage    Proceed (y/n)? y    Successfully uninstalled SomePackage

项目主页:http://www.open-open.com/lib/view/home/1388916539500