If you see zsh: command not found: pip, try pip3 instead:

pip3 --version

On modern Macs, the command is pip3, not pip.

The Quick Fix

If pip3 works but you want to type just pip:

echo 'alias pip="pip3"' >> ~/.zshrc
source ~/.zshrc

Now pip runs pip3.

If pip3 Doesn't Work Either

Install Python first

pip comes with Python. If pip3 doesn't work, Python probably isn't installed:

python3 --version

If this fails, install Python:

brew install python

Or install Xcode Command Line Tools:

xcode-select --install

After installation, pip3 should work.

Reinstall pip for an existing Python

If Python works but pip is missing:

python3 -m ensurepip --upgrade

Or download and run the installer:

curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
python3 get-pip.py
rm get-pip.py

Check pip Installation

pip3 --version

Output: pip 23.3.1 from /opt/homebrew/lib/python3.12/site-packages/pip (python 3.12)

Install a Package

pip3 install requests

Or with your new alias:

pip install requests

Common pip Commands

Command What it does
pip3 install package Install a package
pip3 uninstall package Remove a package
pip3 list Show installed packages
pip3 show package Info about a package
pip3 install --upgrade package Update a package
pip3 freeze > requirements.txt Save dependencies to file
pip3 install -r requirements.txt Install from file

Using python -m pip

An alternative that always works:

python3 -m pip install requests

This explicitly uses the pip module from Python, avoiding PATH issues.

Virtual Environments (Recommended)

For projects, use virtual environments:

python3 -m venv myproject
source myproject/bin/activate
pip install requests    # Works without 'pip3' inside venv

This keeps packages isolated per project and avoids permission issues.

Permission Errors

If you see "Permission denied" or "Could not install packages":

Don't use sudo. Instead, use --user:

pip3 install --user package

Or better, use a virtual environment.

PATH Issues

If pip3 installs packages but they're not found:

Apple Silicon Macs:

echo 'export PATH="\$HOME/Library/Python/3.12/bin:\$PATH"' >> ~/.zshrc
source ~/.zshrc

Intel Macs:

echo 'export PATH="\$HOME/Library/Python/3.12/bin:\$PATH"' >> ~/.zshrc
source ~/.zshrc

Adjust 3.12 to match your Python version.

Which pip Am I Using?

which pip3

Shows the path to pip3. If it's in /opt/homebrew/, it's the Homebrew version. If it's in /usr/bin/, it's the system version.

Upgrade pip Itself

pip3 install --upgrade pip

Keeps pip up to date.


Keep Learning

Understanding how Python and pip work on Mac helps you set up projects smoothly. The free course covers Terminal fundamentals.

Check it out at Mac Terminal for Humans.