Skip to content Skip to sidebar Skip to footer

How Do I Enable Python In My New Gvim 8.2 Installation On Windows 10?

I installed the latest gvim from vim.org today. It is a 'loaded' package with many options, cfr infra (output of :version command) I have python 2.7 installed, the python27.dll res

Solution 1:

The usual package of Vim on Windows ships a 32-bit binary, and a 32-bit binary will not work with 64-bit libraries (which is typically what I'd expect your Python installation will be.) You need both Vim and Python to match.

There are 64-bit versions of Vim packages available here: github.com/vim/vim-win32-installer/releases

They're explicitly mentioned for those who want to add support for external languages such as Python.


Once you have a 64-bit Vim binary that matches your Python libraries, you need to have it correctly find the libraries in your system.

Try setting the 'pythonthreedll' and 'pythonthreehome' variables to point to the ones in your system.

It seems Vim was built with python37.dll, so let's try that version first:

set pythonthreedll=c:\\Program\ Files\\python37\\python37.dll
set pythonthreehome=c:\\Program\ Files\\python37

It's possible these are not exactly the paths in your system, or the values Vim wants for the settings... Please experiment with them and see if you find a combination that makes it work.

Note that you need to escape spaces with a backslash, and you need to use two backslashes as path separators. You shouldn't have spaces elsewhere in the line (for example, around the =.)

It's probably possible to do something similar for Python 2.7, but at this point Python 2 is basically deprecated, so I would rather spend time making Python 3 work rather than Python 2...

Post a Comment for "How Do I Enable Python In My New Gvim 8.2 Installation On Windows 10?"