How Do I Install Pip on Macos or OS X?

Better Stack Team
Updated on June 19, 2024

On macOS or OS X, pip is typically installed alongside Python. If you've installed Python using the official installer from python.org or via Homebrew, pip should already be available. Here's how you can check if pip is installed and install it if it's not:

Check if pip is Installed:

Open a terminal and run the following command:

 
pip --version

If pip is installed, this command will display the version number. If pip is not installed, you'll see a message indicating that the command is not found.

Install pip:

If pip is not installed, you can install it using the following steps:

  1. If you haven't already installed Python, you can download and install it from the official Python website (https://www.python.org/downloads/) or using Homebrew:

     
    brew install python
    
  2. Make sure that the directory containing Python is added to your system's PATH environment variable. This ensures that you can run Python and pip from the command line.

  3. Once Python is installed and configured, you can install pip by running the following command:

     
    python -m ensurepip
    

    This command will install pip along with Python if it's not already installed.

  4. After installation, you can verify that pip is installed by running pip --version as mentioned earlier.

That's it! Once pip is installed, you can use it to install Python packages and manage your Python environment on macOS or OS X.

Got an article suggestion? Let us know
Explore more
Licensed under CC-BY-NC-SA

This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.