2

我在 Arch Linux 上使用 Neovim,并安装了 python-neovim 和 python3-neovim 以支持 Python。直到最后一次更新 neovim 的 python-clients 之前,一切都运行良好。我特别使用需要 Python 支持的 Unite 插件。

在安装了新版本的 neovim 的 python 客户端后,Python 支持似乎已经中断。

echo g:loaded_python_provider

返回1并且 Unite 抛出以下异常:

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.

但是,我通过尝试发现 python 在 neovim 中运行良好

:python print "Hello"

:python3 print("Hello")

我还尝试使用python_host_prog. 然而这并没有改变什么。

更新:

与此同时,错误消息略有变化,并包含 python 异常。此外,当我将 python3.4 升级到 3.5 时,我发现我的机器上存在更新包的问题。一些包链接。它们在两个版本之间被错误地链接。无论如何,完全重新安装 neovim 和 python api-bindings 也没有解决问题。

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'
4

1 回答 1

3

问题可以通过调用来解决:UpdateRemotePlugins。由于 neovim 处理 api 通信的方式 (msgpack-rpc),此命令是创建特殊插件和 neovim 之间通信所需的特殊清单文件所必需的。

从 python3.4 到 python3.5 的更新使旧的清单文件过时了。因此,它们也必须更新。

于 2016-05-14T11:36:49.293 回答