brew install python or brew info python output mentions:

Unversioned symlinks python, python-config, pip etc. pointing to python3, python3-config, pip3 etc., respectively, have been installed into /opt/homebrew/opt/[email protected]/libexec/bin

So running, as root (for Bash (executable bash), use the ~/.bash_profile file):

echo 'export PATH=/opt/homebrew/opt/[email protected]/libexec/bin:$PATH' >> ~/.zprofile
source ~/.zprofile

gets you those symlinks created by Homebrew, python=python3, pip=pip3, etc.

python --version

Output:

Python 3.9.10

And:

pip --version

Output:

pip 21.3.1 from /opt/homebrew/lib/python3.9/site-packages/pip (python 3.9)
Answer from Callum M on Stack Overflow
🌐
Ahmad Awais
ahmadawais.com › home › python not found on macos | install python with brew | fix $path
Python not found on MacOS | Install Python with brew | Fix $PATH
June 12, 2023 - Python has been installed as /opt/homebrew/bin/python3 Unversioned symlinks `python`, `python-config`, `pip` etc. pointing to `python3`, `python3-config`, `pip3` etc., respectively, have been installed into /opt/homebrew/opt/python@3.11/libexec/bin
🌐
Mac Install Guide
mac.install.guide › python › brew
Brew Install Python · Mac Install Guide
February 25, 2024 - If you see zsh: command not found: python, check that the Mac PATH is set correctly. This is the expected result if you skipped the $PATH step above: Homebrew installs a python3 command but keeps the unversioned python in a directory that is ...
Discussions

Python: command not found
Hi I’m very new to Python and I’m trying to get it set up with VSC, however I keep getting the following error whenever I try to run any commands: /bin/sh: python: command not found I’ve googled and tried solutions such as installing homebrew, but to no avail. More on discuss.python.org
🌐 discuss.python.org
2
0
December 28, 2022
Homebrew-installed Python libraries not recognised by VS Code (Mac OS)
Are you able to run your program successfully from a terminal? If yes, do whatever setup steps you usually take so that you can type “python your_program.py” and have it execute successfully. Instead, type “which python” and press enter. That will point you to the interpreter being used. You may need to replace python with python3, but probably not. I hope you are using a virtual environment. More on reddit.com
🌐 r/learnpython
12
6
September 14, 2024
How do I use Homebrew installed Python as the default Python? - Stack Overflow
It sounds like you ran into the same problem I did. All the links that brew creates, even with the link commands in answers here, in /usr/local/bin are for python2 instead of python. Using an alias to work around this seems like a bad idea, but I haven't found anything better yet. More on stackoverflow.com
🌐 stackoverflow.com
terminal - Running `pip` gives 'command not found' after successful Python homebrew install - Stack Overflow
To preface, I am very bad with the terminal, please be patient with me. when I run pip I get: zsh: command not found: pip I have installed Python 2.7.11 with brew, which should allow pip to w... More on stackoverflow.com
🌐 stackoverflow.com
Top answer
1 of 7
84

brew install python or brew info python output mentions:

Unversioned symlinks python, python-config, pip etc. pointing to python3, python3-config, pip3 etc., respectively, have been installed into /opt/homebrew/opt/[email protected]/libexec/bin

So running, as root (for Bash (executable bash), use the ~/.bash_profile file):

echo 'export PATH=/opt/homebrew/opt/[email protected]/libexec/bin:$PATH' >> ~/.zprofile
source ~/.zprofile

gets you those symlinks created by Homebrew, python=python3, pip=pip3, etc.

python --version

Output:

Python 3.9.10

And:

pip --version

Output:

pip 21.3.1 from /opt/homebrew/lib/python3.9/site-packages/pip (python 3.9)
2 of 7
38

If you want to install Python 3 using Homebrew:

brew install python3

Output:

==> Downloading http://python.org/ftp/python/3.3.0/Python-3.3.0.tar.bz2
Already downloaded: /Library/Caches/Homebrew/python3-3.3.0.tar.bz2
==> ./configure --prefix=/usr/local/Cellar/python3/3.3.0 --enable-ipv6 --datarootdir=/usr/local/Cell
==> make
==> make install PYTHONAPPSDIR=/usr/local/Cellar/python3/3.3.0
==> make frameworkinstallextras PYTHONAPPSDIR=/usr/local/Cellar/python3/3.3.0/share/python3
==> Downloading https://pypi.python.org/packages/source/d/distribute/distribute-0.6.35.tar.gz
Already downloaded: /Library/Caches/Homebrew/distribute-0.6.35.tar.gz
==> /usr/local/Cellar/python3/3.3.0/bin/python3.3 -s setup.py install --force --verbose --install-li
==> Downloading https://pypi.python.org/packages/source/p/pip/pip-1.3.1.tar.gz
Already downloaded: /Library/Caches/Homebrew/pip-1.3.1.tar.gz
==> /usr/local/Cellar/python3/3.3.0/bin/python3.3 -s setup.py install --force --verbose --install-li
==> Caveats
Homebrew's Python3 framework
  /usr/local/Cellar/python3/3.3.0/Frameworks/Python.framework

