在Mac OSX Lion 10.7.5上将python3.2设置为默认值而不是python2.7 [英] Setting python3.2 as default instead of python2.7 on Mac OSX Lion 10.7.5
本文介绍了在Mac OSX Lion 10.7.5上将python3.2设置为默认值而不是python2.7的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
当前正在运行Mac OS X Lion 10.7.5,并且它的默认设置为python2.7.在终端中,我输入"python",它会自动拉起python2.7.我不要
Currently running Mac OS X Lion 10.7.5 , and it has python2.7 as default. In the terminal, i type 'python' and it automatically pulls up python2.7. I don't want that.
键入'python3.2'.
from terminal I have to instead type 'python3.2' if i want to use python3.2.
我该如何更改?
推荐答案
最安全的方法是在~/.bashrc
中设置别名:
The safest way is to set an alias in ~/.bashrc
:
alias python=python3
这样,您可以避免破坏在python
作为python2上中继的脚本的事情.
That way you avoid breaking things for scripts relaying on python
being python2.
这篇关于在Mac OSX Lion 10.7.5上将python3.2设置为默认值而不是python2.7的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文