Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

homebrew macvim with python2.7.3 support not working

I installed macvim with homebrew, with python support. My incantation was as follow:

brew install macvim --override-system-vim

Now when I open a python file, I get a series of errors if I try to import anything. e.g. if I import re I see ImportError: no module name re.

The first time I open macvim after installing, I get 'import site' failed; use -v for traceback in the terminal where I opened macvim. This is after running my first python command.

What does this mean and and how do I fix it?

like image 389
Maus Avatar asked Jun 21 '12 23:06

Maus


1 Answers

I got this working with a quick hack where you temporarily point the system python to your preferred python:

cd /System/Library/Frameworks/Python.framework/Versions
sudo mv Current Current-sys
sudo mv 2.7 2.7-sys
sudo ln -s /usr/local/Cellar/python/2.7.9/Frameworks/Python.framework/Versions/2.7 Current
sudo ln -s /usr/local/Cellar/python/2.7.9/Frameworks/Python.framework/Versions/2.7 2.7

brew rm macvim # optionall, only if you had it installed previously  
brew install macvim --override-system-vim

sudo mv Current-sys Current
sudo mv 2.7-sys 2.7
like image 118
Dean Avatar answered Sep 24 '22 10:09

Dean