Mac系统自带python,不过版本是2.x的,我的系统python版本是2.7.10。
skdeMacBook-Air:~ Kevin$ python
Python 2.7.10 (default, Jul 15 2017, 17:16:57)
[GCC 4.2.1 Compatible Apple LLVM 9.0.0 (clang-900.0.31)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>>
接下来去官网下载最新版本的python3:https://www.python.org/
下完后直接打开安装包安装。
验证安装是否成功:打开终端输入python3,回车
skdeMacBook-Air:~ Kevin$ python3
Python 3.6.4 (v3.6.4:d48ecebad5, Dec 18 2017, 21:07:28)
[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>>
看到版本是3.6.4,说明安装成功。