pip command not found - Mac

Page content

How to Install pip Command on Mac

If you are on a Mac and trying to use the pip command but getting a “command not found” error, don’t worry. This tutorial will guide you through the process of installing pip on your Mac system.

Why pip is Not Found on Mac

pip is a package management system used to install and manage software packages written in Python. It is typically included with Python installations on most systems, but sometimes it may not be available or properly configured.

Installation Steps

Follow these steps to install pip on your Mac:

  1. Open a terminal window.

  2. Download the get-pip.py script using curl:

    curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
    
  3. Run the script to install pip:

    python get-pip.py
    
  4. Verify the installation by checking the pip version:

    pip --version
    

Dealing with Incompatibility

If the python command is not available on your system, you can use python3 instead. Here’s how you can modify the installation steps:

  1. Download the get-pip.py script using curl with python3:

    curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
    
  2. Run the script using python3 to install pip:

    python3 get-pip.py
    
  3. Verify the installation using pip3:

    pip3 --version
    

By following these steps, you should now have pip installed and ready to use on your Mac system.

Conclusion

Installing pip on your Mac is essential for managing Python packages efficiently. By following the steps outlined in this tutorial, you can overcome the “command not found” issue and start using pip to install and manage Python packages seamlessly.