Mac下安装python3

安装之前建议先下载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.
>>>
最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容