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.

Make your mark

Join the writer's program

Are you a developer and love writing and sharing your knowledge with the world? Join our guest writing program and get paid for writing amazing technical guides. We'll get them to the right readers that will appreciate them.

Write for us
Writer of the month
Marin Bezhanov
Marin is a software engineer and architect with a broad range of experience working...
Build on top of Better Stack

Write a script, app or project on top of Better Stack and share it with the world. Make a public repository and share it with us at our email.

community@betterstack.com

or submit a pull request and help us build better products for everyone.

See the full list of amazing projects on github