Skip to content Skip to sidebar Skip to footer

Vim-ipython Failed On Windows 7

I installed iPython by Anaconda on Windows 7. (There's no python installed previously). I can run ipython without problem. Then I installed vim-ipython plugin. In vim, when I run :

Solution 1:

On windows for vim to find python DLL path to it must be present in $PATH. There are multiple ways to achieve this:

  1. Editing registry. On wine I achieve this by adding a new path to the value of PATH key stored inHKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Session Manager\Environment by creating path.reg file:

    REGEDIT4
    
    [HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\SessionManager\Environment]
    "PATH"="{put old value of %PATH% here};C:\\path\\to\\python\\dll"

    and running regedit path.reg, but I guess HKEY_LOCAL_MACHINE is a bit of overkill and you need something under HKEY_CURRENT_USER. I am using it with wine (windows emulator) anyway so I do not care. You can launch regedit without arguments and try to find something there.

  2. AFAIR there is a way to set %PATH% in a link file you use to launch vim.
  3. Maybe just putting the following into the vimrc will work:

    let$PATH.=';C:\path\to\python\dll'

Note: none of the advices will work if vim was compiled with different python version support. Also if some configure flags (e.g. debugging support) differ between python from anaconda installer and python used by the whoever compiled vim error message should change. I do not know whether error message will change if vim is 32-bit and your python is 64-bit, but loading python will for sure fail in this case.

Solution 2:

Your troubleshooting output shows that your Vim is compiled with dynamically loaded Python (+python/dyn), but the error you get and has('python') == 0 means that the Python interpreter cannot be successfully loaded. The IPython plugin probably has a guard clause that prevents its loading unless Python is available.

You need to fix the Python integration into Vim, either by making that DLL available to Vim (so that there'll be no errors and has('python') == 1), or (as a last resort) compiling Vim yourself.

Post a Comment for "Vim-ipython Failed On Windows 7"