使用python支持编译vim7.4源代码失败

使用python支持编译vim7.4源代码失败,python,vim,Python,Vim,我已经下载了vim7.4的源代码,并决定将vim升级到7.4。 但是,我无法为其添加python支持: ./configure --enable-pythoninterp --enable-rubyinterp --enable-gui=no --without-x --enable-cscope --enable-multibyte --prefix=/usr 在检查src/auto/config.log时,我发现: configure:5592: checking Python's c

我已经下载了vim7.4的源代码,并决定将vim升级到7.4。 但是,我无法为其添加python支持:

./configure  --enable-pythoninterp  --enable-rubyinterp --enable-gui=no --without-x --enable-cscope --enable-multibyte --prefix=/usr
在检查src/auto/config.log时,我发现:

configure:5592: checking Python's configuration directory
configure:5614: result:·
configure:5620: result: can't find it!
已安装的python信息:

dpkg-query -l python
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name                             Version                          Description
+++-================================-================================-   ================================================================================
ii  python                           2.7.3-0ubuntu2.2                 interactive high-level object-oriented language (default version)
在src dir中调用make后:

./vim --version | grep python
+cryptv          +linebreak       -python          +viminfo
+cscope          +lispindent      -python3         +vreplace
这似乎是因为vim无法找到python的config dir。如何修复它


提前感谢您的见解。

确保您安装了python开发包(我认为是python-devel或python-dev)。您可以通过向
/configure
传递以下内容来指定python配置目录:

--with-python-config-dir=/usr/lib64/python2.7/config
要查找配置目录(您可能需要先执行
updatedb
):


从错误消息中可以看出,您没有安装
python-dev

sudo apt-get install python-dev

这将解决您的问题

确保您已经安装了python开发包,并指向相应的
config
目录


例如:
/configure--enable pythoninterp--with python config dir=/usr/lib/python2.7/config

其他答案给出了正确的解决方案,即添加cli开关

--with-python-config-dir=/usr/lib/python2.7/config
此外,跑步也是个好主意

make clean distclean

对于我来说,如果不清理现有的构建,它将不会拾取我尝试添加的新配置--with python config dir=/usr/lib/python2.7/config到./configuration命令标志中。在make上遇到新问题:-I/usr/include/python2.7-DPYTHON_HOME='“/usr”'-pthread-fPIE-o objects/if_python.o if_python.c if_python.c:58:20:致命错误:python.h:没有终止此类文件或目录编译。make:**[objects/if_python.o]错误1~ 找到python | grep'/config$'/usr/lib/python2.7/config是否安装了python开发包?在Mac OS X上,在自制的python3上定位Python.h的输出是什么。我使用了命令'locate python3 | grep'/config$',但在终端上没有任何输出。下一步我能做什么@perreali运行
rm src/auto/config.cache&
,不要忘记
rm src/auto/config.cache
,否则如果在+1之前使用python2.6编译,您将得到“太旧”版本的python提示,这将为Vim需要的Python源代码安装头文件。可能的重复文件似乎丢失了
Python dev
make clean distclean