Distribute and Pip have been installed. To update them
  pip3 install --upgrade distribute
  pip3 install --upgrade pip

To symlink "Idle 3" and the "Python Launcher 3" to ~/Applications
  `brew linkapps`

You can install Python packages with
  `pip3 install <your_favorite_package>`

They will install into the site-package directory
 /usr/local/lib/python3.3/site-packages
Executable python scripts will be put in:
 /usr/local/share/python3
so you may want to put "/usr/local/share/python3" in your PATH, too.

    See: https://github.com/mxcl/homebrew/wiki/Homebrew-and-Python

Once installed update your system PATH variable, add the next line to the ~/.bash_profile file:

export PATH=/usr/local/bin:/usr/local/sbin:~/bin:$PATH

And then:

source ~/.bash_profile

Now launch Python:

python3

Output:

Python 3.3.0 (default, Mar 26 2013, 10:01:40)
[GCC 4.2.1 Compatible Apple LLVM 4.2 (clang-425.0.27)] on darwin
Type "help", "copyright", "credits" or "license" for more information.

You can check the python3 path:

which python3

Output:

/usr/local/bin/python3
🌐
Python.org
discuss.python.org › python help
Python: command not found - Python Help - Discussions on Python.org
December 28, 2022 - Hi I’m very new to Python and I’m trying to get it set up with VSC, however I keep getting the following error whenever I try to run any commands: /bin/sh: python: command not found I’ve googled and tried solutions such as installing homebrew, but to no avail.
🌐
Vivasart
vivasart.com › en › blog › how-to-fix-zsh-command-not-found-python-error-after-installing-python-via-brew-on-a-mac
How to Fix 'zsh: command not found: python' Error After Installing Python via Brew on a Mac
The reason for this is that when using brew, the location of the Python package is not automatically passed to the zsh profile. As a result, you may encounter issues with Python packages not being found or failing to import properly. echo "alias ...
🌐
Codetinkering
codetinkering.com › homebrew-python-not-found
Homebrew Python Not Found – Code Tinkering
When you install Python using Homebrew, the install script doesn’t configure your PATH to accommodate the version-less symlinks and aliases created, resulting in the notorious error: zsh: python: command not found zsh: pip: command not found · In short, python3 and pip3 work but python and pip will not!
🌐
RNT Lab
rntlab.com › question › macos-brew-install-fail-for-python-3
MacOS Brew install fail for Python 3
Please consider donating: ... python3 zsh: command not found: brew ... Hi. Yes, the installation of brew was successful. But, you need to fix the command path....
Find elsewhere
🌐
Reddit
reddit.com › r/learnpython › homebrew-installed python libraries not recognised by vs code (mac os)
r/learnpython on Reddit: Homebrew-installed Python libraries not recognised by VS Code (Mac OS)
September 14, 2024 -

Hi all!

I've been wanting to experiment with the wonderful Manim library, but I am running into some problems. As per the installation guide, I've used Homebrew to install Manim. I've also used Homebrew to install the latest Python 3.12. Anyway, Python and Manim both work fine! However, VS Code does not recognise the Manim syntax, and that's what I want to fix.

From what I've read online, the problem seems to be that my VS Code - which I also installed with Homebrew - is not using the right Python interpreter. The fix is supposed to be selecting the right Python interpreter. However, I have no idea which one that is. The only 3.12 interpreter that VS Code recommends is in /opt/homebrew/bin/python3. There is the option of entering an interpreter path, but how do I know which that will be?

Any tips would be super helpful! As you can probably tell, this whole Homebrew stuff is quite new to me, so I would really appreciate some hand holding here.

P.S. I don't know if it matters, but although the Manim installation guide says to install Manim with pip, this did not work on my machine, which uses Apple M3. I replaced the pip install command with the Brew one, and that worked.

🌐
freeCodeCamp
freecodecamp.org › news › how-to-fix-python-installation-errors-on-mac
How to Fix Common Python Installation Errors on macOS
June 10, 2024 - Better yet, install Python with ... found: python error, and are certain you have already installed Python, you may need to update the Mac Python PATH....
🌐
Medium
medium.com › @mathankumar.mkk29 › installing-python-on-macos-fixing-common-installation-issues-e645d635a24b
Installing Python on macOS & Fixing Common Installation Issues | by TheDevStudio | Medium
August 9, 2025 - Run: python3 --version · If you see something like: Python 3.9.6 · you’re good to go — just use python3 instead of python. If you see command not found, keep reading. Homebrew is the package manager for macOS.
Top answer
1 of 5
32

