安裝YouCompleteMe時,編譯依賴的python版本不對


啟動vim打開文件時出錯:

The ycmd server SHUT DOWN (restart with ':YcmRestartServer'). YCM core library compiled for Python 2 but loaded in Python 3. Set the 'g:ycm_server_pytho
n_interpreter' option to a Python 2 interpreter path.

原因:

參照官網github上的文檔編譯命令:cmake -G "Unix Makefiles" -DPATH_TO_LLVM_ROOT=~/ycm_temp/llvm_root_dir . ~/.vim/bundle/YouCompleteMe/third_party/ycmd/cpp,默認使用的是python2

 

解決方案:

關閉使用python2的默認行為,關閉宏USE_PYTHON2,如下:

cmake -G "Unix Makefiles" -DPATH_TO_LLVM_ROOT=~/ycm_temp/llvm_root_dir -DUSE_PYTHON2=OFF . ~/.vim/bundle/YouCompleteMe/third_party/ycmd/cpp/

參考:

https://github.com/Valloric/YouCompleteMe#intro


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM