/usr/local/bin/code: line 6: python: command not found

653 ワード

After updating my mac to version 12.3.1 this error showed up in terminal when I type 'code' command.
To solve this problem, first modify/Applications/Visual Studio Code.app/Contents/Resources/app/bin/code file like this.
- function realpath() { python -c ...
+ function realpath() { python3 -c ...
Then, go to the/usr/local/bin and remove the existing code file. Next, make a new symbolic link file with the file above.
ln -s "/Applications/Visual Studio Code.app/Contents/Resources/app/bin/code" /usr/local/bin/code
"code"command should work fine again.