Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

python 2 support in vim

I am trying to set up YouCompleteMe, a code-completion plugin for vim. When I run vim, it gives me this error message: "YouCompleteMe unavailable: requires python 2.x". I have the correct version of python installed on my ubuntu machine and this confused me. After some research, I have found that I needed python2 support in vim, not just on my system (https://github.com/Valloric/YouCompleteMe/issues/35). How can I do this? I was unable to find a similar answer anywhere.

Thanks in advance for the help!

like image 652
Jlennon321 Avatar asked Oct 26 '13 01:10

Jlennon321


2 Answers

Try aptitude install vim-nox or aptitude install vim-gnome if you want the GUI. vim-python is a virtual package provided by either of these.

By default, Ubuntu has vim-tiny installed, which has a bunch of the options switched off.

like image 193
Christian Ternus Avatar answered Sep 30 '22 14:09

Christian Ternus


It means your need python2 support in vim, not just in your system. To test whether your vim support python, execute the following command:

vim --version | grep python

If you find "+python" in the output your vim support python2, "-python" means your vim don't support python2, you need recompile vim with python flag via the vim source.

On windows platform try the following command:

nmake -f Make_mvc.mak FEATURES=huge PYTHON=D:\Python27 PYTHON_VER=27 GUI=yes IME=yes

on Linux platform try the folowing command:

./configure --enable-pythoninterp --with-python-config-dir=/usr/lib/python2.6/config make make install

more details see:

compiling vim with python support

https://github.com/Valloric/YouCompleteMe/issues/35

like image 37
henices Avatar answered Sep 30 '22 13:09

henices