修改 ~/.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

 

 

 

 

版权声明:本文为lijifei原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。
本文链接:https://www.cnblogs.com/lijifei/p/9541978.html