Install GVIM on Windows with Python3 support?

How do I install GVIM for Windows with Python3 support? I installed VIM 7.4 which says in it the version file (run: version command) "+ python3 / dyn" and "-DDYNAMIC_PYTHON3_DLL = \" python32.dll \ "So it looks like it is ready to support Python 3. When I run

:echo has("python3")

      

it returns zero. And if I test with

:py3 print("hello") 

      

it says it cannot load python32.dll.

+2


source to share


4 answers


Unfortunately it took me a day to figure it out. Here is the easiest way to fix this problem if you want to have Python3 support with GVIM 7.3+ on Windows.

I am running 64-bit Windows 8, but make sure you grab 32-bit Python. By default, you will most likely have a 32-bit version of GVIM and those 2 should match. In particular, take the 3.2.x version of Python3 because this is what VIM is looking for in a DLL (python32.dll). Don't worry about the latest version of Python 3, 3.4.0 at the time of this writing; and if you need it i'm not sure how to help.

After installing Python 3.2.x, make sure you do this last tricky part:



The python32.dll file does not fit in the system32 folder, it actually resides in the C: \ Windows \ SysWOW64 folder. You need to add "C: \ Windows \ SysWOW64" to your PATH environment variable.

Now try python3 tests in GVIM again and it should be successful.

+2


source


This is the approach I used to get VIM 7.x to work with Python 3.x.



  • Install VIM as you wish. Suggestion: Get the latest version from VIM.org, although this site seems to only have 32-bit versions. If you want 64-bit (my preference) get the pre-built https://bintray.com/veegee/generic/vim_x64 or choose your own built in elsewhere or build your own.

  • Enter the command: py3 print ("hello")

  • It will probably not find the python dll, in which case it will give an error, for example, cannot load pythonXX.dll where XX is a two-digit number. In my case, VIM was looking for python35.dll, which comes from Python 3.5.1 (and probably any Python 3.5.x). The number will vary depending on the VIM version you are using.

  • Find a suitable Python distribution. Matching means that both VIM and Python must be either 32-bit or 64-bit and the DLL that VIM wants (in step 3). So, for example, it looks like Python 3.5.x provides python35.dll. Install it.

    1. I don't remember doing anything special to get the VIM to look for the python dlls, other than that the directory it is in must be in the path, and I think it already was. If not, add the DLL directory to your path.

    2. Repeat step 2. It should now work.

    3. If you update VIM or Python in the future, you may need to update the other at the same time to ensure that the test in step 2 is still working.

+6


source


I am using the compiled version of Haroogan , it is great and has 64 bit for windows.

EDIT:

the veegee version is a good alternative. Thanks to Markus Mescanen for the comment.

+1


source


I tested that you should use the same architecture for both vim and python. see https://vi.stackexchange.com/questions/11004/how-to-get-python-support

If you just want a python function in vim, download python36.dll and put it in $ VIM and check: echo has ('python3')

0


source







All Articles