mac系统默认python3.6
1. 终端打开.bash_profile文件
终端输入:open ~/.bash_profile
2. 打开.bash_profile文件后在内容最后添加
alias python="/Library/Frameworks/Python.framework/Versions/3.6/bin/python3.6"
alias python2="/usr/bin/python2.7"
![](https://images2018.cnblogs.com/blog/1419240/201808/1419240-20180808211639699-1472430846.png)
alias python="输入python3的路径 你自己本机路径可通过终端输入 which python3 查找"
alias python2="输入python2的路径 你自己本机路径可通过终端输入 which python2.7 查找"
3. commond+R保存
4. 终端中重新读取.bash_profile文件
终端输入:source .bash_profile
5.终端输入python此刻可以发现 已经默认打开python3环境了