The first things to determines to make Python working are:
- Is Python compiled for Python?
- What is the Vim architecture (32 Bit or 64 Bit)?
- What is the Python version that Vim expects (3.6, 3.10, ...)?
Python Support
Verifies that you have +python3/dyn
among the Feature included reported by the :version
command
Vim Architecture
You can determine if you are using a 32 bit or a 64 bit version of Vim by looking at the second line of the result of the :version
Vim command
VIM - vi Improved 9.0 ...
MS-Windows 64-bit GUI/Console version ...
...
vs.
VIM - vi Improved 9.0 ...
MS-Windows 32-bit GUI/Console version ...
...
Python Version
Check what is the value of -DDYNAMIC_PYTHON3_DLL
(from the compilation flag reported by the :version
Vim Command)
python310.dll
for Python 3.10
python36.dll
for Python 3.6
Sanity Check
- Make sure you have the correct version of Python Installed (corresponding to the Vim Architecture, and Vim Dynamic Python 3 version)
- Make sure the corresponding Python DLL is in the path environment variable (alternatively you could make sure
pythonthreedll
point to the required DLL)
The following answer gives you more information about that specific point.
The the following command should echo the hello
message:
:py3 print("hello")
And the following command should print you the version of python used:
:py3 import sys;print(sys.version)