I need Windows 7 + vim + python for writing vim plugins.

:python print("hello")
E370: Could not load library python27.dll
E263: Sorry, this command is disabled, the Python library could not be loaded.

Tried everything:

  • reinstalled vim
  • uninstalled all my 64bit python versions and installed 32bit ones
  • reinstalled vim again
  • restarted computer
  • punched desk and keyboard
  • restarted computer

migrated from stackoverflow.com Aug 12 '11 at 1:40

This question came from our site for professional and enthusiast programmers.

  • For all those having the same problem: installing "cream" fixes it: cream.sourceforge.net Yes - this question will probably get closed - but the fact is that there is still no solution to this anywhere on the web. – Andriy Drozdyuk Aug 11 '11 at 21:00
  • Answering your own question is good, but post it as an answer, not a comment, then accept it after two days. – agf Aug 11 '11 at 21:03
  • compile it with python support – Eric Fortis Aug 11 '11 at 21:52
  • Hm... I am not compiling it, but rather downloading an installer. – Andriy Drozdyuk Aug 11 '11 at 22:52
  • @drozzy: there are installers here: bintray.com/veegee/generic/vim_x64. Had the same problem as you and didn't want to build Vim on my own. Simple! – eckes Sep 26 '13 at 13:34


:version will show you if you have 32bit vim or 64bit
python.exe will show you if you have 32bit or 64bit python.


Now it's up to you to choose either:

  • 32bit vim + 32bit python or

  • 64bit vim + 64bit python

otherwise it won't work complaining with the error you quoted.

NB Latest 64bit vim cannot be downloaded from the download page anymore. For some mysterious reason now there's a new special page for that:



Are you sure that you installed the same version of 32 bit python that Vim was looking for? I see no reason that this wouldn't have fixed your problem, unless you somehow had a gvim exe built without python support. Anyway, I had precisely this problem, and the obvious thing to me was that my python dll was x64, whilst I had 32 bit vim. The solution for me was simply to build a 64 bit version of Vim. I much prefer upgrading Vim to downgrading Python. The arguments I sent to the make file were:

nmake -f Make_mvc.mak GUI=yes CPU=AMD64 PYTHON=C:\Python27 DYNAMIC_PYTHON=yes PYTHON_VER=27

I then replaced my original 32 bit gvim.exe with the 64 bit one I just built. Everything worked perfectly. If you are worried about the hassle of the build, don't be- it was very straightforward using visual studio 2010's compilers, and running make from the appropriate visual studio command prompt (x64 cross tools). I can send further instructions if needed.

  • i was exactly in your situation. since i didn't want to recompile vim, i installed the 32bit version of python 2.7 and now gvim works like a charm! – apelliciari Apr 2 '12 at 23:05
  • There's a precompiled x64 version (linked from vim.org download page), installing it resolves the problem. – Antony Hatchkins Nov 15 '13 at 18:27

Ok here it goes: For some reason installing "cream" fixes it: cream.sourceforge.net.

:python print("hello")

Interestingly enough, "cream" includes a regular version of "gvim" - so I can use just that.


I had this problem with VIM 7.2 looking for the python25.dll This was fixed by adding the path to the python25.dll file (c:\python25\ on my system) to the PATH environment variable.


An alternate solution that I have not seen mentioned and worked for me.

1. as the other answers state, make sure that the python version matches the 32/64 bit.

2. add "set pythondll=FULL_PATH_TO_THE_APPROPRIATE_PYTHON.DLL" to your .vimrc eg. "set pythondll=E:\extern\python27-32\python27.dll"

3. reload the vimrc by either closing and restarting vim, or using ":source $MYVIMRC"

other tidbits:

  • to find out where your .vimrc is "echo $MYVIMRC"

  • to easily edit your .vimrc ":e $MYVIMRC"

  • to see what it is set to ":options" then "/pythondll" or ":set pythondll?"

  • to test that it worked ":py import sys" followed by ":py print('Happy')"

More Info:

":help python-dynamic"

":help pythondll"

":help options"

":help source"

":help $MYVIMRC"

  • On Vim 8.0 this works only without quotes (') or double quotes ("). Obviously, you path should not contain any spaces :/ – Boris Brodski Mar 19 '18 at 9:57

If you want to keep your 64-bit version of Python, at this moment, an easy to install and recent version of Vim64 for Windows can be found here. It even uninstalls your existing 32-bit gvim for you.


There is a similar question: Google drive error : python27.dll

Problem is in python27.dll dependencies. You can check this by dependencywalker utility. Missed dll is "msvcr90.dll". It comes with "Microsoft Visual C++ 2008 Redistributable Package" and Windows 7 does not include it even with all installed updates. You should install this package manually from:

Windows 7 x64: https://www.microsoft.com/en-us/download/details.aspx?id=15336

Windows 7 32 bit: https://www.microsoft.com/en-US/download/details.aspx?id=29

  • OP had already a better solution – yass May 18 '17 at 20:01

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.