我很高兴使用 Powerline对于 Vim 有一段时间了,直到今天 Homebrew 安装了从 3.6.5 到 3.7.0 的 Python 升级。从那以后,Powerline 在 Vim 中停止正常工作。
首先,在启动 Vim 时,有一个错误说 powerline
找不到模块,我想这是有道理的,如果 pip
为每个 Python 次要版本安装包。
所以我安装了powerline-status
使用 pip
再次打包作为 described in the docs :
pip install powerline-status
现在,
ModuleNotFoundError
不见了,我在 Vim 中得到了一条工作电源线,但是 每次我启动 Vim 时,我都会收到另一个错误消息:/must>not&exist/foo:1: DeprecationWarning: the imp module is deprecated in favour of importlib; see the module's documentation for alternative uses
Press ENTER or type command to continue
而且我必须按 Enter 或任何其他键才能继续,这很烦人。
如果我从我的
.vimrc
中删除以下用于加载电力线的命令(如 described in the docs) , DeprecationWarning
不见了,但显然电力线也不见了......python3 from powerline.vim import setup as powerline_setup
python3 powerline_setup()
python3 del powerline_setup
我 searched their GitHub issues ,但找不到任何相关内容。
有谁知道这个的解决方案?
最佳答案
由于错误状态,imp 模块已被弃用。
作为一种解决方法,将您放入 .vimrc 的命令更改为以下内容:
silent! python3 from powerline.vim import setup as powerline_setup
python3 powerline_setup()
python3 del powerline_setup
沉默的!关键字将抑制错误消息。
Source
关于vim - 自 Python 从 3.6.5 升级到 3.7.0 后在启用 Powerline 的情况下启动 Vim 时的弃用警告,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51137328/