mac电脑安装python3

  • 因为mac系统默认安装的是python2.7,所以有必要安装一下python3,教程如下:

1、先得安装xcode工具(如果默认没装的话)

xcode-select --install

若提示如下,则说明已安装过:

xcode-select: error: command line tools are already installed, use "Software Update" to install updates

可以通过如下命令查看安装路径:

xcode-select -p 

2、安装brew,到官网:https://brew.sh/index_zh-cn
copy安装指令,如下输入命令行

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
brew install python3

你可能感兴趣的:(macos,python3)