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,說明安裝成功。