Skip to content Skip to sidebar Skip to footer

Vim Failing To Compile With Python On Os X

I've been trying to compile vim 7.3 with python 2.7 support on mac OS X 10.6. Vim itself compiles fine, but the embedded python not so much. The steps I've taken: hg clone https:

Solution 1:

Turns out the bug is actually in the Python Makefile, believe it or not.

Open the file

/usr/local/Cellar/python/2.7.2/Frameworks/Python.framework/Versions/2.7/lib/python2.7/config

or whatever the appropriate path is for you, and search for PyMac_Error. It should be on the line defining LINKFORSHARED, and on this line you need to change PYTHONFRAMEWORKDIR to PYTHONFRAMEWORKINSTALLDIR. Then go back to your vim source and ./configure, everything should go smooth.

Also make sure you symlink OS X's Python Frameworks to the ones in the Homebrew Cellar:

/Library/Frameworks/Python.framework/Versions/2.7/Library/Frameworks/Python.framework/Versions/Current/System/Library/Frameworks/Python.framework/Versions/2.7/System/Library/Frameworks/Python.framework/Versions/Current

should all point to

/usr/local/Cellar/python/2.7.2/Frameworks/Python.framework/Versions/2.7

Not really sure why I had it in so many places, or if that's bad, but there it is.

Solution 2:

It's not a straight answer to your question, but installing macports and running sudo port install vim +python27 is one way to get there.

Solution 3:

Romainl gave the accepted answer: MacVim comes with a command-line version of vim as well as the gui version - something I was not aware of - and I had already successfully compiled MacVim with Python 2.7 (without any of the problems I ran into with the standard vim sources).

Using macports or homebrew was not an option I was looking at.

N.B. if anyone can asign this answer to Romainl, please go ahead and do so. I'm only answering myself to close this one off.

Post a Comment for "Vim Failing To Compile With Python On Os X"