Reference from: https://blog.csdn.net/Tyro_java/article/details/78510301
Use homebrew, BerkeleyCS61B classroom teacher recommended https://sp19.datastructur.es/#cal
1. Open the file (empty directly write)
vi ~ / .bash_profile
2. Modify the contents
alias python2="/usr/bin/python"
alias python3="/usr/local/bin/python3"
alias python=python3
3. This must be done (with the entry into force)
source ~/.bash_profile
ps: 2 then switch back
alias python2="/usr/bin/python"
alias python3="/usr/local/bin/python3"
alias python=python2