Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Compile vim7.4 source code with python support failed

Tags:

python

vim

I have download the source code of vim7.4 and decide to upgrade the vim to 7.4. However, I can not add python support to it:

./configure  --enable-pythoninterp  --enable-rubyinterp --enable-gui=no --without-x --enable-cscope --enable-multibyte --prefix=/usr

While checking src/auto/config.log, I found:

configure:5592: checking Python's configuration directory
configure:5614: result:·
configure:5620: result: can't find it!

Installed python info:

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)

After invoking make in the src dir:

./vim --version | grep python
+cryptv          +linebreak       -python          +viminfo
+cscope          +lispindent      -python3         +vreplace

It seems that it's caused by vim unable to locate the config dir for python. How to fix it?

Thanks for your insights in advance.

like image 379
FaceBro Avatar asked Aug 22 '13 01:08

FaceBro


3 Answers

Make sure you have the python development packages installed (python-devel or python-dev I think). You can specify the python config directory by passing, to ./configure, something like:

--with-python-config-dir=/usr/lib64/python2.7/config

To find the config directory (you may need to do updatedb first):

locate python | grep '/config$'
like image 103
perreal Avatar answered Oct 17 '22 21:10

perreal


From your error messages you don't have python-dev installed

sudo apt-get install python-dev

this should fix your problem

like image 44
number5 Avatar answered Oct 17 '22 21:10

number5


Make sure you have installed the development packages for python and point towards the appropriate config directory.

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

like image 25
Battleroid Avatar answered Oct 17 '22 21:10

Battleroid