I have been using brew
for a lot of years and have not seen this issue — yet.
On both Macs I have (a 2019 Intel Mac Pro and a M3 MacBook Pro) my Brew installed [email protected]
as well as all other versions stopped working as expected.
Since I have not used Python for a few months, I don’t know quite when this stopped working but certainly I have done both OS upgrades and brew updates in the interim.
I have installed these formulae:
% brew list | grep python@
[email protected]
[email protected]
[email protected]
[email protected]
It used to be that this is how it worked:
- If I typed
python3
the most recent installed brew installed version would run; - If I typed
pip3
the associated pip for the most recent install would run; - The shebang
#!/usr/bin/env python3
would run most recent version; - The shebang of
/usr/local/opt/python@[version_I_want]/python3
would run that version.
Recently, all that is broken.
- Typing
python3
at command line now gives me the SYSTEM version of python3; - Typing
pip3
same — the SYSTEM version of pip; - The links for
python3
inside each version have been removed. - The link
/usr/local/bin/python3 -> /usr/local/...
is not a link anymore. This link usually was created by brew during the install.
I have tried running:
$ brew unlink [email protected] && brew link [email protected]
but this did not restore the links. I have also uninstalled each package and reinstalled with brew.
I suppose I could do those links manually but since they were removed systematically by something, I am reluctant to do so. And that seems to defeat the purpose of the package manager.
My $PATH
correctly points to the relevant brew managed directories first and the system directories last.
The Ruby and Perl I have managed by brew work as expected.
Any ideas?
2