1.安装 Brew
请参考先前文字,略
2.安装 Python
安装指定版本在后面加 @
例如:
brew install python@3.8
brew install python@3.9
brew install python@3.10
brew install python@3.11
要是想卸载就把 install 改成 uninstall 即可。
如果想更新就输入brew update && brew upgrade
。
3.打开Pycharm
新建项目或者打开项目设置。
找到 Python 解释器一览,如图设置,选择Virtualenv
。
基础解释器那一览的路径为 /opt/homebrew/bin/python3.xx
。
不建议使用 Conda 进行管理。