A Weird Python Command Not Found Problem
I met a weird problem with the following output:
pyenv: python: command not found
The `python' command exists in these Python versions:
Note: See 'pyenv help global' for tips on allowing both
python2 and python3 to be found.
What happened??? I just took a nap and turned my computer back on, why did python get lost???
Ok... Let me check these paths:
$ ls /usr/bin /usr/local/bin | grep python
At that moment, I started to recall if I did anything stupid which removed the system
- 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:
sudo ln -s /opt/homebrew/bin/python3 /usr/local/bin/python
Python 3.9.12 (main, Mar 26 2022, 15:44:31)
[Clang 13.1.6 (clang-13184.108.40.206)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
Maybe I should read every release note carefully before I click UPGRADE NOW.