Python not found on MacOS (Installation with Brew)

If you’ve installed Python3 on your Mac using brew, you’re likely to run into this issue. When you try to run python, you’ll get an error message. Here’s how you can fix it.

Using the editor of your choice (mine is vi).

vi ~/.zshrc

Add the following line towards the end of the file.

export PATH="/opt/homebrew/opt/python@3.11/libexec/bin:$PATH"

Save and exit the editor, and then enter the following.

source ~/.zshrc

From now on, you can directly use the command python.

Similar Posts

Leave a Reply

Your email address will not be published. Required fields are marked *