本文介绍了Vim 无法在 OS X 上使用 python 进行编译的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在尝试在 ma​​c OS X 10.6 上编译支持 python 2.7vim 7.3.Vim 本身编译得很好,但嵌入式 python 没有那么多.

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.

我采取的步骤:

hg clone https:/vim.googlecode.com/hg/ vim
cd vim/src
./configure --without-x --disable-gui --disable-darwin
            --enable-pythoninterp --with-features=huge
make
make install

这给了我一个没有 python 的工作 vim.

That gives me a working vim but without python.

auto/config.log 表示存在文件错误:

configure:5387: checking if compile and link flags for Python are sane
configure:5404: gcc -o conftest -g -O2
     -I/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7
     -DPYTHON_HOME="/Library/Frameworks/Python.framework/Versions/2.7"
     -L/usr/local/lib conftest.c
     -L/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/config
     -lpython2.7 -ldl -framework CoreFoundation
     -u _PyMac_Error Python.framework/Versions/2.7/Python >&5
i686-apple-darwin10-gcc-4.2.1: Python.framework/Versions/2.7/Python: No such file or directory

<command-line>: warning: missing terminating " character
configure:5404: $? = 1
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME ""
| #define PACKAGE_TARNAME ""
| #define PACKAGE_VERSION ""
| #define PACKAGE_STRING ""
| #define PACKAGE_BUGREPORT ""
| #define PACKAGE_URL ""
| #define UNIX 1
| #define STDC_HEADERS 1
| #define HAVE_SYS_WAIT_H 1
| #define FEAT_HUGE 1
| #define USE_XSMP_INTERACT 1
| /* end confdefs.h.  */
|
| int
| main ()
| {
|
|   ;
|   return 0;
| }
configure:5408: result: no: PYTHON DISABLED

无论是否使用 --with-python-conf-dir 选项运行 configure,我都会收到此错误.看起来 -u _PyMac_Error Python.framework/Versions/2.7/Python 是问题的根源,但我不确定从哪里开始.

I get this error whether I run configure with or without the --with-python-conf-dir option. It looks like the -u _PyMac_Error Python.framework/Versions/2.7/Python is the source of the problem, but I'm not sure where to go from here.

有什么建议吗?

推荐答案

Romainl 给出了公认的答案:MacVim 带有命令行版本的 vim 以及 gui 版本 - 我就是不知道 - 我已经成功地用 Python 2.7 编译了 MacVim(没有我在标准 vim 源代码中遇到的任何问题).

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

使用 macports 或自制软件不是我考虑的选项.

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

注意如果有人可以将此答案分配给 Romainl,请继续这样做.我只是回答自己关闭这个.

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.

这篇关于Vim 无法在 OS X 上使用 python 进行编译的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-05 09:28