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 Attention is all you need 的代码运行
  • ¥15 一个服务器已经有一个系统了如果用usb再装一个系统,原来的系统会被覆盖掉吗
  • ¥15 使用esm_msa1_t12_100M_UR50S蛋白质语言模型进行零样本预测时,终端显示出了sequence handled的进度条,但是并不出结果就自动终止回到命令提示行了是怎么回事:
  • ¥15 前置放大电路与功率放大电路相连放大倍数出现问题
  • ¥30 关于<main>标签页面跳转的问题
  • ¥80 部署运行web自动化项目
  • ¥15 腾讯云如何建立同一个项目中物模型之间的联系
  • ¥30 VMware 云桌面水印如何添加
  • ¥15 用ns3仿真出5G核心网网元
  • ¥15 matlab答疑 关于海上风电的爬坡事件检测