If you use your Mac for programming, you may encounter problems if pip isn’t installed, as it’s required to work with apps that use the Python language. Although pip is usually installed automatically when you install Python, if programs aren’t working normally, it may be because you don’t have it downloaded on your computer, or because it’s not installed correctly.
So, how do you OS X install pip on your Mac? Read on to find it out.
Before we start:
Installing pip on your Mac isn’t the only way to ensure a smooth and trouble-free Mac experience. You can also improve the performance of your installed apps by downloading MacKeeper’s Smart Uninstaller. This tool can also help you get rid of memory-draining apps and remove browser extensions and leftover files.
How to use MacKeeper’s Smart Uninstaller on your device:
- Open MacKeeper on your Mac.
- Go to the Cleaning section and select Smart Uninstaller.
- Click Start Scan.
- Select the categories you want to clean, then click Remove Selected.
- Click Remove to confirm.
In this article you will find the following:
Now that you’ve got your Mac ready for new programs, our team of experts is here to help you get pip for Mac. Let’s continue.
What is pip on Mac
Pip, also known as pip3, stands for preferred installer program or pip installs packages. This package management system, as the name suggests, is used to install and manage software and libraries, particularly for Python apps. Usually, pip comes pre-installed with Python version 3.4 and later.
Additionally, the packages for pip can be found in the Python Package Index, or PyPI, which is the software repository for the Python programming language.
What to do before installing pip on macOS
To install pip on a Mac, you’ll need a running macOS system (take a look at the full list of macOS versions), Python installed on it, and a user account with admin privileges.
Before installing pip on macOS, you should:
1. View your Python version
To check the version of Python installed on your Mac:
- Go to Finder, then click Applications from the left-side bar.
- Open the Utilities folder and launch Terminal.
- Type the following command (!without the full stop): python --version.
- Press the Return key.
If you have Python installed, you’ll see the version there.
2. Check if pip is installed on your Mac
To verify if pip is already installed on your Mac:
- Go to Finder and select the Applications folder on your left.
- Double-click on the Utilities folder, then launch Terminal.
- Type the following command (!without the full stop): pip --version.
- Press the Return key.
If you get a positive result, it means pip is installed.
How to install pip on Mac
Once all the checks are complete, and if you’ve confirmed that pip is actually not installed on your computer, the next step is to download pip on Mac. You have several options at your fingertips to do this:
1. Via ensurepip
Although we believe it’s the best way to download pip on a Mac, we recommend that you check the following pros and cons before you decide on this method:
Pros | Cons |
Simple and straightforward method to install pip on Mac
You don’t need external commands
No need of an Internet connection either | Only available for Python 3.4. or later
|
If you end up choosing the ensurepip route to install pip on Mac, follow these steps:
- Open Finder on your Mac and select Applications.
- Open Utilities, then launch Terminal.
- Type the following command (!without the full stop): python -m ensurepip.
- Press the Return key.
2. Using Homebrew
Alternatively, you can opt for the Homebrew package manager, which also has its own advantages and disadvantages:
Pros | Cons |
Very popular and reliable package manager
Also used to install apps that don’t include their own installer
Supports other programming languages other than Python | Not as straightforward and quick as ensurepip
|
Do you like what Homebrew has to offer? First, you’ll need to install Homebrew on your Mac:
- Launch Finder and choose the Applications folder on your left.
- Launch the Utilities folders, then double-click on Terminal.
- Copy and paste the following command: /bin/bash -c “$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)”
- Press Return, and press Return again after a list of folders appears.
- If prompted, type in your admin password.
- You should see a message stating the installation’s been successful.
Now, it’s time to install pip:
- Go to Terminal again.
- Type the following command (!without the full stop): brew install python.
- Press Return.
- Once the installation is complete, type (!without the full stop): brew unlink python && brew link python.
- Press Return.
3. With get-pip.py
If none of the methods above are right for you, we suggest you trying a third option, get-pip.py, although you might want to check the pros and cons first as it’s not the most recommended method.
Pros | Cons |
Automatically downloads and installs the latest pip package for Python
Easy installation process | Only compatible with Python3 or later versions
A risky method as it uses an online script |
If you opt for this online script, follow these simple instructions:
- Launch Finder on your Apple computer.
- Select Applications from the left-side bar.
- Open the Utilities folder, find Terminal and launch it.
- Type the following command (!without the full stop): curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py.
- Press the Return key.
- Once the script has loaded, type this (!without the full stop): python3 get-pip.py.
- Press Return.
How to verify pip installation on MacBook
Verifying if the pip installation on your MacBook was done correctly goes like this:
- Launch Terminal by going to Finder > Applications > Utilities.
- Type this command (!without the full stop): python3 -m pip --version.
- Press Return.
Hint from our team:
If you encounter any issues when executing a command on your Mac, follow our team of experts’ advice on permissions denied in Zsh.
How to upgrade pip on Mac via Terminal
Follow these steps to update pip on macOS:
- Open Terminal by going to Finder > Applications > Utilities.
- Type this command (!without the full stop): python3 -m pip install --upgrade pip.
- Press Return.
How to remove any previous installation of pip (if necessary)
If you wish to remove Python from Mac, use another pip installation method or fix any error. Do the folliowing to uninstall pip:
- Launch Finder on your Mac or MacBook.
- Choose Applications from the left-side bar, then open the Utilities folder.
- Find Terminal in the Utilities folder and launch it.
- Type the following command (!without the full stop): pip uninstall pip.
- Press Return.
- Confirm by typing Y.
- Press Return.
Important:
Meanwhile, to gain even more valuable space on your MacBook, check our other relevant article to uninstall Anaconda from Mac if you have any issues with its performance.
Best way to install pip on macOS
Are you looking to use pip install on Mac? There are various methods to install pip on macOS, each with its own advantages and disadvantages. However, our team of experts recommends using ensurepip, as it’s a simple and easy method that doesn’t require an Internet connection and is compatible with many Python versions.
Regardless of the method you choose, you should always prepare your computer before downloading and installing a new program on Mac. You can use a tool like MacKeeper’s Smart Uninstaller to ensure that the installation process doesn’t impact negatively your Mac’s performance. Try this:
- Launch the MacKeeper app on your device.
- Choose the Smart Uninstaller tab under the Cleaning section on the left-side menu.
- Click the Start Scan button.
- Then, select the categories you want to do a smart cleaning and click Remove Selected.
- Wait until the scan is complete.
- Click Remove to confirm.