Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I install pip on macOS or OS X?

I spent most of the day yesterday searching for a clear answer for installing pip (package manager for Python). I can't find a good solution.

How do I install it?

like image 802
The System Avatar asked Jun 24 '13 08:06

The System


People also ask

How do I know if pip is installed on my Mac?

Checking for pip on OS X The output of pip --version tells you which version of pip is currently installed, and which version of Python it's set up to install packages for. This is especially helpful if you have more than one version of Python installed on your system.

Is pip automatically installed on Mac?

Usually, pip is automatically installed if you are: working in a virtual environment. using Python downloaded from python.org. using Python that has not been modified by a redistributor to remove ensurepip.


1 Answers

pip's documentation lists the supported mechanisms to install it: https://pip.pypa.io/en/stable/installation/#supported-methods

It is generally recommended to avoid installing pip on the OS-provided python commands, and to install Python via the https://python.org 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 get-pip.py 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 
like image 141
Scott Tesler Avatar answered Oct 19 '22 12:10

Scott Tesler