美文网首页
mac下python2与python3并存的设置方法

mac下python2与python3并存的设置方法

作者: 归海听雪 | 来源:发表于2020-03-13 22:20 被阅读0次

原来mac下已经安装了python2,如果升级到python3后,想设置默认的python变成python3的方法

vim ~/.bash_profile 再后面追加

alias python="/Library/Frameworks/Python.framework/Versions/3.7/bin/python3.7"

执行以下命令,或者重启系统

source ~/.bash_profile

然后执行

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.


相关文章

网友评论

      本文标题:mac下python2与python3并存的设置方法

      本文链接:https://www.haomeiwen.com/subject/efukdhtx.html