How to Install PIP on a Mac
PIP is the package management tool for Python. If you want to use PIP on a Mac, you’ll need to install it. Here’s how.
PIP is the package management tool for Python libraries. If you’re using Python on your Mac to create applications, you’ll want to install PIP to easily install and use these libraries and software packages.
Assuming you’ve installed Python already, you may need to install or update PIP. There are a few ways to do this, depending on your level of risk.
If you want to install PIP on a Mac, follow the steps we’ve outlined below.
How to Install PIP on Mac Using Ensurepip (Python 3)
If you’re using Python 3.4 or later, you can use the ensurepip command. This is the official method for installing PIP on Mac, providing a secure method to install the application (if required).
To install PIP on Mac using ensurepip, follow these steps.
- Open the Mac Terminal app via the Launchpad.
- In the Terminal, type python -m ensurepip or python3 -m ensurepip and press Enter.
- If PIP is missing, ensurepip will install PIP. Follow any additional on-screen instructions to complete this process.
- If you want to upgrade PIP, type python -m ensurepip –upgrade or python3 -m ensurepip –upgrade instead.
How to Use the PIP Installation Script on Mac (Python 3)
An alternative method for installing PIP on Mac is to use the PIP installation script (get-pip.py). This is only available for Python 3 users.
Note: This script is safe to use, but we’d always advise caution about allowing an online script to run on your Mac. You should only use this PIP installation script if you’re aware of the risks and you’re happy to proceed. Otherwise, use one of the other methods instead.
To use the get-pip script to install PIP on Mac, follow these steps.
- Open the Terminal app via the Launchpad.
- In the Terminal, type curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py and press Enter.
- Allow curl time to download the script onto your Mac.
- Once it’s done, type python3 get-pip.py and press Enter.
- Allow time for the installation to complete.
How to Use Homebrew to Install PIP on Mac
If you want an easier way to install PIP on Mac, you can use Homebrew to do it. Homebrew is a third-party, open-source package manager for your Mac. It allows you to quickly install apps via the Terminal app—including PIP.
To use Homebrew to install PIP on a Mac, follow these steps.
- Open the Terminal app via the Launchpad menu.
- In the Terminal window, type brew install python and press Enter.
- Homebrew will install the latest version of Python (including PIP). Allow time for it to complete.
- To finalize your PIP installation, type brew unlink python && brew link python and press Enter.
How to Check Your PIP Version on a Mac
Have you recently updated your Python installation and want to check that your version of PIP is up to date? Thankfully, you can quickly check your version of PIP using the Terminal app.
You can also run this command to check that PIP is installed correctly on your Mac. To check your PIP version on a Mac, follow these steps.
- Open the Terminal app.
- In the Terminal, type pip –version and press Enter.
- Alternatively, type python3 -m pip –version and press Enter.
How to Update PIP on a Mac
macOS comes with an outdated version of Python. If you’ve updated a newer version, you may have an older version of PIP. You may also need to upgrade PIP if you update your version of Python later.
To update PIP on a Mac, follow the steps below.
- Open the Terminal app.
- In the Terminal, type python3 -m pip install –upgrade pip and press Enter.
- Wait for the command to complete. If the latest version is installed, PIP will return a requirement already satisfied message.
- To check if the update was successful, type pip –version and press Enter.
- If the PIP version hasn’t changed, repeat the steps above.
Using Python on macOS
If you’ve followed the steps above correctly, you should be able to quickly install PIP on a Mac. You can then use it to install outside packages and Python libraries from the official PyPI repository.
Using Python in the macOS Terminal app? You might want to try out these useful Mac Terminal commands next.
Nick Bailey
June 24, 2022 at 3:00 am
When copying the version command from this website it copies the wrong type of dash leading to the version command not being recognised like so:
ERROR: unknown command “–-version”
Now only the highly trained eye might detect the difference in those two dashes, but can I suggest you mono-type the commands in this otherwise helpful document so that copy-and-pasters like myself don’t run into this in the future?
Harry
December 13, 2022 at 6:28 pm
Thank you – I needed that as my glasses were fogging up with the frustration!
Nick Bailey
December 16, 2022 at 3:36 am
My pleasure Harry, so pleased I could be of some small help. Happy Christmas!
William
February 15, 2023 at 9:15 pm
very useful nice