Where does brew install python in macOS


If you have installed Python on your macOS using brew and trying to locate its installed location you can make use of the following command,

mac % brew list python@3.9

/opt/homebrew/Cellar/python@3.9/3.9.6/bin/2to3
/opt/homebrew/Cellar/python@3.9/3.9.6/bin/2to3-3.9
/opt/homebrew/Cellar/python@3.9/3.9.6/bin/idle3
/opt/homebrew/Cellar/python@3.9/3.9.6/bin/idle3.9
/opt/homebrew/Cellar/python@3.9/3.9.6/bin/pip3
/opt/homebrew/Cellar/python@3.9/3.9.6/bin/pip3.9
/opt/homebrew/Cellar/python@3.9/3.9.6/bin/pydoc3
/opt/homebrew/Cellar/python@3.9/3.9.6/bin/pydoc3.9
/opt/homebrew/Cellar/python@3.9/3.9.6/bin/python3
/opt/homebrew/Cellar/python@3.9/3.9.6/bin/python3-config
/opt/homebrew/Cellar/python@3.9/3.9.6/bin/python3.9
/opt/homebrew/Cellar/python@3.9/3.9.6/bin/python3.9-config
/opt/homebrew/Cellar/python@3.9/3.9.6/bin/wheel3
/opt/homebrew/Cellar/python@3.9/3.9.6/Frameworks/Python.framework/ (3026 files)
/opt/homebrew/Cellar/python@3.9/3.9.6/IDLE 3.app/Contents/ (8 files)
/opt/homebrew/Cellar/python@3.9/3.9.6/lib/pkgconfig/ (4 files)
/opt/homebrew/Cellar/python@3.9/3.9.6/libexec/bin/ (6 files)
/opt/homebrew/Cellar/python@3.9/3.9.6/libexec/wheel-0.36.2-py2.py3-none-any.whl
/opt/homebrew/Cellar/python@3.9/3.9.6/Python Launcher 3.app/Contents/ (16 files)
/opt/homebrew/Cellar/python@3.9/3.9.6/share/man/ (2 files)

Also when you install python you will get info about where Python got installed.

Sample logs of installing Python 3.9
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.9/libexec/bin

You can install Python packages with
  pip3 install <package>
They will install into the site-package directory
  /opt/homebrew/lib/python3.9/site-packages
-




Have Questions? Post them here!