• Windows 8
  • Vim 8.0.584, 32 bit from https://tuxproject.de/projects/vim/ .7z archives: x86
  • python36.dll, 32 bit from https://www.python.org/ftp/python/3.6.0/python-3.6.0-embed-win32.zip
  • copied python36.dll in the directory where vim.exe and gvim.exe are located
  • starting gvim and then testing the python support with :py3 import sys; print(sys.version) gvim crashes without any further information.
  • starting vim and then testing the python support with :py3 import sys; print(sys.version) vim crashes. I can read Fatal python error: Py_Initialize: unable to load the file system codec followed by some unicode chars...

Any idea how to fix the problem?

Update [ 2017-04-25 - 17:46:07 ]
also tested with python36.dll from:

  • python-3.6.1-embed-win32.zip
  • python-3.6.0b4-embed-win32.zip
  • python-3.6.0b3-embed-win32.zip
  • python-3.6.0b2-embed-win32.zip
  • python-3.6.0b1-embed-win32.zip
  • python-3.6.0a4-embed-win32.zip
  • python-3.6.0a3-embed-win32.zip
  • python-3.6.0a2-embed-win32.zip
  • python-3.6.0a1-embed-win32.zip

Version output from gvim gathered with

:redir @a
:redir END

and finally pasted with CTRl+r a into my document.

VIM - Vi IMproved 8.0 (2016 Sep 12, compiled Apr 23 2017 18:46:39)
MS-Windows 32 Bit GUI Version mit OLE-Unterstützung
Inklusive der Korrekturen: 1-584
Übersetzt von hp@HP-PC
Riesige Version mit GUI. Ein- (+) oder ausschließlich (-) der Eigenschaften:
+acl                +digraphs           +langmap            -postscript         -termresponse
+arabic             +directx            +libcall            +printer            +textobjects
+autocmd            -dnd                +linebreak          +profile            +timers
+balloon_eval       -ebcdic             +lispindent         +python/dyn         +title
+browse             +emacs_tags         +listcmds           +python3/dyn        +toolbar
++builtin_terms     +eval               +localmap           +quickfix           +user_commands
+byte_offset        +ex_extra           +lua/dyn            +reltime            +vertsplit
+channel            +extra_search       +menu               +rightleft          +virtualedit
+cindent            +farsi              +mksession          +ruby/dyn           +visual
+clientserver       +file_in_path       +modify_fname       +scrollbind         +visualextra
+clipboard          +find_in_path       +mouse              +signs              +viminfo
+cmdline_compl      +float              +mouseshape         +smartindent        +vreplace
+cmdline_hist       +folding            +multi_byte_ime/dyn +startuptime        +wildignore
+cmdline_info       -footer             +multi_lang         +statusline         +wildmenu
+comments           +gettext/dyn        +mzscheme/dyn       -sun_workshop       +windows
+conceal            -hangul_input       +netbeans_intg      +syntax             +writebackup
+cryptv             +iconv/dyn          +num64              +tag_binary         -xfontset
+cscope             +insert_expand      +ole                +tag_old_static     -xim
+cursorbind         +job                +packages           -tag_any_white      +xpm_w32
+cursorshape        +jumplist           +path_extra         +tcl/dyn            -xterm_save
+dialog_con_gui     +keymap             +perl/dyn           -termguicolors      
+diff               +lambda             +persistent_undo    -tgetent            
          System-vimrc-Datei: "$VIM\vimrc"
        Benutzer-vimrc-Datei: "$HOME\_vimrc"
 zweite Benutzer-vimrc-Datei: "$HOME\vimfiles\vimrc"
 dritte Benutzer-vimrc-Datei: "$VIM\_vimrc"
         Benutzer-exrc-Datei: "$HOME\_exrc"
 zweite Benutzer-exrc-Datei: "$VIM\_exrc"
         System-gvimrc-Datei: "$VIM\gvimrc"
       Benutzer-gvimrc-Datei: "$HOME\_gvimrc"
zweite Benutzer-gvimrc-Datei: "$HOME\vimfiles\gvimrc"
dritte Benutzer-gvimrc-Datei: "$VIM\_gvimrc"
       defaults file: "$VIMRUNTIME\defaults.vim"
           System-Menü-Datei: "$VIMRUNTIME\menu.vim"
Linken: link /RELEASE /nologo /subsystem:windows /LTCG:STATUS oldnames.lib kernel32.lib advapi32.lib shell32.lib gdi32.lib  comdlg32.lib ole32.lib uuid.lib /machine:i386 gdi32.lib version.lib   winspool.lib comctl32.lib advapi32.lib shell32.lib  /machine:i386  msvcrt.lib oleaut32.lib user32.lib  /nodefaultlib:lua53.lib  /STACK:8388608  /nodefaultlib:python27.lib /nodefaultlib:python36.lib   "C:\TCL_x86\lib\tclstub86.lib" WSock32.lib .\xpm\x86\lib-vc14\libXpm.lib /PDB:gvim.pdb -debug
  • Is /path/to/python.dll included in your $PATH environment variable? (it needs to be just the directory if I'm correct)
    – grodzik
    Apr 25, 2017 at 19:03
  • The python.dll is in the same directory as vim.exe and gvim.exe. The path of vim.exe and gvim.exe is set in $path.
    – vbd
    Apr 26, 2017 at 9:40
  • Did you read this :help python-2-and-3? Try to start vim wo configuration and plugins and then :py3 import sys; print(sys.version)
    – Alex Kroll
    Apr 28, 2017 at 10:42
  • I tried gvim -u NONE with the same result. I've read the help entry and options +python/dyn +python3/dyn are set, so Python 2 and 3 should be supported. Python 2 (python27.dll) works.
    – vbd
    May 4, 2017 at 10:11

1 Answer 1


Finally solved.
The trouble was caused by one or both copied pythonxx.dll's.

Usally I work with my installed Anaconda Python (currently Python 3.5.2) environment. No separate Python 2 or Python 3 installations exist. As mentioned in one of my comments gvim -u NONE results also in an crash of gvim.

How to fix it:
I installed python-2.7.13.msi and python-3.6.1.msi both 32-bit corresponding to my vim/gvim 32-bit package. Copied python27.dll and python36.dll from the installation folders to my vim/gvim install directory where the *.exe's are located. Afterwards I uninstalled both msi packages to avoid getting confused with Anaconda installation.

Now everything works fine.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.