Search code examples
windowspython-2.7vimvim-plugin

Vim for Windows: Python doesn't load properly / “crashes”


I've been struggling for 2 days to install some plugins which use python on Vim (Windows). Even with a stock vimrc.

Using the official vim 7.4 binary (x86)

  • I've checked that it comes with +python/dyn and +python3/dyn
  • I've installed Python 2.7.10 x86, and appended python's path in my Path environment.
  • :echo has('python') prints 1 as expected.
  • Yet: when I type :python print 'test', vim quits, just as if I've typed :q
  • :python mum tell me, why does windows exists?, it quits as well. Wondering why... Not a print issue at least.

Using tuxproject's nighty builds of vim 7.4.826 (x86)

  • It does come with +python/dyn and +python3/dyn. Also:

Used libraries: Perl 5.22.1, Python 2.7.10, Python 3.4.3, Ruby 2.2.3, Lua 5.3.0, Tcl 8.6.4, libXpm.

Great! That's the verison I've downloaded (2.7.10) ! Wait...

  • :echo has('python') prints 1 as expected.
  • But, "merry christmas!" says vim.

Sorry, this command is disabled, the Python's site module could not be loaded. Windows isn't good enough. Oh, and merry christmas!

Using tuxproject's nighty builds of vim 7.4.826 (x64)

I tried to use x64's python binary, taking care of removing the x86 version from my Path variable. Same issue as above.

Using Kaoriya's vim 7.4.something (x64) and Veegee's vim 7.4.803

Same issue as above.

What about compiling vim ?

Windows.


I'm not that lazy, well, yes I am... but I'll try to compile it if there isn't any other workaround. I don't really want to compile it if it won't solve anything. If only I could at least understand why these issues happen...


Solution

  • All right, I managed to solve the issue.

    For those who may be interested, the intended python version was Python 2.7.9 and not 2.7.10. Installing Python 2.7.9 x86 (and x64) fixed everything for the corresponding vim version.