dounaoji2054 2014-06-26 16:47
浏览 90
已采纳

Windows Vim YouCompleteMe自动完成

Although there's no official support for windows environment it seems that numerous people have been successful in getting this work. I desparately trying too but without success.
All what I need now is working autocompletion for php files (omni-completion, keyword completion).

I'm running x64bit version of compiled Vim 74 (+python27, +python33) here
From same guy I downloaded YouCompleteMe compiled for windows here

I installed plugin as always with pathogen plugin. I've installed Python27 & Python33 (x64) and I've both placed in my PATH. (Also python27.dll in windows/System32/directory)

In this state. if I ran Vim, I was getting error:

"The ycmd server SHUT DOWN (restart with ...). Stder (last 30 lines)..."

on vim startup. In same time Error log said:

RuntimeError: Error importing ycm_core. Are you sure you have placed a version 3.2+ libclang.[so|dll|dylib] in folder "C:\Program Files\Vim\vimfiles\bundle\you-complete-me\python"?

So I provided libclang.dll in specific folder (x64bit version) although I was editing a php file (not c family file) so this isn't relevant. Is it?

OK so now I'm in situation where I still get error on startup:

"The ycmd server SHUT DOWN (restart with ...). Stder (last 30 lines)..."

but Error log has been changed, it says:

DEBUG - No global extra conf, not calling method YcmCorePreload
Traceback (most recent call last): File "C:\Program Files\Vim\vimfiles\bundle\you-complete-me\python\ycm\server../..\ycm\server\handlers.py", line 23, in
import ycm_core ImportError: Module use of python27.dll conflicts with this version of Python.

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "C:\Program Files\Vim\vimfiles\bundle\you-complete-me\python\ycm\server/ycmd.py", line 126, in
Main() File "C:\Program Files\Vim\vimfiles\bundle\you-complete-me\python\ycm\server/ycmd.py", line 115, in Main from ycm.server import handlers File "C:\Program Files\Vim\vimfiles\bundle\you-complete-me\python\ycm\server../..\ycm\server\handlers.py", line 30, in str( e ) ) ) RuntimeError: Error importing ycm_core. Are you sure you have placed a version 3.2+ libclang.[so|dll|dylib] in folder "C:\Program Files\Vim\vimfiles\bundle\you-complete-me\python"? See the Installation Guide in the docs. Full error: Module use of python27.dll conflicts with this version of Python.

What does it meen? I'm pretty sure that I've required version (Python 277 x64bit).
What can I do? Could someone help me who got this working on windows environment?

UPDATE:

@sooop's answer pushed me a little bit forward, it helped.
Problem was that in PATH I had in front of "c:\Python27" placed "c:\Python33". So it found first provided python version and quit searching for Py27. So I placed "c:\Python27" before "c:\Python33" and this message disappeared.

Unfortunately another error occured: Now error log says:

File "C:\Program Files\Vim\vimfiles\bundle\you-complete-me\python\ycm\server../..\ycm\server\handlers.py", line 23, in import ycm_core ImportError: DLL load failed: %1 is not a valid Win32 application.

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "C:\Program Files\Vim\vimfiles\bundle\you-complete-me\python\ycm\server/ycmd.py", line 126, in Main() File "C:\Program Files\Vim\vimfiles\bundle\you-complete-me\python\ycm\server/ycmd.py", line 115, in Main from ycm.server import handlers File "C:\Program Files\Vim\vimfiles\bundle\you-complete-me\python\ycm\server../..\ycm\server\handlers.py", line 30, in str( e ) ) ) RuntimeError: Error importing ycm_core. Are you sure you have placed a version 3.2+ libclang.[so|dll|dylib] in folder "C:\Program Files\Vim\vimfiles\bundle\you-complete-me\python"? See the Installation Guide in the docs. Full error: DLL load failed: %1 is not a valid Win32 application.

Unfortunately I do not know what to do at all as well.

SOLUTION

@sooop's answer solves both of the two last errors. YouCompleteMe plugin supports only Python27 (and Py26). And path to the "\Python27\python.exe" in %PATH% environment variable must be at the first position, in front of other python versions!

  • 写回答

2条回答 默认 最新

  • dongyan3237 2014-06-27 01:54
    关注

    Remove path th python3 from your %PATH%.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 请教一下各位,为什么我这个没有实现模拟点击
  • ¥15 执行 virtuoso 命令后,界面没有,cadence 启动不起来
  • ¥50 comfyui下连接animatediff节点生成视频质量非常差的原因
  • ¥20 有关区间dp的问题求解
  • ¥15 多电路系统共用电源的串扰问题
  • ¥15 slam rangenet++配置
  • ¥15 有没有研究水声通信方面的帮我改俩matlab代码
  • ¥15 ubuntu子系统密码忘记
  • ¥15 保护模式-系统加载-段寄存器
  • ¥15 电脑桌面设定一个区域禁止鼠标操作