代码之家  ›  专栏  ›  技术社区  ›  anothernode David Joel Lukombo

自python从3.6.5升级到3.7.0之后,在启用电力线的情况下启动vim时出现拒绝警告

  •  4
  • anothernode David Joel Lukombo  · 技术社区  · 6 年前

    我很乐意使用 Powerline 对于VIM,直到今天,Homebrew安装了从3.6.5到3.7.0的python升级。此后,电力线在VIM中停止正常工作。

    首先,当启动Vim时,有一个错误说 powerline 找不到模块,我想,如果 pip 按python次要版本安装包。

    所以我安装了 powerline-status 使用重新打包 匹普 作为 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或任何其他键才能继续,这很烦人。

    如果我删除以下加载电力线的命令(如 described in the docs )从我的 .vimrc , the DeprecationWarning 已经不见了,但显然电力线也不见了…

    python3 from powerline.vim import setup as powerline_setup
    python3 powerline_setup()
    python3 del powerline_setup
    

    searched their GitHub issues ,但找不到任何相关内容。

    有人知道解决这个问题的方法吗?

    1 回复  |  直到 6 年前
        1
  •  2
  •   anothernode David Joel Lukombo    6 年前

    由于错误状态,不推荐使用IMP模块。
    作为解决方法,将输入.vimrc的命令更改为以下内容:

    silent! python3 from powerline.vim import setup as powerline_setup
    python3 powerline_setup()
    python3 del powerline_setup
    

    这个 安静! 关键字将取消显示错误消息。

    Source

    推荐文章