修改 ~/.bash_profile 文件
查看python3安装路径
which python3 /Library/Frameworks/Python.framework/Versions/3.7/bin/python3.7
编辑~/.bash_profile
vi ~/.bash_profile按i进入编辑模式
添加PATH,alias
#add PATH export PATH=${PATH}:/Library/Frameworks/Python.framework/Versions/3.7/bin #alias python alias python2='/Library/Frameworks/Python.framework/Versions/2.7/bin/python2.7' alias python3='/Library/Frameworks/Python.framework/Versions/3.7/bin/python3.7' alias python=python3 #alias pip alias pip='/Library/Frameworks/Python.framework/Versions/3.7/bin/pip3'
保存~/.bash_profile
esc退出编辑模式 :wq保存
生效~/.bash_profile
source ~/.bash_profile