MAC 的python默认版本2.7
把默认版本切换为python3
执行以下命令:
1、在终端输入:open .bash_profile
2、在打开的.bash_profile文件输入:
alias python="/Library/Frameworks/Python.framework/Versions/3.6/bin/python3.6"
3、关闭.bash_profile
4、在终端输入:source ~/.bash_profile
本文介绍如何在Mac上将Python的默认版本从2.7切换到Python 3.6。通过编辑.bash_profile文件并添加指定路径的命令来实现版本切换。
MAC 的python默认版本2.7
把默认版本切换为python3
执行以下命令:
1、在终端输入:open .bash_profile
2、在打开的.bash_profile文件输入:
alias python="/Library/Frameworks/Python.framework/Versions/3.6/bin/python3.6"
3、关闭.bash_profile
4、在终端输入:source ~/.bash_profile
1573

被折叠的 条评论
为什么被折叠?