How can I make my default python homebrew?
Question: I've recently given up on macports and gone to homebrew. I'm trying to be able
to import numpy and scipy. I seem to have installed everything correctly, but
when I type python in terminal, it seems to run the default mac python.

I'm on OSX 10.8.4

I followed this post: [python homebrew by
default](http://stackoverflow.com/questions/5157678/python-homebrew-by-
default) and tried to move the homebrew directory to the front of my %PATH by
entering

    
    
    export PATH=/usr/local/bin:/usr/local/sbin:~/bin:$PATH
    

then "echo $PATH" returns

    
    
    /opt/local/bin:/opt/local/sbin:/opt/local/bin:/opt/local/sbin:/opt/local/bin:/opt/local/sbin:/opt/local/bin:/opt/local/sbin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/opt/X11/bin
    

however when I look for where my python is by "which python", I get

    
    
    /usr/bin/python
    

For some reason when I import numpy in interpreter it works but not so for
scipy.

    
    
    Python 2.7.2 (default, Oct 11 2012, 20:14:37) 
    [GCC 4.2.1 Compatible Apple Clang 4.0 (tags/Apple/clang-418.0.60)] on darwin
    Type "help", "copyright", "credits" or "license" for more information.
    >>> import numpy
    >>> import scipy
    Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
    ImportError: No module named scipy
    >>> 
    

What do I need to do to get python to run as my homebrew-installed python?
Should this fix my problem and allow me to import scipy?


Answer: Homebrew puts things in a `/usr/local/Cellar/<appname>` directory, if I'm not
mistaken. You should find the bin of the python in there and put it in your
path before hitting `/usr/bin`.

For example, on my 10.8, python is located at
`/usr/local/Cellar/python/2.7.5/bin` and I put that directory before
`/usr/bin/python` in my `PATH` variable.

I do that similarly for other instances of me wanting to use homebrew version
of an app, another example being sqlite.

