Question or problem about Python programming:
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
The problem is that, contrary to Macport, it seems that there is no python_select utility, and my default mac python is always default
and /usr/bin/python is not a symlink
How can I do to make python brew flavour to be my default python ?
How to solve the problem:
As you are using Homebrew the following command gives a better picture:
==> /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.
$ brew link --overwrite python Linking /usr/local/Cellar/python/2.7.3... 28 symlinks created $ which python /usr/local/bin/python
As suggested by the homebrew installer itself, be sure to add this to your
- Change the order of the lines (highest priority on top)
In my case
/etc/paths looks like:
/usr/local/bin /usr/local/sbin /usr/bin /bin /usr/sbin /sbin
If you want to know more about paths in OSX I found this article quite useful:
I did “brew install python” for OSX High Sierra. The
/usr/local/bin before any other path but still
which python was pointing to the system’s python.
When I looked deeper I found that there is no python executable at
/usr/local/bin. The executable is named
python2. To fix this problem create a symbolic link
python pointing to
/usr/local/bin $: ln -s python2 python