Quickstart

First, install pip.

Install a package from PyPI:

Unix/macOS

  1. $ python -m pip install SomePackage
  2. [...]
  3. Successfully installed SomePackage

Windows

  1. C:\> py -m pip install SomePackage
  2. [...]
  3. Successfully installed SomePackage

Install a package that’s already been downloaded from PyPI or obtained from elsewhere. This is useful if the target machine does not have a network connection:

Unix/macOS

  1. $ python -m pip install SomePackage-1.0-py2.py3-none-any.whl
  2. [...]
  3. Successfully installed SomePackage

Windows

  1. C:\> py -m pip install SomePackage-1.0-py2.py3-none-any.whl
  2. [...]
  3. Successfully installed SomePackage

Show what files were installed:

Unix/macOS

  1. $ python -m pip show --files SomePackage
  2. Name: SomePackage
  3. Version: 1.0
  4. Location: /my/env/lib/pythonx.x/site-packages
  5. Files:
  6. ../somepackage/__init__.py
  7. [...]

Windows

  1. C:\> py -m pip show --files SomePackage
  2. Name: SomePackage
  3. Version: 1.0
  4. Location: /my/env/lib/pythonx.x/site-packages
  5. Files:
  6. ../somepackage/__init__.py
  7. [...]

List what packages are outdated:

Unix/macOS

  1. $ python -m pip list --outdated
  2. SomePackage (Current: 1.0 Latest: 2.0)

Windows

  1. C:\> py -m pip list --outdated
  2. SomePackage (Current: 1.0 Latest: 2.0)

Upgrade a package:

Unix/macOS

  1. $ python -m pip install --upgrade SomePackage
  2. [...]
  3. Found existing installation: SomePackage 1.0
  4. Uninstalling SomePackage:
  5. Successfully uninstalled SomePackage
  6. Running setup.py install for SomePackage
  7. Successfully installed SomePackage

Windows

  1. C:\> py -m pip install --upgrade SomePackage
  2. [...]
  3. Found existing installation: SomePackage 1.0
  4. Uninstalling SomePackage:
  5. Successfully uninstalled SomePackage
  6. Running setup.py install for SomePackage
  7. Successfully installed SomePackage

Uninstall a package:

Unix/macOS

  1. $ python -m pip uninstall SomePackage
  2. Uninstalling SomePackage:
  3. /my/env/lib/pythonx.x/site-packages/somepackage
  4. Proceed (y/n)? y
  5. Successfully uninstalled SomePackage

Windows

  1. C:\> py -m pip uninstall SomePackage
  2. Uninstalling SomePackage:
  3. /my/env/lib/pythonx.x/site-packages/somepackage
  4. Proceed (y/n)? y
  5. Successfully uninstalled SomePackage

Important

Did this article help?

We are currently doing research to improve pip’s documentation and would love your feedback. Please email us &body=%0A%20%20%20%200.%20Document:%20quickstart.%20Page%20URL:%20https:/%20%0A%0A%20%20%20%201.%20What%20problem%20were%20you%20trying%20to%20solve%20when%20you%20came%20to%20this%20page?%20%0A%0A%20%20%20%202.%20What%20content%20was%20useful?%20%0A%0A%20%20%20%203.%20What%20content%20was%20not%20useful?) and let us know:

  1. What problem were you trying to solve when you came to this page?

  2. What content was useful?

  3. What content was not useful?