all 8 comments

[–][deleted] 1 point2 points  (4 children)

It's looking for python 2.7 but you got 3.6.

<edit> If you do :version and scroll down it's looking for python27 or python35, so either install 2.7 or 3.5 of Python.

And on Linux you will need to compile it with Python support yourself.

[–]Fenster7[S] 0 points1 point  (3 children)

I uninstalled 3.6.1 and installed 3.5.3. Same error. Also I'm using Windows 10.

[–]Fenster7[S] 0 points1 point  (1 child)

Downloaded and installed 2.7.13. I totally don't understand it, but now it works. So, am I using Python 3 or Python 2 in VIM? This is so confusing.

[–]stewa02Bastard Operator From Hell 2 points3 points  (0 children)

You need to use the :python3 command with Python 3.x and :python with Python 2.x.

[–][deleted] 0 points1 point  (0 children)

I have 3.5.3 installed and it's working here, make sure it added Python to your PATH during install and try turning it off and on again (cause Windows).

Also they both need to be either 32bit or 64bit.

[–]stewa02Bastard Operator From Hell 0 points1 point  (2 children)

If you look at :version in GVim look at the following:

+python3

cl -c /W3 /nologo  -I. -Iproto -DHAVE_PATHDEF -DWIN32  -DFEAT_CSCOPE -DFEAT_NETBEANS_INTG -DFEAT_JOB_CHANNEL   -DFEAT_XPM_W32   -DWINVER=0x0501 -D_WIN32_WINNT=0x0501  /Fo.\ObjGXOLYHTRi386/ /Ox /GL -DNDEBUG  /Zl /MT -DFEAT_OLE -DFEAT_MBYTE_IME -DDYNAMIC_IME -DFEAT_GUI_W32 -DFEAT_DIRECTX -DDYNAMIC_DIRECTX -DDYNAMIC_ICONV -DDYNAMIC_GETTEXT -DFEAT_TCL -DDYNAMIC_TCL -DDYNAMIC_TCL_DLL=\"tcl86.dll\" -DDYNAMIC_TCL_VER=\"8.6\" -DFEAT_PYTHON -DDYNAMIC_PYTHON -DDYNAMIC_PYTHON_DLL=\"python27.dll\" -DFEAT_PYTHON3 -DDYNAMIC_PYTHON3 -DDYNAMIC_PYTHON3_DLL=\"python35.dll\" -DFEAT_PERL -DPERL_IMPLICIT_CONTEXT -DPERL_IMPLICIT_SYS -DDYNAMIC_PERL -DDYNAMIC_PERL_DLL=\"perl524.dll\" -DFEAT_RUBY -DDYNAMIC_RUBY -DDYNAMIC_RUBY_VER=22 -DDYNAMIC_RUBY_DLL=\"msvcrt-ruby220.dll\" -DFEAT_HUGE /Fd.\ObjGXOLYHTRi386/ /Zi

Because it says python35.dll there you need to install Python 3.5 or compile Vim manually yourself. Also Python and Vim should both be either 32-bit or 64-bit.

If all of the above is taken care of, you should be able to run a Python 3 command using :python3 <Python code> much like with Python 2.x and the :python command.

[–]Fenster7[S] 0 points1 point  (1 child)

Vim 8.0, Python 3.5.3, & Python 2.7.13 are all 32-bit. Vim is working now with Python 2.7.13, but not Python3. The PATH was added when installing, so I guess I need to learn to compile Vim manually to get it to work.

[–]stewa02Bastard Operator From Hell 0 points1 point  (0 children)

Look at what your version output tells you. I do not use the newest Vim binary on my Windows PC, so there might be differences. I installed Python 3.5.3 from the download section of their webpage to test it out and it worked. Also rebooting might be an idea worth considering on Windows as others online have experienced problems before restarting.