vscode使用code命令打开ide
出现下面报错:
/usr/local/bin/code: line 6: python: command not found
/usr/local/bin/code: line 10: ./MacOS/Electron: No such file or directory
原因m1/升级12.x 没有安装python,可手动安装python3
// 安装brew
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
// or
/bin/zsh -c "$(curl -fsSL https://gitee.com/cunkai/HomebrewCN/raw/master/Homebrew.sh)"
// 安装python3
brew install python@3.9
安装后需要替换/usr/local/bin/code
中python版本
但是由于code脚本是readonly,不好修改,可采用软链接的方式
ln -s /opt/homebrew/bin/python3 /opt/homebrew/bin/python
https://github.com/microsoft/vscode/issues/141738
https://zhuanlan.zhihu.com/p/512431942