# How to Fix "zsh: command not found: python" on macOS


You typed `python` in Terminal and macOS answered:

```
zsh: command not found: python
```

Nothing 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:

```console
$ 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:

```console
$ 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](https://pydevtools.com/handbook/explanation/what-is-a-python-interpreter.md) 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:

```console
$ 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](https://pydevtools.com/handbook/reference/uv.md) fixes all three by managing its own interpreters. Install it with the standalone installer:

```bash
curl -LsSf https://astral.sh/uv/install.sh | sh
```

See [how to install uv on macOS](https://pydevtools.com/handbook/how-to/how-to-install-uv-on-macos.md) for Homebrew and pip alternatives.

Then install a Python version:

```console
$ 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:

```console
$ 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:

```console
$ 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:

```console
$ echo $PATH | tr ':' '\n' | grep .local/bin
```

If nothing prints, add it for zsh (the default macOS shell) and reload:

```bash
echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.zshrc
source ~/.zshrc
```

Now `python` resolves to the uv-managed interpreter:

```console
$ 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](https://pydevtools.com/handbook/how-to/how-to-add-python-to-your-system-path-with-uv.md) 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](https://pydevtools.com/handbook/explanation/why-should-i-avoid-system-python.md) for project work.

## Learn More

- [How to Install Python (and Which Method to Choose)](https://pydevtools.com/handbook/how-to/how-to-install-python.md)
- [How to Install Python on macOS](https://pydevtools.com/handbook/how-to/how-to-install-python-on-macos.md)
- [How to install uv on macOS](https://pydevtools.com/handbook/how-to/how-to-install-uv-on-macos.md)
- [How to install Python with uv](https://pydevtools.com/handbook/how-to/how-to-install-python-with-uv.md)
- [How to add Python to your system PATH with uv](https://pydevtools.com/handbook/how-to/how-to-add-python-to-your-system-path-with-uv.md)
- [Why should I avoid using the system Python?](https://pydevtools.com/handbook/explanation/why-should-i-avoid-system-python.md)
- [What is a Python interpreter?](https://pydevtools.com/handbook/explanation/what-is-a-python-interpreter.md)
