2

I try to get python support in gvim on windows to work with the help of this binary distribution.
First I got the error python27.dll could not be located, what I successfully fixed by copying python27.dll to the vim74 directory.
Although :echo has('python') returns 1 now, if I try to execute :py print(1) I get this error:

Sorry, this command is disabled, the Pythons's site module could not be loaded

I just don't understand what Vim is trying to tell me by that and what the problem is.

I'm using vim 7.4.1817 64bit with +python/dyn & +python3/dyn and python 2.7.9 64bit (the newer python 2.7.11 64bit produces the same behaviour)

  • 3
    Did you install a "full" python "distribution"? If not, do so, if yes, don't move the DLL to Vim, but make the path to python executables/dlls folder available to Vim by adding it to Windows PATH environment variable. Also check if you don't have other python distribution path in PATH, and remove it. – VanLaser May 7 '16 at 19:02
  • what do you consider a 'full' python 'distribution'. I never installed python before, but ill add it to my path – sro5h May 7 '16 at 19:04
  • E.g. something downloadable from here: activestate.com/activepython/downloads (just an example) (of course, restart Vim after modifying Windows' PATH). – VanLaser May 7 '16 at 19:05
  • I downloaded the 64bit installer from here. Adding the python directory to my path produces the same behaviour as copying the dll as far as I can tell – sro5h May 7 '16 at 19:07
1

I installed gvim from here and Python 2.7.9 and it works like a charm now.
I will further try to make it portable and edit the question if I succeed

From my experience trying to get python in gvim under windows to work, I have to say that there seems to be a problem with the 2.7.11 version and gvim 7.4.x

| improve this answer | |
0

Running with the Chocolatey package vim-tux on Windows 7, I was getting the same error. I fixed the problem by running this command (be warned: this is registry editing):

reg copy HKLM\SOFTWARE\Python\PythonCore\2.7 HKLM\SOFTWARE\Python\PythonCore\2.7-32 /s /reg:64

I found this solution on this forum.

| improve this answer | |
  • I will look into it and see if it helps – sro5h May 26 '16 at 20:25

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.