mac上自帶的是是Python版本2.X,若是須要Python3,則須要本身手動進行安裝html
能夠在終端查看本身的Python版本python
$ python -V 輸出: Python 2.7.10
1.搜索 python 的下載頁面, https://www.python.org/downloads/mac-osx/mysql
找到最新的版本3.6.3sql
下載完成後,點擊安裝文件,一直點擊繼續進行安裝就OK👌,安裝完成後,能夠在終端查看版本。markdown
$ python3 -V 輸出: Python 3.6.3
Launchpad中會多了兩個APPapp
2.終端啓動不一樣版本的Python解釋器,輸入 exit() 或 Ctrl+d 退出ui
啓動Python2.Xorm
$ 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.Xhtm
$ python3 輸出: Python 3.6.3 (v3.6.3:2c5fed86e0, Oct 3 2017, 00:32:08) [GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>>
1.安裝Homebrew,能夠看我之前的博客,連接:HomeBrew的安裝blog
2.Homebrew安裝完成後,以後就是安裝Python3
先搜索:
$ brew search python 輸出: app-engine-python micropython python3 boost-python python wxpython gst-python python-markdown zpython Caskroom/cask/awips-python Caskroom/cask/mysql-connector-python Caskroom/cask/kk7ds-python-runtime
安裝Python3,等待......
$ brew install python3
安裝完成後,具體路徑是:/usr/local/Cellar/python3/3.6.0,能夠在finder中前往,
你能夠經過如下命令把軟件連接到LaunchPad中。以後就能夠在LaunchPad中啓動軟件了。
$ brew linkapps python3