How can I fix the `zsh: command not found: python` error on macOS Monterey when using Atom and Python 3.10?

After upgrading to macOS Monterey 12.3, I started seeing the zsh: command not found: python error when trying to run Python code from Atom using the atom-python-run package (v0.9.7). I’m using Python 3.10.3, and everything used to work fine before.

Here’s what I’ve tried so far to resolve the zsh: command not found: python issue:

  • Reinstalled Python from python.org
  • Added alias python='python3' to .zshrc
  • Tried resetting my PATH
  • Deleted and reset ZSH config files
  • Even reinstalled macOS and Python completely

Still, the terminal inside Atom doesn’t recognize python, even though which python3 works fine.

How do I permanently fix this so that the atom-python-run package and my terminal both recognize the python command again? Do I need to symlink it, adjust Atom’s PATH settings, or something else?

I’ve run into this myself quite a bit as someone working with Python for years. The error zsh: command not found: python happens on macOS Monterey because Apple removed the system Python binary, yet many tools, including Atom plugin, still expect a python command to exist.

A quick fix is to create a symlink so that python points explicitly to Python 3. Run this:

sudo ln -s /usr/bin/python3 /usr/local/bin/python

Then confirm /usr/local/bin is in your PATH with:

echo $PATH

That symlink alone has resolved zsh: command not found: python for me in tools like atom-python-run that don’t check for python3. Simple but effective!

Great point, @ishrth_fathima !

I’ve also been coding Python for several years and seen the same zsh: command not found: python issue. One extra wrinkle: Atom launched via Finder or Spotlight doesn’t inherit your .zshrc, so even your symlink or aliases might not be picked up.

My tip is: always launch Atom from the terminal instead, so it inherits your shell environment. Just run:

open -a Atom

Or better yet, install Atom’s shell command via:

Atom → Command Palette → “Install Shell Commands”

This ensures your PATH, and symlink, are respected, avoiding zsh: command not found: python inside Atom-run scripts.

Adding on to both of your excellent suggestions, as someone who’s configured many macOS setups, I’ve also hit zsh: command not found: python when using pyenv. The challenge is that GUI apps like Atom sometimes skip the pyenv initialization if it’s only in .zshrc.

A solid fix is to add this to your .zprofile too:

eval "$(pyenv init --path)"

Then restart your terminal and relaunch Atom. This guarantees pyenv’s shims load for all sessions, even GUI apps. It’s closed the gap for me in situations where python works in Terminal but fails inside editors. Definitely helps squash zsh: command not found: python once and for all!

1 Like