7

I install YouCompleteMe and UltiSnips plugins in my neovim. Normally, everything is ok.

But I am using MiniConda in my python developing, MiniConda is something like virtualenv, I have a virtual python env called parser, when I activate this virtualenv with source activate parser, something is wrong:

YouCompleteMe unavailable: requires Vim compiled with Python 2.x support
UltiSnips requires py >= 2.7 or py3
Press ENTER or type command to continue

so the problem is neovim can not find python properly, I am confused why virtualenv affect neovim?

roger
  • 9,063
  • 20
  • 72
  • 119

2 Answers2

3

As @Alex mentioned in comments pip install neovim solves the problem.

Sassan
  • 2,187
  • 2
  • 24
  • 43
1

If Neovim finds python on your $PATH, it assumes this is Python 2 (and likewise for python3 being treated as Python 3). If you start Neovim from a shell with an activated Conda env that uses Python 3, you're going to have problems because the conda env exposes a binary called python, but which is really 3 and not 2. Because of this, you will have to use the Neovim option of setting g:python_host_prog to point to a valid Python 2, into which you must also have pip installed the required neovim client.

Possible solution (I have tested myself using anaconda):

# neovim init.vim file cmd
# runs python3 for neovim from a specific env
# should resolve the need for neovim in each new python env when using nvim
# add the following to your init.vim file
let g:python3_host_prog = '/path/to/anaconda3/bin/python'

add this in your .vimrc or ginit.vim (neovim GUI configuration file).

Yossarian42
  • 1,950
  • 17
  • 14