[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.

Facing issues? Have Questions? Post them here! I am happy to answer!

Author Info:

Rakesh (He/Him) has over 14+ years of experience in Web and Application development. He is the author of insightful How-To articles for Code2care.

Follow him on: X

You can also reach out to him via e-mail: rakesh@code2care.org

Copyright © Code2care 2024 | Privacy Policy | About Us | Contact Us | Sitemap