插件无法识别Neovim中的Python主机,尽管Python在

时间:2016-03-17 10:26:16

标签: python neovim

我在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主机。然而,这并没有改变任何事情。

更新:

与此同时,错误消息略有变化,并包含python异常。此外,我发现当我将python3.4升级到3.5时,我的机器上出现了更新软件包的问题。一些包链接。它们在两个版本之间的链接不正确。 Nonethelles,完全重新安装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'

1 个答案:

答案 0 :(得分:2)

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

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