美文网首页
MacOS 如何将python默认版本设为3.8

MacOS 如何将python默认版本设为3.8

作者: 大川的川 | 来源:发表于2021-06-21 15:20 被阅读0次

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

信息来源

相关文章

网友评论

      本文标题:MacOS 如何将python默认版本设为3.8

      本文链接:https://www.haomeiwen.com/subject/jipyyltx.html