解决恼人的Vim YouCompleteMe插件报错问题

最近安装了YCM插件,出现了下面的报错:

Error detected while processing function youcompleteme#Enable[3]..35_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  

解决办法:
在.vimrc文件的最上面添加下面的配置就可以一劳永逸:

if has('python3')
  silent! python3 1
endif

参考:

  • Error message printed first time python3 (version 3.7.0) dynamic library is imported · Issue #3117 · vim/vim
  • 解决 vim 报错:the imp module is deprecated in favour of importlib - 个人文章 - SegmentFault 思否

你可能感兴趣的:(解决恼人的Vim YouCompleteMe插件报错问题)