3

I have Vim 7.4 installed on Windows 10 as part of a Mingw64 installation. I installed the YouCompleteMe plugin on it through Vundle, then ran the install.py, which completed successfully.

Now, every time I lunch Vim I get this message:

YouCompleteMe unavailable: requires Vim compiled with Python 2.x support

And the plugin doesn't seem to be active.

I do have python 2.7 and 3.x installed:

>py --version
Python 3.5.1

>py -2 --version
Python 2.7.11

The YouCompleteMe compilation and installation was successful, as far as I can tell:

user@computer MINGW64 ~/.vim/bundle/YouCompleteMe (master)
$ py -2 install.py
-- The C compiler identification is MSVC 19.0.23506.0
-- The CXX compiler identification is MSVC 19.0.23506.0
-- Check for working C compiler using: Visual Studio 14 2015 Win64
-- Check for working C compiler using: Visual Studio 14 2015 Win64 -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler using: Visual Studio 14 2015 Win64
-- Check for working CXX compiler using: Visual Studio 14 2015 Win64 -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
Your C++ compiler does NOT support C++11, compiling in C++03 mode.
-- Found PythonLibs: C:/Program Files/Python27/libs/python27.lib (found suitable version "2.7.11", minimum required is "2.6")
NOT using libclang, no semantic completion for C/C++/ObjC will be available
-- Found PythonInterp: C:/Program Files/Python35/python.exe (found version "3.5.1")
-- Looking for pthread.h
-- Looking for pthread.h - not found
-- Found Threads: TRUE
-- Configuring done
-- Generating done
-- Build files have been written to: C:/Users/Eduardo/AppData/Local/Temp/ycm_build.irqgsp
Microsoft (R) Build Engine version 14.0.24730.2
Copyright (C) Microsoft Corporation. All rights reserved.

Build started 3/4/2016 2:27:10 PM.
...
88 Warning(s)
0 Error(s)

Time Elapsed 00:00:40.18

Also, this Vim has been compiled with python support:

$ vim --version
VIM - Vi IMproved 7.4 (2013 Aug 10, compiled Sep 16 2015 08:44:57)
Included patches: 1-872
Compiled by <alexpux@gmail.com>
Huge version without GUI.  Features included (+) or not (-):
+acl             +farsi           +mouse_netterm   +syntax
+arabic          +file_in_path    +mouse_sgr       +tag_binary
+autocmd         +find_in_path    -mouse_sysmouse  +tag_old_static
-balloon_eval    +float           +mouse_urxvt     -tag_any_white
-browse          +folding         +mouse_xterm     -tcl
++builtin_terms  -footer          +multi_byte      +terminfo
+byte_offset     +fork()          +multi_lang      +termresponse
+cindent         +gettext         -mzscheme        +textobjects
-clientserver    -hangul_input    +netbeans_intg   +title
+clipboard       +iconv           +path_extra      -toolbar
+cmdline_compl   +insert_expand   +perl/dyn        +user_commands
+cmdline_hist    +jumplist        +persistent_undo +vertsplit
+cmdline_info    +keymap          +postscript      +virtualedit
+comments        +langmap         +printer         +visual
+conceal         +libcall         +profile         +visualextra
+cryptv          +linebreak       +python/dyn      +viminfo
+cscope          +lispindent      +python3/dyn     +vreplace
+cursorbind      +listcmds        +quickfix        +wildignore
+cursorshape     +localmap        +reltime         +wildmenu
+dialog_con      -lua             +rightleft       +windows
+diff            +menu            +ruby/dyn        +writebackup
+digraphs        +mksession       +scrollbind      -X11
-dnd             +modify_fname    +signs           -xfontset
-ebcdic          +mouse           +smartindent     -xim
+emacs_tags      -mouseshape      -sniff           -xsmp
+eval            +mouse_dec       +startuptime     -xterm_clipboard
+ex_extra        -mouse_gpm       +statusline      -xterm_save
+extra_search    -mouse_jsbterm   -sun_workshop    -xpm
   system vimrc file: "/etc/vimrc"
     user vimrc file: "$HOME/.vimrc"
 2nd user vimrc file: "~/.vim/vimrc"
      user exrc file: "$HOME/.exrc"
  fall-back for $VIM: "/etc"
 f-b for $VIMRUNTIME: "/usr/share/vim/vim74"
Compilation: gcc -c -I. -Iproto -DHAVE_CONFIG_H   -D_FORTIFY_SOURCE=2 -I/usr/include/ncursesw  -march=x86-64 -mtune=generic -O2 -pipe -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1
Linking: gcc   -L. -pipe -fstack-protector -pipe -Wl,--as-needed -o vim.exe        -lm    -lncursesw -liconv -lintl   -pipe -Wl,--enable-auto-import -Wl,--export-all-symbols -Wl,--enable-auto-image-base -fstack-protector-strong  -L/usr/lib/perl5/core_perl/CORE -lperl -lpthread -ldl -lcrypt

However, even though this output indicates python is enabled, when I the the command :echo has('python') inside Vim I get a 0 response. I think this should be a 1, no? Not sure what's missing...

Google had a couple of pointers but they are for things that I already checked (like Vim being compiled with python support), and all info was for Linux or Mac OSX. Nothing for Windows.

My vim installation should be 64 bits since it was installed with Mingw64, and I'm running python also 64 bits, as evidenced by:

$ py -c 'import struct;print( 8 * struct.calcsize("P"))'
64

and

$ py -2 -c 'import struct;print( 8 * struct.calcsize("P"))'
64

How can I fix this so that the YouCompleteMe plugin will work properly?

  • 3
    Are you using the 32bit version of Python or the 64bit? Your Vim is a 32bit version, and only works with 32bit Python libraries. – Martin Tournoij Mar 5 '16 at 4:42
  • @Carpetsmoker thanks for the tips. I get the same issue on my mingw64 installation of Vim, which does indeed have python enabled. I have updated the post. Also, I'm running python 64 bits, which should be compatible. Any other clues on what I could be missing? Thank you! – Edy Bourne Mar 5 '16 at 8:12
  • What error does :py or :py3 throw? @romainl What's the point of looking at the plugin's issue tracker, when Vim itself isn't loading Python? – muru Mar 5 '16 at 9:26
  • @muru this is a good clue! It game me this message: "E370: Could not load library msys-python2.7.dll E263: Sorry, this command is disabled, the Python library could not be loaded." - I'll see what I can do to have this DLL loaded. Thanks! – Edy Bourne Mar 5 '16 at 17:17
1

I was having issues with this too - Vim, YouCompleteMe and Python all need to be of the same 'bitness' ie. 32 bit or 64 bit. As well, the version of Vim needs to be built with +python support and linked to the correct versions of the Python dlls (currently Python 2.7.11 does not work).

I put together a script that installs the prerequisites and builds these components as 64 bit located here that may help. (Note: It takes a while to run)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.