我在 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'