1-下载python最新版本
下载python最新版本
如3.6版本 ,安装默认位置为: /Library/Frameworks/Python.framework/Versions/版本号/
2-打开终端,修改~/.bash_profile文件
export PATH=/Library/Frameworks/Python.framework/Versions/3.6/bin:${PATH}
source ~/.bash_profile
校验
$ python3
Python 3.6.5 (v3.6.5:f59c0932b4, Mar 28 2018, 03:03:55)
[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin
Type "help", "copyright", "credits" or "license" for more information.