I ran into this problem myself on OS X. In my case, I finally did a listing of /usr/local/bin, and found that I had links from pip2, pip2.7, pip3, and pip3.6. What I lacked was a link from just pip. I don't know if this is just part of a new standard, or if I was missing something that would select one of the two, or if having both Python 2 and Python 3 installed meant that I didn't get a simple pip command. Either way, running brew doctor didn't reveal or solve any issues.

In this case, just running pip3 or pip2 (instead of pip) seemed to do the trick for me. In my case, I ran pip3 and everything installed and ran as expected.

2 of 5
9

My Background

I had this same problem, and I think it may have arisen after upgrading to OSX 10.11 (El Capitan). When trying to run pip, I got -bash: pip: command not found I also tried python -m pip which did not work either (no module found). Trying to unlink and relink python through Homebrew did not work.

The Fix

I was able to fix the problem by completely uninstalling and reinstalling python via Homebrew.

brew uninstall python && brew install python

If you want to remove older versions of python too, use

brew uninstall --force python && brew install python

None of my existing pip installs were affected, and are all still listed when I run pip freeze. After the reinstall, the binary is now symlinked to /usr/local/bin/pip, which did not exist before. Strangely, the actual binary in /usr/local/Cellar/python/2.7.11/bin/pip did not exist before the reinstall either.

🌐
Apple Community
discussions.apple.com › thread › 253554775
"-bash: brew: command not found" for all … - Apple Community
Not only does this now give you access to brew, but also that /usr/bin/python that is linked to its bin directory in the System's Python.framework. However, some brew-installed packages may have a dependency on Python3 and brew will attempt to install it in /usr/local/bin with links to that /Library/Frameworks/Python.framework.../3.9/bin location.
🌐
Code with Mosh
forum.codewithmosh.com › python
/bin/sh: python: command not found - Python - Code with Mosh Forum
June 27, 2022 - ... The system install of Python on macOS is not supported. Instead, an installation through Homebrew is recommended. To install Python using Homebrew on macOS use brew install python3 at the Terminal prompt.
🌐
Mac Install Guide
mac.install.guide › python › command-not-found-python
'zsh: command not found: python' · Mac Install Guide
August 2, 2026 - Pipx is an older, well-known tool designed to install and run Python command-line utilities globally but isolated from each other. See the article: ... You can install Pipx with Homebrew and Python will be installed for you. This is an easy way to fix the error zsh: command not found: python but only if you want to run a Python program such as a utility or script.
🌐
GitHub
github.com › orgs › Homebrew › discussions › 3596
Why not reference python3 as just python too when installed from brew? · Homebrew · Discussion #3596
So it isn't ideal to have parallel references to it hard-coded into PATH set by a different system that brew has no knowledge of. On the note of consistency, it seems like there is currently close to consensus in other package managers/distros/ecosystems that python = python3 is a standard if not canonical community convention. In modern releases, python 2 does not exist, and either command python points at python 3 by default as soon as python 3 is installed, or by default there is no command python but if you want to do so, you can make it point at python 3 through the package manager with one install command:
🌐
Reddit
reddit.com › r/learnpython › i installed homebrew on my mac, got an error, found a solution on stack overflow, implemented the solution, and now i can’t seem to access python
r/learnpython on Reddit: I installed homebrew on my Mac, got an error, found a solution on stack overflow, implemented the solution, and now I can’t seem to access python
July 9, 2022 -

I’ve been trying to use pip for a while now and was unable to because my Mac kept using the pre installed python 2 not python 3 which I installed. It was recommended that I use homebrew so I downloaded it and then got an error. As I said in the title I tried something I saw and now when I enter “python —version” or “pip —version” I get a ZHS command not found error. Can anyone help me? I’ve been trying for about a week now just to be able to run python files on my Mac. Thanks in advance for the help

🌐
YouTube
youtube.com › watch
How to fix this issue zsh: command not found: python in Mac OS.
Enjoy the videos and music you love, upload original content, and share it all with friends, family, and the world on YouTube.
🌐
Reddit
reddit.com › r/learnpython › no idea how python (3.9) was installed on mac, brew can't find python and there's no app drawer icon
r/learnpython on Reddit: No idea how Python (3.9) was installed on mac, brew can't find Python and there's no app drawer icon
July 9, 2024 -

I wish mac had an uninstall utility like windows that showed all programs on windows regardless of how they were installed.

Today I wanted to upgrade python, which for some reason automatically works even though I don't remember ever installing it. Maybe VSCode installed it itself? No idea. In any case I saw that it was an older version so I tried upgrading, I couldn't find a command from within Python to upgrade itself so I tried brew, but brew can't find python (or python3) so I looked for it in the apps. Not there.

I tried using the GUI installer hoping it'd find its own previous version like what happens in windows, and offer to upgrade.

Also I'm not sure where "python" has disappeared now, it seems to have cleared the path and replaced it with a python3 so on the terminal doing "python --version" no longer outputs 3.9.x but instead says not found, while a python3 --version command now works and outputs 3.12.