A Weird Python Command Not Found Problem
Problem Statement
I met a weird problem with the following output:
What happened??? I just took a nap and turned my computer back on, why did python get lost???
Resolution
Ok... Let me check these paths: /usr/bin
and /usr/local/bin
:
OMG! ONLY python3
EXISTS!
At that moment, I started to recall if I did anything stupid which removed the system python
by mistake.
After half an hour of useless attempts, it flashed through my mind that I had just upgraded to macOS Monterey 12.3.1 before I went to sleep, and let me check the release notes:
PythonDeprecations
Python 2.7 was removed from macOS in this update. Developers should use Python 3 or an alternative language instead. (39795874)
Now the truth is out, Apple took a shot at me.
This problem can be fixed simply as I have had another python3 installed by Homebrew.
And now you can simply create a symbolic link to it by:
Finally, try python
again:
Conclusion
Maybe I should read every release note carefully before I click UPGRADE NOW.
Reference
Last updated