How to Fix "zsh: command not found: python" on macOS
You typed python in Terminal and macOS answered:
zsh: command not found: pythonNothing is broken. Modern macOS ships a python3 command but no bare python, and unless a tool has put one on your PATH, there is nothing for zsh to run.
Confirm what Python you have
macOS provides python3, so check that first:
$ python3 --version
Python 3.14.5
If python3 prints a version but python does not, the interpreter is fine. Only the short name is missing:
$ which python3
/opt/homebrew/bin/python3
$ which python
python not found
Why does macOS have no python command?
Apple removed the Python 2 python executable in macOS 12.3 (2022) and never replaced it with a Python 3 one. The system now ships python3 alone, and Homebrew, pyenv, and the python.org installers all follow the same convention. A plain python appears only when you deliberately create one. See what a Python interpreter is for how these executables get onto your PATH.
A version manager can also be the cause: if its shims or PATH setup aren’t loaded in your current shell, python disappears until you open a new terminal or re-source your shell profile.
Run python3 for a one-off check
For a quick script or REPL, use the command macOS gives you:
$ python3 -c "print('hello')"
hello
Every place a tutorial says python, substitute python3 and it works.
Install uv for real project work
Depending on python3 from the operating system is fine for a one-liner but poor for a project. The version is chosen by Apple, you can’t switch it, and packages you install leak across every project. uv fixes all three by managing its own interpreters. Install it with the standalone installer:
curl -LsSf https://astral.sh/uv/install.sh | shSee how to install uv on macOS for Homebrew and pip alternatives.
Then install a Python version:
$ uv python install 3.13
You don’t need a python command at all to use it. uv run launches the right interpreter for your project:
$ uv run python --version
Python 3.13.13
Get a real python command with uv
If you want typing python to work, pass --default when installing:
$ uv python install --default 3.13
Installed Python 3.13.13 in 63ms
+ cpython-3.13.13-macos-aarch64-none (python, python3)
That writes both python and python3 into ~/.local/bin. Confirm the directory is on your PATH:
$ echo $PATH | tr ':' '\n' | grep .local/bin
If nothing prints, add it for zsh (the default macOS shell) and reload:
echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.zshrc
source ~/.zshrcNow python resolves to the uv-managed interpreter:
$ python --version
Python 3.13.13
Note
The --default flag is experimental and prints a warning, but the versioned python3.13 executable it also installs is stable. See how to add Python to your system PATH with uv for the full PATH setup.
Why a bare python is fragile
A python command hides which interpreter runs behind it. On one machine it might be a uv install, on another a Homebrew Python, on a third nothing at all, which is the error that brought you here. That ambiguity is the reason to prefer uv run python, which always uses the version your project pins, and to avoid leaning on the system Python for project work.