使用 Python3(通过 Homebrew 安装)支持编译 vim?

发布于 2024-11-10 13:34:27 字数 1796 浏览 4 评论 0原文

我通过 homebrew 安装了 python3: brew install python3 --framework

我在 /usr/src 下载了 vim 源代码(7.3)

我运行:

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

在我的 中src/auto/config.log 我明白了:

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

我用谷歌搜索了一些,发现这个,所以我尝试制作python3.2 的符号链接,然后像这样运行配置:

./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

我的日志显示相同的错误。我需要做什么才能编译 vim 支持 Python3?

不:我不想使用 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

更新:我已经按照这篇文章使用了通过 Homebrew 的 Python 2.7.1,但仍然对 Python 3 不满意......

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...

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

記憶穿過時間隧道 2024-11-17 13:34:27

配置脚本有问题。从 python 3.2 开始,config 和 include 目录包含 abiflag(请参阅 PEP 3149)。

下一个问题是配置脚本解析 python 配置,并且链接器的标志对于框架构建不正确,因此配置脚本中的测试程序无法构建。

我已经向 vim 发送了一个补丁并且它被包含在内(mercurial repo 有它)。

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

应该有效。

Vim 补丁:
https://github.com/codedreality/vim/tree/fix-python3x-support MacVim

补丁:
https://github.com/codedreality/macvim/tree/fix-python3x-support

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

初见 2024-11-17 13:34:27

当您测试它是否有效时,请确保使用构建创建的 Vim 二进制文件 - 而不是 mvim 脚本。 mvim(即使您在源代码树上调用该版本)将首先在 /Applications/ 中查找 MacVim.app。

也许这会给你带来一些快乐:

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

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/
云淡风轻 2024-11-17 13:34:27

我将 macvim 标题栏颜色更改为黑色。我的 macvim 颜色是 ayu dark。
更改 macvim MMWindow.m 第 93 行,添加以下代码:

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

使用以下命令编译源代码:

./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 

在此处输入图像描述

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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文