1.打开终端,输入:vim ~/.bash_profile
2.在该文件添加:
alias python="/usr/local/bin/python3.X"
alias pip="/usr/local/bin/pip3.X"
3.重启终端,输入:source ~/.bash_profile
4.重启终端,输入:vim ~/.zshrc
5.在该文件添加:source ~/.bash_profile
mac 设置默认的python 关闭终端后再次打开仍是python3
原文:https://www.cnblogs.com/astroboyliu/p/14881357.html