如何使用brew安装的Python作为默认Python? [英] How do I use brew installed Python as the default Python?
问题描述
我尝试在Mac OS X 10.6.2上切换到Homebrew(在使用了fink和macport之后).我已经使用
I try to switch to Homebrew (after using fink and macport) on Mac OS X 10.6.2. I have installed python 2.7 with
brew install python
问题是,与Macport相反,似乎没有python_select实用程序,而我的默认mac python始终是默认的
The problem is that, contrary to Macport, it seems that there is no python_select utility, and my default mac python is always default
which python
给我
/usr/bin/python
和/usr/bin/python
不是符号链接
如何使python brew成为我的默认python?
How can I do to make python brew flavour to be my default python ?
推荐答案
在使用Homebrew时,以下命令可以提供更好的效果:
As you are using Homebrew the following command gives a better picture:
brew doctor
输出:
==>/usr/bin出现在/usr/local/bin之前,这意味着将使用系统提供的程序代替由 自制酒.如果您例如这是一个问题. brew安装了Python.
==> /usr/bin occurs before /usr/local/bin This means that system-provided programs will be used instead of those provided by Homebrew. This is an issue if you eg. brew installed Python.
请考虑编辑您的.bash_profile,以将:/usr/local/bin放在前面 /usr/bin在您的$ PATH中.
Consider editing your .bash_profile to put: /usr/local/bin ahead of /usr/bin in your $PATH.
这篇关于如何使用brew安装的Python作为默认Python?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!