vim-ipython在Windows 7上失败了 [英] vim-ipython failed on Windows 7

查看:197
本文介绍了vim-ipython在Windows 7上失败了的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Windows 7上安装了Anaconda的iPython。(之前没有安装过python)。我可以毫无问题地运行ipython。

I installed iPython by Anaconda on Windows 7. (There's no python installed previously). I can run ipython without problem.

然后我安装了vim-ipython插件。在vim中,当我运行时

Then I installed vim-ipython plugin. In vim, when I run

:IPython

我得到了这个:

E492 Not an editor command.

我检查了vim版本:

:version
+python/dyn

我查了(在vim)

:python import sys
E370 Could not load python27.dll

在cmd上运行python:

Run python on cmd:

Python 2.7.5 |Anaconda 1.7.0 (64-bit)| (default, Jul  1 2013, 12:37:52) [MSC v.1500 64 bit (AMD64)]

请告诉我这个装置有什么问题?
谢谢。

Could you please tell me what is wrong with this installation? Thank you.

编辑:
我试过(在Vim中):

I tried (in Vim):

:echo has("python")
0

我真的很困惑!

编辑2:
感谢大家的帮助。我决定在Windows上构建/编译vim 64位。我已经下载了MinGW-w64,但不知道如何使用它:我找不到'make'。 (我记得在32位版本中有mingw-32-make,但在64位版本中没有。)

Edit 2: Thanks for everybody's help. I decide to build/compile vim 64-bit on windows. I've downloaded MinGW-w64, but don't know how to use it: I can't find 'make'. (I remember there's mingw-32-make in the 32 bit version, but none in the 64-bit version.)

推荐答案

在vim上找到它的python DLL路径的窗口必须存在于 $ PATH 中。有多种方法可以实现这一目标:

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


  1. 编辑注册表。在葡萄酒上,我通过在 HKEY_LOCAL_MACHINE \ SYSTEM \ CurrentControlSet \ Control \ Session中存储 PATH 键的新路径来实现此目的Manager \ Environment 通过创建 path.reg 文件:

  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\Session Manager\Environment]
"PATH"="{put old value of %PATH% here};C:\\path\\to\\python\\dll"

并运行 regedit path.reg ,但我想HKEY_LOCAL_MACHINE有点矫枉过正,你需要HKEY_CURRENT_USER下的东西。无论如何,我正在使用它与葡萄酒(windows模拟器),所以我不在乎。您可以在没有参数的情况下启动 regedit 并尝试在那里找到一些东西。

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.

可能只需将以下内容放入vimrc即可:

Maybe just putting the following into the vimrc will work:

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


注意:如果使用不同的方式编译vim,则没有任何建议可行python版本支持。此外,如果一些配置标志(例如调试支持)在anaconda安装程序的python和编译的vim错误消息应该更改的python所使用的python之间有所不同。我不知道如果vim是32位且你的python是64位,错误信息是否会改变,但是在这种情况下加载python肯定会失败。

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.

这篇关于vim-ipython在Windows 7上失败了的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