【发布时间】:2011-09-23 08:20:24
【问题描述】:
我一直在尝试在 mac OS X 10.6 上使用 python 2.7 支持编译 vim 7.3。 Vim 本身编译得很好,但嵌入的 python 没有那么多。
我采取的步骤:
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
这给了我一个工作 vim 但没有 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 选项运行配置,我都会收到此错误。看起来-u _PyMac_Error Python.framework/Versions/2.7/Python 是问题的根源,但我不确定从这里去哪里。
有什么建议吗?
【问题讨论】:
-
我正在运行 10.6.7,而我拥有的最新的 Apple 提供的 python 是 2.6。你确定你安装了 2.7 并且它位于
System/Library/Frameworks/Python.framework/吗?如果你想使用不同的python,你可能需要在./configure时间提供它的路径,或者确保它是默认的python。不管怎样,MacVim 自带了一个功能齐全的命令行vim,你为什么不试试呢? -
Romaini, python 2.7 肯定安装在正确的位置,并且设置为 Current python。
./configure无论我是否提供路径,都无法通过 python 检查。_PyMac_Error位显然提供了导致问题的相对路径。我使用的是 MacVim,但我不知道我可以将 MacVim 作为命令行应用程序调用。它实际上解决了这个问题,因为我已经针对 Python 2.7 编译了它,它是当前的 Vim 7.3(mac 10.6 vim 是 7.2 - 这就是我开始走这条路的原因)。 -
这很酷。很抱歉,我无法帮助解决 Python 问题。我曾经走同样的路(使用一堆很酷的插件需要的 ruby)。在 MacVim 的包中发现
vim可执行文件一下子解决了很多问题。 -
Romainl,我想如果没有简单的答案,我可能最终会看看 MacVim 如何处理这个问题(他们必须做一些不同于标准 vim 的事情来处理 python 选项,因为MacVim 用 python 编译超级简单)。谢谢你的提示!如果您想正式回答这个问题,我们将以此为答案。正如 python 民间所说,“实用胜于纯粹”。
标签: python macos vim compilation