解决YouCompleteMe"encoding" is an invalid keyword 错误

xiaoxiao2021-02-28  90

今天试着配置vim关于python的设置,在使用YouCompleteMe操作的时候,提示'encoding' is an invalid keyword argument on python files,查看message,为: ~/.vim/bundle/YouCompleteMe/third_party/ycmd/ycmd/utils.py中的ReadFile引起的问题:

def ReadFile( filepath ): with open( filepath, encoding = 'utf8' ) as f: return f.read()

排查发现,是因为这段代码只支持python3,所以需要vim支持python3,用brew install vim --with-python3解决

转载请注明原文地址: https://www.6miu.com/read-52795.html

最新回复(0)