python - 如何使用 brew 安装的 Python 作为默认 Python?

我尝试在 Mac OS X 10.6.2 上切换到 Homebrew(在使用 fink 和 macport 之后)。我已经用

安装了 python 2.7
brew install python 

问题是,与Macport相反,好像没有python_select实用程序,而我的默认mac python总是默认的

which python

给我

/usr/bin/python

并且 /usr/bin/python 不是符号链接(symbolic link)

如何让 python brew flavor 成为我的默认 python?

最佳答案

当您使用 Homebrew 时,以下命令可以提供更好的画面:

brew doctor

输出:

==> /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.

Consider editing your .bash_profile to put: /usr/local/bin ahead of /usr/bin in your $PATH.

https://stackoverflow.com/questions/5157678/

相关文章:

linux - 查找 -exec cmd {} + vs | xargs

linux - 使用命令行在启动后重定向进程的 STDERR/STDOUT?

python - "this"模块的源代码是做什么的?

python - 解释 Python 入口点?

python - 何时以及为什么应该使用命名元组而不是字典?

linux - 如何在文件中搜索多行模式?

c - Linux 中多线程的信号处理

linux - 如何将多行输出连接到一行?

python - 使用 setup.py 包含非 Python 文件

linux - 如何清空 ("truncate")Linux上已经存在并以某种方式受到保护的文件?