UltiSnips requires py >= 2.6 or any py3

11,547

Solution 1

You don't provide much information to help. You can check whether your Vim has Python via :py print "yes". For the Python version, check the :version output. It will contain something like -lpython2.7.

When you compile Vim yourself, you need to enable the Python integration by passing ./configure --enable-pythoninterp.

Solution 2

I had the same problem with NeoVim on Ubuntu. Running :CheckHealth pointed me into the right direction. Creating the following softlink solved the problem for me:

sudo ln -s /usr/bin/python /usr/local/bin/python

Solution 3

Maybe obvious to most, but not to me was the fact that the neovim module had to be installed. On ubuntu, installing it using pip did the trick for me:

sudo pip3 install neovim

To install the module for python 3, I suppose pip3 has to exchanged for pip for python 2.

Solution 4

Download the source code from http://www.vim.org/. Then

  1. cd vim
  2. make clean
  3. ./configure --prefix=/opt/local --with-features=huge --enable-pythoninterp=yes --enable-multibyte --with-vim-name=vim --with-python-config-dir=/usr/lib/python2.7/config-x86_64-linux-gnu
  4. make
  5. sudo make install
Share:
11,547
Katsu
Author by

Katsu

Updated on June 12, 2022

Comments

  • Katsu
    Katsu almost 2 years

    I'm trying to install UltiSnips in different way but the same message appears each time when I launch vim. Python 2.7 is installed but it seems that vim has been installed before the 2.7 version.

    I tryed to reinstall vim using this link:

    $ sudo apt-get install mercurial libssl-dev
    $ sudo apt-get build-dep vim
    $ hg clone http://hg.debian.org/hg/pkg-vim/vim
    $ cd vim
    $ hg checkout unstable
    $ debian/rules update-orig
    $ dpkg-buildpackage -i -I
    $ cd ..
    

    But the same problem remains. Thanks

  • Katsu
    Katsu over 10 years
    Vim has not python -lpython doesn't appears and :py command does not recognize. I tried to reinstall (download into vim dir and make install) but same thing.
  • Ingo Karkat
    Ingo Karkat over 10 years
    Then ./configure probably doesn't detect Python, or are you building the tiny version of Vim (which doesn't have any language integrations)? Why don't you just use the default Vim packages of your distribution? At least on Ubuntu, the default Vim packages come with Python support.
  • Katsu
    Katsu over 10 years
    Because it's a group account (work computer) created quickly on Debian. Now it's work. I had to add option on ./configure --enable-pythoninterp --with-python-config-dir=/usr/lib/python2.7/config
  • Ingo Karkat
    Ingo Karkat over 10 years
    Yes, that invocation is missing in your question; glad you've figured it out!
  • l0o0
    l0o0 almost 8 years
    After installing vim-gtk-py2, the error message is gone.