解决 vim 报错:the imp module is deprecated in favour of importlib

时间:2018-07-24 11:56:22   收藏:0   阅读:1264

问题描述:
打开 vim 之后,出现如下错误:

Error detected while processing function youcompleteme#Enable[3]..<SNR>71_SetUpPython:
line   42:
/must>not&exist/foo:1: DeprecationWarning: the imp module is deprecated in favour of importlib; see the module‘s documentation for alternative uses

原因:
这个问题出现在使用 Python 3.7 的情况,
可以暂时在 .vimrc 中做如下配置,并等待更新 Python 3.7 来解决这个问题:

解决办法:
在.vimrc中加入如下

" temporary fix
" https://github.com/vim/vim/issues/3117
if has(‘python3‘)
  silent! python3 1
endif

其他解决方法:
https://github.com/vim/vim/issues/3117

评论(0
© 2014 mamicode.com 版权所有 京ICP备13008772号-2  联系我们:gaon5@hotmail.com
迷上了代码!