安装之前建议先下载xcode
里面会有很多工具,否则brew 安装会很蛋疼。
xcode-select --install
安装python3
brew install python3
查看当前python
which python3
移除python2,链接指向python3(这步可选)
sudo mv /usr/bin/python /usr/bin/python2
ln -s python /usr/local/bin/python3
sudo ln -s /usr/local/bin/python3 /usr/bin/python
最后测试一下
➜ ~ python
Python 3.6.3 (default, Oct 4 2017, 06:09:15)
[GCC 4.2.1 Compatible Apple LLVM 9.0.0 (clang-900.0.37)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>>