在支持 Python3 的 Windows 上安装 GVIM? [英] Install GVIM on windows with Python3 support?

查看:32
本文介绍了在支持 Python3 的 Windows 上安装 GVIM?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何安装支持 Python3 的 Windows 版 GVIM?我已经安装了 VIM 7.4,它的版本文件(运行 :version 命令)+python3/dyn"和-DDYNAMIC_PYTHON3_DLL=\"python32.dll\".所以看起来它已经准备好支持 Python 3.当我运行时

How do I install GVIM for Windows with Python3 support? I have installed VIM 7.4 which says in it's version file (run :version command) "+python3/dyn" and "-DDYNAMIC_PYTHON3_DLL=\"python32.dll\". So it looks like it's ready to support Python 3. When I run

:echo has("python3")

它返回零.如果我用

:py3 print("hello") 

它说它无法加载 python32.dll.

it says it cannot load python32.dll.

推荐答案

不幸的是,这花了我一天的时间才弄明白.如果您希望在 Windows 上通过 GVIM 7.3+ 获得 Python3 支持,这是解决此问题的最简单方法.

Unfortunately this took me a day to figure out. Here's the simplest way to remedy this problem, if you are looking to have Python3 support with GVIM 7.3+ on Windows.

我运行的是 64 位 Windows 8,但是,请确保您使用的是 32 位版本的 Python.默认情况下,您很可能拥有 32 位版本的 GVIM,并且这两个版本需要匹配.具体来说,获取 Python3 的 3.2.x 版本,因为就 DLL (python32.dll) 而言,这正是 VIM 正在寻找的.在撰写本文时,不要为 Python 3 的最新版本 3.4.0 烦恼;如果您确实需要它,那么我不知道如何提供帮助.

I am running 64-bit Windows 8, but, make sure you grab a 32-bit version of Python. You will most likely have a 32-bit version of GVIM by default, and those 2 need to match. Specifically, grab a 3.2.x version of Python3 because that's what VIM is looking for as far as a DLL is concerned (python32.dll). Don't bother with the latest version of Python 3, 3.4.0 at the time of writing; and if you do need that, then I'm not sure how to help.

安装 Python 3.2.x 后,请确保完成最后一个棘手的部分:

Once you have Python 3.2.x installed, make sure you do this last tricky part:

python32.dll 没有放在 system32 文件夹中,它实际上在 C:\Windows\SysWOW64 文件夹中.您需要将C:\Windows\SysWOW64"添加到您的 PATH 环境变量中.

The python32.dll is not placed in system32 folder, it is actually in the C:\Windows\SysWOW64 folder. You need to add "C:\Windows\SysWOW64" to your PATH environment variable.

现在在 GVIM 中重新尝试您的 python3 测试,它应该会成功.

Now re-try your python3 tests in GVIM and it should be successful.

这篇关于在支持 Python3 的 Windows 上安装 GVIM?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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