snakeleon / YouCompleteMe-x64

Vim YouCompleteMe with Clang support binaries for Windows x64
GNU General Public License v3.0
40 stars 2 forks source link

Ycm无法启动server端(ycmd 核心版本: 31 (27 January 2018) 静态编译) #4

Closed luoyancn closed 5 years ago

luoyancn commented 6 years ago

错误日志

gvim报错: The ycmd server SHUT DOWN (restart with 'YcmRestartServer'). Run ':YcmToggleLogs stderr' to check Restarting ycmd server...

YcmToggleLogs stderr错误信息: 2018-02-22 10:09:34,496 - ERROR - DLL load failed: 拒绝访问。 Traceback (most recent call last): File "C:\Vim\bundle\YouCompleteMe-x64\third_party\ycmd\ycmd\server_utils.py", line 96, in CompatibleWithCurrentCore ycm_core = ImportCore() File "C:\Vim\bundle\YouCompleteMe-x64\third_party\ycmd\ycmd\server_utils.py", line 88, in ImportCore import ycm_core as ycm_core ImportError: DLL load failed: 拒绝访问。

使用环境

OS:win10 64bit ycm版本:31 (27 January 2018) 静态编译 Python 支持: 3.6.4 (19 December 2017) vim版本: VIM - Vi IMproved 8.0 (2016 Sep 12, compiled Feb 11 2018 16:19:06) MS-Windows 64-bit console version Included patches: 1-1504 Compiled by micbou contact@micbou.com Huge version without GUI. Features included (+) or not (-): +acl +eval -mouseshape -tag_any_white +arabic +ex_extra +multi_byte_ime/dyn +tcl/dyn +autocmd +extra_search +multi_lang +termguicolors +autoservername +farsi +mzscheme/dyn +terminal -balloon_eval +file_in_path -netbeans_intg -tgetent -balloon_eval_term +find_in_path +num64 -termresponse -browse +float +packages +textobjects ++builtin_terms +folding +path_extra +timers +byte_offset -footer +perl/dyn +title +channel +gettext/dyn +persistent_undo -toolbar +cindent -hangul_input -postscript +user_commands +clientserver +iconv/dyn +printer +vertsplit +clipboard +insert_expand +profile +virtualedit +cmdline_compl +job +python/dyn +visual +cmdline_hist +jumplist +python3/dyn +visualextra +cmdline_info +keymap +quickfix +viminfo +comments +lambda +reltime +vreplace +conceal +langmap +rightleft +wildignore +cryptv +libcall +ruby/dyn +wildmenu +cscope +linebreak +scrollbind +windows +cursorbind +lispindent +signs +writebackup +cursorshape +listcmds +smartindent -xfontset +dialog_con +localmap +startuptime -xim +diff +lua/dyn +statusline -xpm_w32 +digraphs +menu -sun_workshop -xterm_save -dnd +mksession +syntax -ebcdic +modify_fname +tag_binary +emacs_tags +mouse +tag_old_static system vimrc file: "$VIM\vimrc" user vimrc file: "$HOME_vimrc" 2nd user vimrc file: "$HOME\vimfiles\vimrc" 3rd user vimrc file: "$VIM_vimrc" user exrc file: "$HOME_exrc" 2nd user exrc file: "$VIM_exrc" defaults file: "$VIMRUNTIME\defaults.vim" Compilation: cl -c /W3 /nologo -I. -Iproto -DHAVE_PATHDEF -DWIN32 -DFEAT_CSCOPE -DFEAT_TERMINAL -DFEAT_JOB_CHANNEL -DWINVER=0x0501 -D_WIN32_WINNT=0x0501 /MP -DHAVE_STDINT_H /Ox /GL -DNDEBUG /MD -DFEAT_MBYTE_IME -DDYNAMIC_IME -DFEAT_MBYTE -DDYNAMIC_ICONV -DDYNAMIC_GETTEXT -DFEAT_TCL -DDYNAMIC_TCL -DDYNAMIC_TCL_DLL=\"tcl86t.dll\" -DDYNAMIC_TCL_VER=\"8.6\" -DFEAT_LUA -DDYNAMIC_LUA -DDYNAMIC_LUA_DLL=\"lua53.dll\" -DFEAT_PYTHON -DDYNAMIC_PYTHON -DDYNAMIC_PYTHON_DLL=\"python27.dll\" -DFEAT_PYTHON3 -DDYNAMIC_PYTHON3 -DDYNAMIC_PYTHON3_DLL=\"python36.dll\" -DFEAT_MZSCHEME -I "C:\Racket\include" -DMZ_PRECISE_GC -DDYNAMIC_MZSCHEME -DDYNAMIC_MZSCH_DLL=\"libracket3m_a3rum8.dll\" -DDYNAMIC_MZGC_DLL=\"libracket3m_a3rum8.dll\" -DFEAT_PERL -DPERL_IMPLICIT_CONTEXT -DPERL_IMPLICIT_SYS -DDYNAMIC_PERL -DDYNAMIC_PERL_DLL=\"perl526.dll\" -DFEAT_RUBY -DDYNAMIC_RUBY -DDYNAMIC_RUBY_VER=24 -DDYNAMIC_RUBY_DLL=\"x64-msvcrt-ruby240.dll\" -DFEAT_HUGE /Fd.\ObjCULYHTRZAMD64/ /Zi Linking: link /nologo /subsystem:console /LTCG:STATUS oldnames.lib kernel32.lib advapi32.lib shell32.lib gdi32.lib comdlg32.lib ole32.lib uuid.lib /machine:AMD64 msvcrt.lib user32.lib /nodefaultlib:lua53.lib /STACK:8388608 /nodefaultlib:python27.lib /nodefaultlib:python36.lib "C:\ActiveTcl\lib\tclstub86.lib" WSock32.lib /PDB:vim.pdb -debug

偶然间发现大神编译的ycm,尝试之后出现以上的问题,还请不吝赐教

snakeleon commented 6 years ago

OK ~~ 你查看一下PATH变量里有Python3 的路径吗?

luoyancn commented 6 years ago

PATH的变量如下: PATH:C:\Python36\Scripts\;C:\Python36;C:\Windows\system32;C:\Windows;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Go\bin; Python3的路径放到了最前面

通过cmd的echo命令,输出如下: echo %PATH% C:\Python36\Scripts\;C:\Python36;C:\Windows\system32;C:\Windows;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Go\bin;

以上是我的path信息。多谢!

snakeleon commented 6 years ago

那 YouCompleteMe-x64\third-party\ycmd 目录下 ycm_core.pyd 和 libclang.dll 这两个文件都在吧?

luoyancn commented 6 years ago

这2个文件都在。直接在 YouCompleteMe-x64\third-party\ycmd下,进入python环境,然后import ycm_core,就提示ImportError: DLL load failed: 拒绝访问

snakeleon commented 6 years ago

安装的时候权限问题?文件的访问权限受到控制?我只能想到是这种情况了。 或者用TeamViewer远程帮你看看情况?

snakeleon commented 6 years ago

想到一个问题,运行时库是否缺少了,你到 http://www.zdfans.com/7959.html 下载安装,并确认Python3.6 你正确安装了64位版本,再看情况解决没有。

luoyancn commented 6 years ago

尝试了一下,情况没有解决。不过多谢了