我已经安装了Windows 7 64位,并安装了python 2.7.11和python 3.5.1(均为32位),并且我已经用python / dyn和python3 / dyn编译了vim,但是我一直收到以下错误消息:
:py print "hello"
E887: Sorry, this command is disabled, the Python's site module could not be loaded
但是,以下所有工作都很好:
C:\python27\python -c "import site;"
和
:py3 print("hello")
这是我的vim版本信息:
VIM - Vi IMproved 7.4 (2013 Aug 10, compiled Jan 29 2016 11:58:41)
MS-Windows 32-bit console version
Included patches: 1-1194
Compiled by afontaine@PHOENIX
Huge version without GUI. Features included (+) or not (-):
+acl +eval -mouseshape +tag_old_static
+arabic +ex_extra +multi_byte_ime/dyn -tag_any_white
+autocmd +extra_search +multi_lang -tcl
-balloon_eval +farsi -mzscheme -tgetent
-browse +file_in_path -netbeans_intg -termresponse
++builtin_terms +find_in_path +path_extra +textobjects
+byte_offset +float -perl +title
-channel +folding +persistent_undo -toolbar
+cindent -footer -postscript +user_commands
+clientserver +gettext/dyn +printer +vertsplit
+clipboard -hangul_input +profile +virtualedit
+cmdline_compl +iconv/dyn +python/dyn +visual
+cmdline_hist +insert_expand +python3/dyn +visualextra
+cmdline_info +jumplist +quickfix +viminfo
+comments +keymap +reltime +vreplace
+conceal +langmap +rightleft +wildignore
+cryptv +libcall -ruby +wildmenu
+cscope +linebreak +scrollbind +windows
+cursorbind +lispindent +signs +writebackup
+cursorshape +listcmds +smartindent -xfontset
+dialog_con +localmap -sniff -xim
+diff -lua +startuptime -xterm_save
+digraphs +menu +statusline -xpm_w32
-dnd +mksession -sun_workshop
-ebcdic +modify_fname +syntax
+emacs_tags +mouse +tag_binary
Compilation: gcc -Iproto -DWIN32 -DWINVER=0x0500 -D_WIN32_WINNT=0x0500 -DHAVE_PATHDEF -DFEAT_HUGE -DHAVE_GETTEXT -DHAVE_LOCALE_H -DDYNAMIC_GETTEXT -DFEAT_CSCOPE -DFEAT_NETBEANS_INTG -DFEAT_CHANNEL -DFEAT_GUI_W32 -DFEAT_CLIPBOARD -DFEAT_MBYTE -DFEAT_MBYTE_IME -DDYNAMIC_IME -DDYNAMIC_ICONV -pipe -w -march=i386 -Wall -DFEAT_PYTHON -DDYNAMIC_PYTHON -DDYNAMIC_PYTHON_DLL="python27.dll" -DFEAT_PYTHON3 -DDYNAMIC_PYTHON3 -DDYNAMIC_PYTHON3_DLL="python35.dll" -DFEAT_XPM_W32 -I xpm/x86/include -I xpm/x86/../include -O3 -fomit-frame-pointer -freg-struct-return -s
Linking: gcc -Iproto -DWIN32 -DWINVER=0x0500 -D_WIN32_WINNT=0x0500 -DHAVE_PATHDEF -DFEAT_HUGE -DHAVE_GETTEXT -DHAVE_LOCALE_H -DDYNAMIC_GETTEXT -DFEAT_CSCOPE -DFEAT_NETBEANS_INTG -DFEAT_CHANNEL -DFEAT_GUI_W32 -DFEAT_CLIPBOARD -DFEAT_MBYTE -DFEAT_MBYTE_IME -DDYNAMIC_IME -DDYNAMIC_ICONV -pipe -w -march=i386 -Wall -DFEAT_PYTHON -DDYNAMIC_PYTHON -DDYNAMIC_PYTHON_DLL="python27.dll" -DFEAT_PYTHON3 -DDYNAMIC_PYTHON3 -DDYNAMIC_PYTHON3_DLL="python35.dll" -DFEAT_XPM_W32 -I xpm/x86/include -I xpm/x86/../include -O3 -fomit-frame-pointer -freg-struct-return -s -mwindows -o gvim.exe -lkernel32 -luser32 -lgdi32 -ladvapi32 -lcomdlg32 -lcomctl32 -lversion -lwsock32 -Lxpm/x86/lib -lXpm -lole32 -luuid
和where python27.dll
输出C:\Windows\System32
我已经尝试过此Google网上论坛帖子中的建议,但无济于事。
我只想让YouCompleteMe成功运行。
:!where python27.dll
返回C:\Windows\System32\python27.dll
。还要注意,如果缺少该库,则会发生另一个错误:E370: Could not load library python27.dll
和E263: Sorry, this command is disabled, the Python library could not be loaded.
:py3
可以,但是:py
不会吗?如果插件之一:py3
在vim启动期间执行,则是可能的。见:he python-2-and-3
用于解释如何蟒蛇/ DYN和python3 / DYN一起工作..
:help python-dynamic
说...To use the Python interface the Python DLL must be in your search path. In a console window type "path" to see what directories are used.