公众号

更新vim8.0后,MacVim中YouCompleteMe出错

vim 中YouCompleteMe出错:

1
2
3
4
5
YouCompleteMe unavailable: dlopen(/usr/local/Cellar/python/2.7.12/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-d
ynload/_io.so, 2): Symbol not found: __PyCodecInfo_GetIncrementalDecoder
Referenced from: /usr/local/Cellar/python/2.7.12/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/_io.so
Expected in: flat namespace
in /usr/local/Cellar/python/2.7.12/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/_io.so

首先在终端里运行:

1
sudo find / -name _io.so

会把系统下所有名字带_io.so的文件路径都列出来:

1
2
3
4
/Applications/Google Drive.app/Contents/Resources/lib/python2.7/lib-dynload/_io.so
/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/_io.so
/Users/Nico/macports/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/_io.so
/usr/local/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/_io.so

然后备份2.7.13的io文件到桌面

1
2
3
cd Desktop
mkdir backup_python
cp /usr/local/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/_io.so backup_python/2.7.13_io.so

然后用老文件替换2.7.13的文件

1
cp /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/_io.so /usr/local/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/_io.so

然后YouCompleteMe就可以完美的工作啦!

进入vim之后出现

1
YouCompleteMe unavailable no module named XXX

原因就是你或者没用Vundle安装,或者Vundle由于网速太慢下载到一半不能把安装依赖包完全下载下来

1
2
3
解决方案:
进入到YouCompleteMe目录,在terminal窗口敲入 git submodule update --init --recursive

最后想说:Star me on GitHub 欢迎 Star

🙈坚持原创技术分享,您的支持将鼓励我继续创作🙈
显示 Gitment 评论