Note: For Mountain Lion, see: How can I use the Homebrew Python with Homebrew MacVim on Mountain Lion?
I've installed Python 2.7 with Homebrew on Mac OS X Snow Leopard. When I install MacVim using brew install macvim
, it compiles with Python support, but is compiled against the system's Python installation. This can be seen by running the command:
:python print(sys.version)
2.6.1 (r261:67515, Jun 24 2010, 21:47:49)
[GCC 4.2.1 (Apple Inc. build 5646)]
However, Vim seems to be using the Python executable that's in my path:
:python print(sys.executable)
/usr/local/bin/python
This causes problems for Vim scripts using vim_bridge, such as vim-rst-tables (can't import module "re").
How can I compile Vim against my Homebrewed Python version?