How do I install pip on macOS or OS X?

pip’s documentation lists the supported mechanisms to install it:

It is generally recommended to avoid installing pip on the OS-provided python commands, and to install Python via the installers or using something like Homebrew or pyenv.

Python 3.4+ will have ensurepip, so if you’re unable to run python3 -m pip — run python3 -m ensurepip and it’ll install pip for you.

If you’re using an end-of-life version of Python, you can use instead.

Old answer (outdated, and results in a broken installation)

easy_install pip

If you need admin privileges to run this, try:

sudo easy_install pip

Leave a Comment