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"
alias python="输入python3的路径 你自己本机路径可通过终端输入 which python3 查找" 
alias python2="输入python2的路径 你自己本机路径可通过终端输入 which python2.7 查找"
3. commond+R保存
 
4. 终端中重新读取.bash_profile文件
终端输入:source .bash_profile
5.终端输入python此刻可以发现 已经默认打开python3环境了
内容来源于网络如有侵权请私信删除
你还没有登录,请先登录注册
  • 还没有人评论,欢迎说说您的想法!