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

原来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并存的设置方法)