Download Article
Simple tips to get the Python package manager up and running
Download Article
If you want to install packages from the Python Package Index on your Mac, you'll need Pip. Fortunately, if you installed Python 3.4, you should already have Pip—just run the command python3 -m pip --version to check. If you don't have Pip, there are a few different ways to install it. This wikiHow article will walk you through three simple ways to install Pip on a Mac desktop computer or MacBook.
Things You Should Know
- If you installed Python 3.4 or later, you should have Pip. If the pip command is not working, use pip3 instead.
- If Pip isn't installed, you can install it using the command python3 -m ensurepip --default-pip .
- If you didn't use Homebrew or another package manger to install Python, you can install Pip with the Get-Pip Python script.
Steps
Section 1 of 3:
Installing with Ensurepip
-
Open a Terminal window. If you haven't done so, you can open a Terminal from the Launchpad. The Ensurepip Python module is the most straightforward way to install Pip on both macOS and Linux.
-
Check to see if Pip is already installed. If you installed Python 3.9 or later from Python.org, by using Homebrew, or by installing the Xcode command line tools, you should already have Pip. To check, type python3 -m pip --version into your terminal and press Return . [1] X Research source
- If pip3 is not found, continue with this method to install it.
- If needed, you can update Pip to the latest version using the command python -m pip install --upgrade pip . [2] X Research source
Advertisement -
Type python3 -m ensurepip --default-pip and press ⏎ Return . If Pip was not installed, this command will install it to your current Python 3 installation. If Pip was installed, you'll see a message that says "Requirement already satisfied."
- If you only want to install Pip for the current user (not machine-wide), use the command python3 -m ensurepip --upgrade --user instead.
Advertisement
Section 2 of 3:
Installing with Homebrew
-
Open a Terminal window. If you installed Python 3.4 or later using Homebrew, you will already have Pip installed. If you don't have Python 3.4, you can install it easily with Homebrew, which will give you the latest version of Pip.
- If you want to upgrade the version of Pip you installed with Homebrew, use the command python3 -m pip install --upgrade pip . [3] X Research source
- To see which version of Pip is installed, use the command python3 -m pip --version .
-
Install Homebrew. If you haven’t already installed Homebrew, type /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" and press Return . [4] X Research source
-
Install Python3 and Pip. Installing Python also installs Pip. To install, type brew install python3 and press Return .
Advertisement
Section 3 of 3:
Installing with Get-Pip
-
Open a Terminal window. If you installed Python from source code but don't have Pip, you can use a simple script to install it.
- Don't use this method if you installed Python through Homebrew or another package manager, as the script will not interact with those tools. [5] X Research source
- You can check your current Pip version using the command python3 -m pip --version . Or, if you just want to update Pip, use the command python3 -m pip install --upgrade pip .
-
Download the script. You can use the curl command to do this. Just type curl -sSL https://bootstrap.pypa.io/get-pip.py -o get-pip.py and press Return to save the script to the current directory. [6] X Research source
-
Type python3 get-pip.py and press ⏎ Return . This runs the downloaded script, which will then install Pip, SetupTools, and Wheel for your current Python 3 environment.
Advertisement
Expert Q&A
Ask a Question
200 characters left
Include your email address to get a message when this question is answered.
Submit
Advertisement
Tips
Submit a Tip
All tip submissions are carefully reviewed before being published
Name
Please provide your name and last initial
Thanks for submitting a tip for review!
References
- ↑ https://packaging.python.org/en/latest/tutorials/installing-packages/
- ↑ https://pip.pypa.io/en/stable/installation/
- ↑ https://docs.brew.sh/Homebrew-and-Python
- ↑ https://brew.sh/
- ↑ https://packaging.python.org/en/latest/tutorials/installing-packages/#requirements-for-installing-packages
- ↑ https://github.com/pypa/get-pip
About This Article
Thanks to all authors for creating a page that has been read 14,872 times.
Advertisement