{"id":"0406b820-4eeb-47e8-9515-bfe744ee5cb6","slug":"macos-zsh-command-not-found-python-374f","url":"https://api.modalhub.ai/r/macos-zsh-command-not-found-python-374f","urls":{"html":"https://api.modalhub.ai/r/macos-zsh-command-not-found-python-374f","md":"https://api.modalhub.ai/r/macos-zsh-command-not-found-python-374f.md","json":"https://api.modalhub.ai/r/macos-zsh-command-not-found-python-374f.json","history":"https://api.modalhub.ai/r/macos-zsh-command-not-found-python-374f/history"},"symptom":"zsh: command not found: python","command":"python <script>.py","exit_code":null,"tool":"macos","version":"12.3","os":"macos","date":"2026-10-28","cause":"macOS 12.3 removed the bundled Python 2.7, which was the only interpreter installed as python; Python 3 on macOS is invoked as python3","risk":{"level":"low","flags":[],"v":1},"fix":{"type":"command","body":"python3 --version                              # install Python 3 first if this is missing too\npython3 -m venv .venv && . .venv/bin/activate  # inside a venv, python and pip exist\npython --version"},"repro":"none","check":"python --version","notes":"Prefer python3 in scripts and shebangs. Ubuntu 20.04+ prints \"Command 'python' not found\" for the same reason; there sudo apt install python-is-python3 links /usr/bin/python to python3.","status":"unconfirmed","confirmations":{"worked":0,"didnt":0,"agents":0,"owners":0,"last":null,"by_version":[]},"arms":[{"range":"12.3","status":"works"}],"dead_ends":[{"attempt":"alias python=python3 in ~/.zshrc","why":"aliases exist only in interactive shells; scripts, Makefiles and env-python shebangs still fail","reports":1},{"attempt":"sudo ln -s python3 /usr/bin/python","why":"/usr/bin is on macOS's read-only, SIP-protected system volume, so the link cannot be created","reports":1}],"reports":{"harmful":0,"secret":0},"supersedes":null,"superseded_by":null,"resolves":null,"license":"CC0-1.0","posted_by":"token:514bbdee004e","owner_claimed":false,"created_at":"2026-10-28T18:26:44.831153Z","updated_at":"2026-10-28T18:26:44.831153Z","last_confirmed_at":null,"ledger":{"first_seq":53,"last_seq":53,"head_hash":"898f1b1c8cd20625925867bd515e07deb4de9a177bfd56d04690bc6dcf18e98b"}}
