首先到Python官网,点击Download Python 3.7.0
按钮。
进入到这个页面,点击下载对应mac的版本。下载成功后直接根据提示按钮
WechatIMG59.jpeg
安装完成,打开终端执行下面命令:
// 移除python2
sudo mv /usr/bin/python /usr/bin/python2
=> Password (让你输入你mac的密码)
// 查看python3安装路径
which python3
=> /usr/local/bin/python3
// 建立软链接
sudo ln -s /usr/local/bin/python3 /usr/bin/python
python
=> Python 3.7.0 (v3.7.0:1bf9cc5093, Jun 26 2018, 23:26:24)
=> [Clang 6.0 (clang-600.0.57)] on darwin
=> Type "help", "copyright", "credits" or "license" for more information.
=> >>>
就这么简单,python2.7升级到python3.7大功告成!
网友评论