12

I have python3 installed via homebrew: brew install python3 --framework

I have the vim source (7.3) downloaded in /usr/src

I run:

./configure --prefix=/usr/local --enable-rubyinterp --enable-python3interp --disable-gpm --enable-gui=no --enable-multibyte

And in my src/auto/config.log I see:

configure:5442: checking --enable-python3interp argument   
configure:5451: result: yes  
configure:5456: checking for python3  
configure:5489: result: no

I googled around some, and found this, so I tried making the symlink for python3.2 and then running configure like this:

./configure --prefix=/usr/local --enable-rubyinterp --enable-python3interp --disable-gpm --enable-gui=no --enable-multibyte --with-python3-config-dir=/usr/local/Cellar/python3/3.2/Frameworks/Python.framework/Versions/3.2/lib/python3.2/config-3.2m

And my log shows the same error. What do I need to do to get vim compiled with Python3 support?

And no: I do not want to use MacVim.


➜ ls -al /System/Library/Frameworks/Python.framework/Versions 
total 16
drwxr-xr-x   7 root  wheel  238 May 28 15:33 .
drwxr-xr-x   7 root  wheel  238 Sep 21  2010 ..
drwxr-xr-x   8 root  wheel  272 Sep 17  2010 2.3
drwxr-xr-x  12 root  wheel  408 Dec  1 12:49 2.5
drwxr-xr-x  12 root  wheel  408 Dec  1 12:49 2.6
lrwxr-xr-x   1 root  wheel   70 May 28 15:33 Current -> /usr/local/Cellar/python3/3.2/Frameworks/Python.framework/Versions/3.2
lrwxr-xr-x   1 root  wheel    3 Sep 17  2010 old-Current -> 2.6

➜ which python3.2
/usr/local/bin/python3.2

UPDATE: I've gotten it working a la this post with Python 2.7.1 via Homebrew, but still no joy with Python 3...

3 Answers 3

6

There is a problem with the configure script. Since python 3.2 the config and include directories get the abiflag included (see PEP 3149).

The next problem is that the configure script parses the python config and the flags for the linker are not correct for a framework build, so the test program from the configure script fails to build.

I already send a patch to vim and it got included (the mercurial repo has it).

`./configure --enable-python3interp vi_cv_path_python3=/usr/local/bin/python3.2`

should work.

Vim Patch: https://github.com/codedreality/vim/tree/fix-python3x-support

MacVim Patch: https://github.com/codedreality/macvim/tree/fix-python3x-support

Sign up to request clarification or add additional context in comments.

3 Comments

link for Vim Patch is broken. Any suggestions?
path link is still broken for me too. Please suggest something as this is still broken
Post and Patch is from 2011, maybe something has changed in vim since then and needs to be patched again and homebrew has changed a lot for python to support builds for 2.x and 3.x.
2

When you test to see if it worked, make sure you use the Vim binary created by the build - not the mvim script. mvim (even if you call the version on your source tree) will look in /Applications/ for MacVim.app first.

Maybe this will give you some joy:

./configure \
  --enable-python3interp=dynamic \
  --with-python3-config-dir=/usr/local/Cellar/python3/3.2/Frameworks/Python.framework/Versions/3.2/lib/python3.2/config/

3 Comments

No joy. I get the same errors in my log: checking --enable-python3interp argument... dynamic / checking for python3... no. Also, I know I'm checking the right binary: (in vim src directory) ➜ ./src/vim --version.
Try forcing the python version lookup using the autoconf variable. ./configure --enable-python3interp=dynamic --with-python3-config-dir=blah/blah vi_cv_path_python3=/usr/local/bin/python3.2
No, that doesn't work either. It seems to pick it up in the config output (gist.github.com/1014434), but the variables aren't defined in /src/auto/config.mk (gist.github.com/1014435) and the compiled binary still reads -python3. Any other thoughts?
0

I change the macvim titlebar color is black.My macvim colorsechme is ayu dark. Change macvim MMWindow.m line 93,append following code:

[self setTitleVisibility:NSWindowTitleHidden];
[self setTitlebarAppearsTransparent:YES];
self.backgroundColor = NSColor.blackColor;

Complier source code with following command:

./configure --with-features=huge --enable-multibyte --with-macarchs=x86_64 --enable-perlinterp --enable-rubyinterp --enable-tclinterp --enable-terminal --enable-python3interp --with-properly-linked-python2-python3 --enable-python3interp=yes --enable-cscope 

enter image description here

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.