[Fix] zsh: command not found: python on Mac


There could be multiple reasons which can cause zsh: command not found: python when you try to run a Python program on the Mac Terminal. One of the most common reasons is that you have Python3 installed on your Mac

zsh- command not found- python

Fix 1: Use Python3 instead of Python

% python3
Python 3.9.6 (default, Aug  5 2022, 15:21:02) 
[Clang 14.0.0 (clang-1400.0.29.102)] on darwin
Type "help", "copyright", "credits" or "license" for more information.

Fix 2: Install Python using brew

If Python is still missing install Python using Homebrew package manager for Mac,

% brew install python

Fix 3: Python Path is not set

You might already have Python installed but the path is not set. Update the path in .zshrc file.

-


Have Questions? Post them here!

Topics Coverage:


🎉 We are celebrating the 10th years of Code2care! Thank you for all your support!

We strongly support Gender Equality & Diversity.

Follow Us: GitHub | Facebook | Twitter | Instagram