1、在终端中 获取python3的安装路径:which python
我的系统返回:/Library/Frameworks/Python.framework/Versions/3.8/bin/python3
2、在终端中 获取pip3的安装路径:which pip3
我的系统返回:/Library/Frameworks/Python.framework/Versions/3.8/bin/pip3
3、在终端中执行打开.bash_profile文件:open ~/.bash_profile
4、然后在文件中添加:
export PATH=${PATH}:/Library/Frameworks/Python.framework/Versions/3.8/bin/python3
alias python="/Library/Frameworks/Python.framework/Versions/3.8/bin/python3"
alias pip="/Library/Frameworks/Python.framework/Versions/3.8/bin/pip3"
请对应替换自己电脑的python3安装路径
5、关闭文件,在终端中执行:source .bash_profile
网友评论