2
votes

I use Neovim on Arch Linux with python-neovim and python3-neovim installed for Python support. Until last update of the python-clients for neovim everything worked well. I particular use the Unite Plugin which needs Python support.

After the new version of python clients for neovim were installed Python support seemed to have broken.

echo g:loaded_python_provider

returns 1 and Unite throws the following exception:

function <SNR>51_call_unite..unite#start..unite#start#standard..unite#init#_current_unite..remote#define#CommandBootstrap..remote#host#Require..<SNR>56_RequirePythonHost, line 15                                                             
Vim(if):Channel was closed by the client                                                                                                                                                                                                       
Error detected while processing function <SNR>51_call_unite..unite#start..unite#start#standard..unite#init#_current_unite..remote#define#CommandBootstrap..remote#host#Require..<SNR>56_RequirePythonHost:                                     
line   22:                                                                                                                                                                                                                                     
E605: Exception not caught: Failed to load python3 host. You can try to see what happened by starting Neovim with the environment variable $NVIM_PYTHON_LOG_FILE set to a file and opening the generated log file. Also, the host stderr will b
e available in Neovim log, so it may contain useful information. See also ~/.nvimlog.

However, I figured out that python works well within neovim by trying

:python print "Hello"

and

:python3 print("Hello")

I also tried to manually set the python host by using python_host_prog. However this didn't change anything.

UPDATE:

In the meantime the error message has slightly changed and contains the python exception. Furthermore, I found out that there was an issue on my machine with the update of packages when I upgraded python3.4 to 3.5. Some packages linked. They were incorrectly linked between the two versions. Nonethelles, a complete reinstall of neovim and the python api-bindings did also not solve the problem.

function <SNR>51_call_unite[33]..unite#start[1]..unite#start#standard[39]..unite#init#_current_unite[97]..remote#define#CommandBootstrap":                                                                          
 Zeile 5:                                                                                                                                                                                                                                    
 no request handler registered for "/home/cutuchiqueno/.vim/plugged/unite.vim/rplugin/python3/unite.py:command:UniteInitializePython"                                                                                                           
 Encountered ImportError loading plugin at /home/cutuchiqueno/.vim/plugged/unite.vim/rplugin/python3/unite.py: No module named 'unite'                                                                                                          
 Traceback (most recent call last):                                                                                                                                                                                                             
 File "/usr/lib/python3.5/site-packages/neovim/plugin/host.py", line 118, in _load                                                                                                                                                            
 file, pathname, descr = find_module(name, [directory])                                                                                                                                                                                     
 File "/usr/lib/python3.5/site-packages/neovim/compat.py", line 29, in find_module                                                                                                                                                            
 return original_find_module(fullname, path)                                                                                                                                                                                                
 File "/usr/lib/python3.5/imp.py", line 296, in find_module                                                                                                                                                                                   
 raise ImportError(_ERR_MSG.format(name), name=name)                                                                                                                                                                                        
 ImportError: No module named 'unite'
1
:python3 print "Hello" Did this work? It's not valid python 3 code. - Håken Lid
Make sure you have the python3.5 version of the neovim bindings installed. pip install neovim and have the python3 path set up correctly in your .vimrc let g:python3_host_prog = '/path/to/python3' - Håken Lid
@Håken Lid no, you are completely right, I did it correctly in the test but copied and pasted it incorrectly here. I corrected it in the post - Cutú Chiqueño
@@Håken Lid so, I added let g:python3_host_prog = '/path/to/python3' and let g:python_host_prog = '/path/to/python2' to my init.vim but there is no change in the behaviour, the error mesage is still the same. - Cutú Chiqueño
Could be a problem with unite.vim. github.com/Shougo/unite.vim/issues/1150 - Håken Lid

1 Answers

3
votes

The problem could be solved by calling :UpdateRemotePlugins. This command is necessary to create a special manifest file that is needed for the communication between special plugins and neovim due to the way neovim handles api communication (msgpack-rpc).

The update from python3.4 to python3.5 made the old manifest files obsolete. Consequently, they had to be updated too.