Command not found: pip
How to fix command not found pip on Mac. Python pip install command not found. On macOS the bare pip command exists only inside a virtual environment, so you'll see this error even when Python is installed correctly.
Pip is the standard package installer for Python. It fetches libraries from the Python Package Index and adds them to a Python environment, so your code can use them.
Installing Python is one step in setting up your Mac for development. See the Mac development setup guide.
Before you get started
You'll need a terminal application to fix the error. Apple includes the Mac terminal but I prefer Warp Terminal. Warp is an easy-to-use terminal application, with AI assistance to help you learn and remember terminal commands. Download Warp Terminal now; it's FREE and worth a try.
First steps to fix command not found: pip
First, check the macOS version. If you're running an older version, update macOS to the latest macOS version.
Many guides say this error means Python is missing or the $PATH is wrong. On a Mac that is often incorrect. Python may be installed, but the pip command you want to run does not exist on macOS outside of a project environment.
Fix the error quickly
Here's a quick fix, depending on what you need to do.
- If you are building a Python project: install uv, then use
uv add <package>instead ofpip install <package>. - If you are installing a standalone tool such as a code formatter or a downloader: install Pipx, then use
pipx install <tool>. - If you are following a tutorial that says
pip install: create and activate a virtual environment first, and the tutorial's command will work as written.
If none of those match, or you want to understand why this happened, read on.
Understand why pip is missing on macOS
Python tooling has been evolving since 1991, and three separate changes have created this mess. Knowing the reasons will save you from fixing one error and hitting the next.
macOS has pip3 but not pip
With the Xcode Command Line Tools, Apple provides python3 and pip3 in /usr/bin. Apple does not provide python or pip (without the number "3") with the system Python. Homebrew's Python behaves the same way: it gives you pip3, not pip. That's because Apple used to provide python as Python version 2 (and removed it after 2022) and users specified python3 when they wanted the newer version.
To get a working pip command on a Mac, you'll need to create a Python virtual environment. Create one and you'll find pip:
$ python3 -m venv .venv
$ ls .venv/bin
pip pip3 pip3.14 python python3 python3.14
A virtual environment creates the unversioned pip and python names.
This explains why many instructions are nominally "correct" and still fail for you. Often an author assumes you know you need to activate a virtual environment first. The instruction is true, but it carries an unstated requirement.
Apple removed Python 2
Before 2022 on macOS, /usr/bin/python was Python 2, and the unversioned python and pip commands worked properly.
Any tutorial written before that change refers to commands that no longer exist on your Mac. The instruction may not be wrong, just out of date, which is hard to spot.
A newer Python will block installs outside an environment
Recent Python versions follow a Python packaging standard called PEP 668. With PEP 668, pip refuses to install a package unless you are working inside a virtual environment. The rule protects your Mac: installing packages directly into a system Python can break software the operating system depends on.
Homebrew adopted this standard beginning with Python 3.12, so every Homebrew Python since then carries the marker. Even if you use pip3 instead of pip, the install can still be refused. See Fix: error: externally-managed-environment on Mac.
Check which Python and pip commands you have
Before changing anything, find out what your Mac actually has. The which -a command shows every matching command your shell can find. The -a flag shows all matches, not only the first.
$ which -a pip
pip not found
$ which -a pip3
/opt/homebrew/bin/pip3
/usr/bin/pip3
$ which -a python3
/opt/homebrew/bin/python3
/usr/bin/python3
The first line confirms the diagnosis: there is no pip command. Here is how to read the rest:
- Paths beginning with
/usr/binare Apple's Python, installed with the Xcode Command Line Tools. Don't usepip3from the system Python. - Paths beginning with
/opt/homebrewor/usr/localcome from Homebrew. - Paths inside your home folder usually come from uv, Pyenv, or the official Python installer.
To check the Python version:
$ python --version
Python 3.14.6
If python --version gives you an error, Python itself is missing or unreachable. See Command not found: python.
Choose the fix that matches your task
There is no single correct fix for a failing pip install. What you should run depends on what you are building.
Install packages for a project with uv
For writing Python code, the tool uv is the modern standard for handling Python versions, virtual environments, and packages. It is fast and it removes most of the setup mess that causes the pip error. See Install uv on Mac.
Once uv is installed, create a project and add a package to it.
$ uv init myproject
$ cd myproject
$ uv add cowsay
The cowsay package is a fun example of a Python library.
The command uv add replaces pip install for project work. It creates a virtual environment for the project, installs the package into it, and records the dependency so the project can be rebuilt later.
Note that uv add must be run in an existing project. If a folder has no pyproject.toml file, you'll see an error saying no pyproject.toml was found. Run uv init first, as shown above.
If you see zsh: command not found: uv after installing, see Command not found: uv.
Install a standalone Python application with pipx
Some programs are written in Python but are not libraries you import. Code formatters, linters, and video downloaders fall into this group. Install these with pipx, which puts each application in its own environment and adds the command to your $PATH. See Install Pipx.
$ pipx install ruff
Use pipx when you want to run a program, and uv when you want to write code that imports a library.
Follow a tutorial that uses pip commands
Sometimes you are trying to follow instructions from a course, a README, or a workplace standard. You see you should run pip install, and you need that exact command to work. Create a virtual environment and activate it.
$ python3 -m venv .venv
$ source .venv/bin/activate
Your prompt changes to show the environment name. Now check that pip exists.
$ pip --version
pip 26.0 from /Users/yourname/myproject/.venv/lib/python3.14/site-packages/pip (python 3.14)
The pip command now works, and so does every pip install line in the tutorial. You've created the environment the instructions assumed you had. Run deactivate when you are finished, and activate it again the next time you work on that project.
Recognize the second error: externally-managed-environment
Many people fix the first error, run pip3 install, and hit a second error that looks completely different.
$ pip3 install cowsay
error: externally-managed-environment
This is a violation of the PEP 668 rule described above. The solution is the same as described above: work inside a virtual environment, or use uv or pipx. There's a --break-system-packages flag available, but don't use it, as it does what its name says. See Fix: error: externally-managed-environment on Mac.
Alias pip to pip3 for simple scripts
If you only run occasional Python scripts and do not develop software, you can alias the pip command to pip3. Aliases belong in the ~/.zshrc shell configuration file, which is the file for interactive shell settings. See .zshrc or .zprofile.
$ echo "alias pip='pip3'" >> ~/.zshrc
$ source ~/.zshrc
Be aware of the limits before you rely on this. The alias only fixes the command name, so an externally managed Python still refuses the install. It also applies only when you type commands yourself, not when a script or build tool runs pip. For anything beyond casual use, a virtual environment or uv is the better answer. See Alias python3 to python for more about aliasing Python commands.
Troubleshoot other causes of the error
The explanation above covers most cases. A few other situations produce the same message.
Restart your terminal application
If you just installed Python or uv, your current shell session may not know about it yet. Quit the terminal application, open it again, and try the command once more. New entries in your $PATH are read when a shell starts.
Set the PATH when Python is installed but not found
If you installed Python and the commands still are not found, your $PATH may not include the folder holding them. Environment variables such as $PATH belong in ~/.zprofile. See Mac Python PATH for the settings that match each installation method, and Mac Path for how the $PATH works.
Install Python if it is missing
If python3 --version gives an error, and you have no Python beyond Apple's, install one before going further. See How to Install Python on Mac. I recommend Install uv on Mac, which sets up Python and package management together.
For more details, you can see the article Install Pip.
Continue setting up your Mac
Don't miss the full visual roadmap and checklist that shows how to set up a Mac for software development, with all the essential tools and settings you might not yet know about.