Install GVIM on windows with Python3 support?

python, python-3.x, vim, windows

Solution

The problem that makes this question so hard is that specific solutions very quickly become obsolete. The day the solution is posted the version of `vim` or `python` is updated or links change. The steps provided by @mark-colon are fantastic but oriented for vim-7.

Generic instructions:

`vim` and `python` need to be in sync on many different levels:

Both need to be 32bit or 64bit

Vim needs to find a specific python dll version. It depends on who compiled your version of gvim. For example, gvim-8.1.x may use python3.6 or python3.7 and the exact version is required! Sometimes you can use: `gvim --version` to see what specific dll is being searched by vim at launch, otherwise you need to find out from where you downloaded gvim. This is the version of `python` that you must search the internet and install on your system. (Alternatively, if the version of python is more important to you than the version of vim, you can try to find a version of vim that was compiled for python but this will be harder to find.)

Make sure the directory that holds the python dll needs to be on the %PATH% environment variable. (Note: some just copying the python dll to the $VIM folder to get things working only works in the short term. You don't have all the necessary python libraries that are often assumed to be available.)

Finally, verify with ex command `:python2 print("hello")` or `:python3 print("hello")` depending on what version of python you wanted.

Specific links (if you must):

Note: these will all soon be out of date, but the following are some links to various compiled versions of gvim and python that could work together:

For `gvim-8.1.x` & `python-3.7.x` or `python-2.7.x` as of 2018-08:

- https://tuxproject.de/projects/vim/

- http://winpython.github.io/ or https://www.python.org/downloads

For `gvim-8.1.x` & `python-3.6.x` or `python-2.7.x` as of 2018-08:

- https://github.com/vim/vim-win32-installer/releases

- https://www.python.org/downloads

For `gvim-7.4.x` & `python-3.5.x` or `python-2.7.x` as of 2018-08:

- https://bintray.com/veegee/generic/vim_x64

- https://www.python.org/downloads

Problem

How do I install GVIM for Windows with Python3 support? I have installed VIM 7.4 which says in it's version file (run :version command) "+python3/dyn" and "-DDYNAMIC_PYTHON3_DLL=\"python32.dll\". So it looks like it's 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.

Original source