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?
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With