Fixing missing ‘python’ error in macOS
til
python
poetry
After the last macOS update, I started getting the following error when trying to run poetry install
:
I went through GitHub issues, StackOverflow questions, and blog posts, but none of the suggested solutions worked.
Finally, I found the solution somewhat hidden in this blog post.
So, what’s the fix?
🥁 🥁 🥁
Just add the following line to your .zshrc
file:
This gets the installation prefix for python
installed via Homebrew (e.g. /opt/homebrew/opt/[email protected]
), gets the libexec/bin
directory, and adds it to the PATH.
In that libexec/bin
, there’s a python
executable that gets called when you run python
in the terminal.
That’s all. Hope that helps!
Citation
BibTeX citation:
@online{castillo2024,
author = {Castillo, Dylan},
title = {Fixing Missing “Python” Error in {macOS}},
date = {2024-08-12},
url = {https://dylancastillo.co/til/fixing-python-not-found-error-in-macos.html},
langid = {en}
}
For attribution, please cite this work as:
Castillo, Dylan. 2024. “Fixing Missing ‘Python’ Error
in macOS.” August 12, 2024. https://dylancastillo.co/til/fixing-python-not-found-error-in-macos.html.