Mac 使用 brew 安装 Python3

# Mac 使用 brew 安装 Python3 Mac 默认环境已有 Python3.8 `/usr/bin/python3`, 这个无法删除 ## 安装 目前最新版本 Python3.9 ```sh brew install Python3 ``` ## 检查 命令行输入 `which python3`, 如果还是系统自带的,需要在`~/.zshrc`文件里或者其它终端的配置文件里修改`PATH`变量提高优先级。 ```sh # 添加这一行 export PATH="/opt/homebrew/bin:$PATH" ``` 执行 ```sh > brew doctor Your system is ready to brew. ``` 如果系统里手动安装过其它版本 Python3(不是通过 brew 安装的),建议删除,目录: - /Applications/Python3.x 版本号 - /Library/Frameworks/Python.framework/Version/x.x (版本号)

你可能感兴趣的:(Mac 使用 brew 安装 Python3)