Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Support doesn't work

Tags:

python

neovim

I'm trying to use neovim with deoplete and UtilSnips. Both requires Python support from nvim.

I followed the instructions in :help nvim_python to set the support but the output of :echo has('python') or :echo has('python3') are both 0.

On nvim-startup I get the message UltiSnips requires py >= 2.7 or py3 and for deoplete It requires Neovim with Python 3 support ("+python3").

My python (2.7.10) and python3 (3.4.3) are both installed with homebrew. The neovim module is installed over pip and pip3 with install neovim but nvim can't find it, even when I set the let g:python_host_prog path in nvimrc.

I don't know what I am able to do anymore, has anyone an idea whats wrong with it?

like image 915
hueby Avatar asked Aug 09 '15 08:08

hueby


People also ask

Why won't an app open?

Check for Android UpdatesThe app might be too new for your current version of Android. Check if there are any pending system updates on your phone. Install them before trying to rerun the app. To see if you have any system updates waiting in the wings, drag the app-shade down and open the settings menu.

Why can't I make in-app purchases iPhone?

Make sure that you're signed in with the same Apple ID that you used to make the purchase. Make sure that in-app purchases are allowed on your device. Restart your device: Restart your iPhone.


4 Answers

Please follow the instruction on https://neovim.io/doc/user/provider.html#provider-python to setup the python interpreter for neovim.

First, install pynvim (previously, it was named neovim, but that has been changed) plugin

pip3 install pynvim

Print g:loaded_python3_provider

echo g:loaded_python3_provider
" for python 2.x use the following
" echo g:loaded_python_provider

If it returns 1, the python is not setup for neovim. In your ~/.config/nvim/init.vim file, set the python interpreter

let g:python3_host_prog='/path/to/python3'
" for python2, use the following instead
"let g:python_host_prog = '/path/to/python2.7'
like image 161
VforVitamin Avatar answered Oct 12 '22 13:10

VforVitamin


I encountered the same problem lately. Here are the steps adapted from answer of @VforVitamin where I made it working.

Assuming python2 and python3 are installed.

  1. Install neovim plugin pip3 install neovim.
  2. Open neovim.
  3. Execute command :UpdateRemotePlugins.
  4. Restart neovim.
like image 33
Alex Ho Avatar answered Oct 12 '22 15:10

Alex Ho


I had the issue myself because I used neovim inside virtualenv. If so, make sure to pip install neovim inside your virtualenv, and make sure that import neovim works in the python interpreter.

If that doesn't help, you can try and run neovim with debug messages (neovim -V3, or any other logging level) and see what you can pick from there.

like image 20
Beka Avatar answered Oct 12 '22 14:10

Beka


I bet you have a line in your init file that starts with "set runtimepath=". Change it to "set runtimepath+="

like image 23
rstnd Avatar answered Oct 12 '22 14:10

rstnd