gpt4 book ai didi

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

转载 作者:太空狗 更新时间:2023-10-29 18:06:51 26 4
gpt4 key购买 nike

我通过自制软件安装了 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

我用谷歌搜索了一些,找到了 this ,所以我尝试为 python3.2 创建符号链接(symbolic link),然后像这样运行配置:

./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 上像 this post 一样工作了,但仍然不喜欢 Python 3...

最佳答案

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

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

我已经向 vim 发送了一个补丁,它被包含在内(mercurial 仓库有它)。

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

关于python - 使用 Python3(通过 Homebrew 安装)支持编译 vim?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6164008/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com