Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to solve "requires python 2.x support" in linux vim,and it have python 2.6.6 in my system

Tags:

python

linux

vim

[root@localhost bin]# python -V
Python 2.6.6
[root@localhost bin]# ./vim
UltiSnips requires py >= 2.6 or any py3
YouCompleteMe unavailable: requires Vim compiled with  Python 2.x support

i have try it in centos 6.4 ,and fedora 20. It's the same problem. i am new coder ,i really do not know why it happen.

like image 372
Firemky Avatar asked Nov 23 '13 09:11

Firemky


1 Answers

Neovim? Anyone?

Getting set up with neovim and ycm

Installation

On arch, for example, yaourt -S python-neovim

Basically, you need python support.

Setting up neovim

mkdir -p ~/.config/nvim/bundle/Vundle.vim/
cp ~/.vimrc ./init.vim
git clone https://github.com/VundleVim/Vundle.vim.git
git clone 
nvim ~/.config/nvim/init.vim # edit nvim init file (using nvim, **of course** :)

Using vundle to manage YCM:

Hopefully, you are still inside you ~/.config/nvim/init.vim ... add these lines in order to add Vundle and You Complete Me (YCM) plugins:

set nocompatible
filetype off
set rtp+=~/.config/nvim/bundle/Vundle.vim
call vundle#begin('~/.config/nvim/bundle')
Plugin 'VundleVim/Vundle.vim'
Plugin 'Valloric/YouCompleteMe'
call vundle#end()
filetype plugin indent on

NOTE
All of the above lines are required (with the exception of Plugin 'vundleVim/Vundle.vim' as that just tells vundle to manage itself for updates).

Now run these commands inside nvim/vim to (1) source the current file and (2) install all the plugins with vundle.

:so %
:PluginInstall

Last step: compiling YCM

We need one last step for YCM. (Usually, you do not need to do this with Plugins as they will use vimL or something. However, YCM needs something a bit faster, so we need to do a little something more.)

cd ~/.config/nvim/bundle/YouCompleteMe/
python2 install.py

All done!
:)

Getting set up in vim instead

meh

If you insist, simply put all of vundle's things inside ~/.vim/bundle/ and then use

set nocompatible
filetype off
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin('~/.vim/bundle')
Plugin 'VundleVim/Vundle.vim'
Plugin 'Valloric/YouCompleteMe' " if on arch, I recommend installing vim-youcompleteme-git
call vundle#end()
filetype plugin indent on

inside your ~/.vimrc. Note the difference in the set rtp+= AND the call vundle#begin ... in vim and nvim, they point to different directories.

like image 167
dylnmc Avatar answered Oct 27 '22 18:10

dylnmc