2017-02-22 48 views
1

安裝了YouCompleteMe(./install.py - 完成--clang-complete)for vim並出現錯誤。YouCompleteMe錯誤:未找到符號:__PyCodecInfo_GetIncrementalDecoder

錯誤:

Traceback (most recent call last): 
    File "<string>", line 19, in <module> 
    File "/Users/khotey/.vim/plugged/YouCompleteMe/autoload/../python/ycm/setup.py", line 37, in SetUpSystemPaths 
    from ycmd import server_utils as su 
    File "/Users/khotey/.vim/plugged/YouCompleteMe/python/ycm/../../third_party/ycmd/ycmd/server_utils.py", line 25, in <module> 
    import io 
    File "/usr/local/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7/lib/python2.7/io.py", line 51, in <module> 
    import _io 
ImportError: dlopen(/usr/local/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/_io.so, 2): Symbol not found: __PyCodecInfo_GetIncrementalDecoder 
    Referenced from: /usr/local/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/_io.so 
    Expected in: flat namespace 
in /usr/local/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/_io.so 
YouCompleteMe unavailable: dlopen(/usr/local/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/_io.so, 2): Symbol not found: __PyCodecInfo_GetIncrementalDecoder 
    Referenced from: /usr/local/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/_io.so 
    Expected in: flat namespace 
in /usr/local/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/_io.so 
Press ENTER or type command to continue 

回答

1

對我來說,問題是Vim並沒有使用合適的Python版本。

我解決它在我的Mac通過:

brew unlink python 
brew link python 

Discussion in ycm issue.

+0

有趣的是,對我來說太奏效。它愉快地安裝與python的mac版本。確保你記得重新鏈接或重新安裝(如果你卸載了)python的brew版本。 – gloriphobia

相關問題