If you’ve recently installed Python on your Mac or just started working with Python, you may want to install pip so you can use Python to install and manage software packages. We’ll show you the steps for pip install on Mac.

What is pip?

pip — or pip3, as it’s also known — is a package management system for Python that is used to install and manage software packages. It’s the tool recommended by the Python Software Foundation for installing Python applications. It connects to an online repository of public packages called Python Package Index. pip is installed by default with Python 3.4 and later. However, if you’re running an earlier version of Python or it wasn’t installed when you installed Python, you can follow the steps below to install it.

Did you know?

pip is a recursive acronym, meaning that it refers to itself and stands for ‘pip installs packages.’

Before you install pip

Before you start, it’s worth checking which version of Python is running on your Mac. To do that, follow these steps:

  1. Go to Applications > Utilities and open Terminal.
  2. Type: python --version
  3. Press Return.
  4. If Python is installed, you will see a message telling you the version.
  5. If it’s not installed, you will see command not found: python

If Python is not installed on your Mac, you can install it by following the steps in this guide. Then come back here and install pip.

Tip

When you install software on your Mac using pip or Homebrew, it can be difficult to keep track of exactly what you’re installing, where it comes from, and what permissions you’ve given it in terms of accessing folders on your Mac and camera or microphone. That makes it very important to check which apps have permission to do what. The easiest way to do that is to use the Privacy tool in CleanMyMac. It lists all the permissions available on your Mac and makes it easy to see what applications are allowed for each one. You can then keep or revoke those permissions as you see fit. The Privacy module also allows you to manage browser data like your history, downloads history, cache files, and cookies in Safari, Chrome, and Firefox. And you can delete them all with a click. And if that’s not enough, you can also use it to clear out your Recent Items Lists in the Finder and remove all the Wi-Fi networks your Mac has saved. You can download CleanMyMac for free here and try it for yourself.

CleanMyMac - Application permissions

Install pip on Mac using Ensurepip

This is the best method for installing pip, but it only works on Python 3.4 or later. Here are the steps:

  1. Open Terminal from Applications > Utilities.
  2. Type: python -m ensurepip or python3 -m ensurepip
  3. Press Return.
  4. If pip isn’t already installed, Ensurepip will install it.
  5. If you want to upgrade pip instead of installing it from scratch, add upgrade to the end of the command in step 2.

Use Homebrew to install pip

Another way to install pip on your Mac is to use the Homebrew package manager. Homebrew is a popular package manager that is used to install software that doesn’t come with its own installer, such as Git and the StableDiffusion AI image tool.

Before using Homebrew to install pip, you’ll need to install Homebrew if it’s not already installed on your Mac.

  1. Open Terminal.
  2. Paste this command: /bin/bash -c “$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)”
  3. Press Return
  4. You will see a list of folders that will be installed.
  5. Press Return.
  6. Type in your admin password if you’re asked.
  7. Wait until you see the message ‘Installation successful.’

Now, you can use Homebrew to install pip:

  1. In Terminal, type: brew install python
  2. Press Return.
  3. Wait for it to install.
  4. Type: brew unlink python && brew link python
  5. Press Return.

How to update pip in Terminal

If you have an earlier version of pip installed, you can update it in Terminal. Here’s how:

  1. In Terminal, type: python3 -m pip install –upgrade pip
  2. Press Return
  3. If the latest version is already installed, you will see a message saying, ‘requirement already satisfied.’
  4. If it’s not, you will see the version of pip that was just installed.

pip is a package management system for Python, and if you’ve installed Python on your Mac, you probably already have pip. However, if not, it’s very easy to install, as long as you’re comfortable with Terminal — using either Ensurepip or Homebrew. And once you have downloaded and installed it, you can start downloading Python software packages.