Featured Article

How to Use Pip to Install Python Packages on Mac

Cynthia Jul 13, 2026

In the dynamic world of Python development, managing packages is a breeze with pip, the Python package installer. Mac users, rejoice! You're not left behind. In this comprehensive guide, we'll delve into the simple yet powerful process of using pip to install Python packages on your Mac.

Install pip on Mac
Install pip on Mac

Before we dive in, ensure you have Python and pip installed. For macOS Mojave and later versions, Python 3 comes pre-installed, and so does pip. Verify this by opening your terminal and typing:

Effortlessly Install pip on Your Mac
Effortlessly Install pip on Your Mac

python3 --version and pip3 --version

Understanding pip

Navigating the Labyrinth: Mastering Java Dependency Management with ActiveState | ActiveState
Navigating the Labyrinth: Mastering Java Dependency Management with ActiveState | ActiveState

pip is a package manager for Python that allows you to install and manage additional functionalities packaged as libraries. It's similar to npm for JavaScript or easy_install or rubygems for Ruby.

pip handles the fetching, building, and installation of the specified packages, including their dependencies. This simplifies the process of managing third-party packages, making your Mac development experience more efficient.

How to use Pip in Python - PythonForBeginners.com
How to use Pip in Python - PythonForBeginners.com

Navigating your terminal

Like most operations on a Mac, installing packages with pip is terminal-based. Familiarize yourself with some basic terminal commands to navigate your file system. The ls, cd, and pwd commands are essential for listing directory contents, changing directories, and printing the full path respectively.

Here's a simple example using these commands:

  • To move into your home directory, type cd and press Enter.
  • To view the contents of the current directory, type ls and press Enter.
  • To see the full path of your current location, type pwd and press Enter.
macOS: How to Install PIP
macOS: How to Install PIP

Using pip to install packages

Now that you're comfortable with your terminal, let's install our first package – let's say 'requests', a popular package for making HTTP requests. In your terminal, type:

pip3 install requests

How to Install Python PIP on Windows, Mac, and Linux
How to Install Python PIP on Windows, Mac, and Linux

After pressing Enter, pip will download and install the 'requests' package along with its dependencies. You'll see something similar to this in your terminal:

Collecting requests Downloading requests-2.26.0-py3-none-any.whl (63 kB) |้อม progress |сел | -mdone--------------------------------- 63 kB 879 kB/s

How to Install Python Packages using a Script
How to Install Python Packages using a Script
PYTHON INTERMEDIATE’S GUIDE | PACKAGE MANAGERS
PYTHON INTERMEDIATE’S GUIDE | PACKAGE MANAGERS
Python file handling tutorial infographic #python #tutorial #programming
Python file handling tutorial infographic #python #tutorial #programming
How to Merge PDF Files Using Python Script - Step by Step Guide
How to Merge PDF Files Using Python Script - Step by Step Guide
the ultimate python chat sheet is here to help you learn how to use it in your computer
the ultimate python chat sheet is here to help you learn how to use it in your computer
Python tuple methods cheatsheet
Python tuple methods cheatsheet
Python Modules: Bundle Code And Import It From Other Files
Python Modules: Bundle Code And Import It From Other Files
How to install Python on macOS
How to install Python on macOS
How to List Installed Python Packages
How to List Installed Python Packages

Note the use of pip3 instead of pip. Using pip3 ensures you're using the pip for Python 3.

Managing your pip packages

Installing and managing packages with pip isn't a one-way street. You can update, upgrade, or uninstall packages as needed.

To update a package, use the upgrade flag. For example, to update 'requests', type:

pip3 upgrade requests

Updating pip itself

pip, just like the packages it manages, can be upgraded. To update pip, type:

pip3 install --upgrade pip

This will ensure you're using the latest version of pip, which often comes with bug fixes and performance improvements.

Uninstalling packages

Accidentally installed a package? No worries, pip can uninstall it just as easily. Use the uninstall flag followed by the package name. For example, to uninstall 'requests', type:

pip3 uninstall requests

Confirm the uninstallation when prompted.

Remember, every command mentioned here starts with pip3 to ensure the use of pip for Python 3.

Troubleshooting common issues

You might face a few hiccups along the way. Two common issues are pip not finding the package or pip itself not being found.

pip not found

If you encounter a "pip command not found" error, it's likely that your system's PATH variable doesn't include pip's installation directory. To fix this:

  1. Open your bash profile by typing nano ~/.bash_profile in your terminal.
  2. Add the following line at the end of the file: export PATH="/usr/local/opt/python/bin:$PATH"
  3. Press Ctrl + X to exit, then press Y to confirm the save, and finally press Enter.
  4. Reload your bash profile with source ~/.bash_profile. Now, pip3 should work as expected.

pip not finding the package

If you're getting a "Could not find a version that satisfies the requirement" error, it might be due to a corrupt or outdated pip cache. To clear the cache, type:

pip3 cache purge

Sometimes, the package might be in the Python Package Index (PyPI) but not in the default index. To install a package from a specific index, use the -i flag followed by the index URL. For example, to install 'numpy' from the Anaconda repository, type:

pip3 install -i https://conda.anaconda.org/noarch numpy

There you have it! You're now well-equipped to manage Python packages on your Mac using pip. Keep exploring, keep coding, and happy pip-ing! 💻🕵️‍♂️