Vim 中未启用 Python
我正在尝试让 Xdebug vim 插件工作,它依赖于 python。这是我的环境:Windows 7 Professional 64位,Vim 7.3。我已经为这个插件设置好了一切,但是当我按 F5 时什么也没有发生。我发现一些博客描述了在 Windows 上实现此功能的一些额外步骤。他们都强调确保正确安装正确版本的 Python。我查看了 debugger.vim 文件中的插件代码,并在顶部附近检查 python 是否可用,如果不可用则退出。我插入了一个 echo 命令来告诉我 python 是否未安装,果然会弹出一个消息框通知我。这是修改后的代码:
if !has("python")
echo 'python NOT loaded'
finish
endif
根据此博客http: //phphints.wordpress.com/2008/08/20/add-debug-support-to-vim/ 我需要安装包含 vim 在运行 version 命令时查找的 dll 的 python 版本来自维姆。我的报告:
-DDYNAMIC_PYTHON_DLL=\"python27.dll\" -DDYNAMIC_PYTHON3_DLL=\"python31.dll\"
所以我安装了64位版本的python 2.7.1。即使 python27.dll 位于 System 32 文件夹中,结果也是相同的。我还尝试将 python.exe 的位置添加到 PATH 中,但这没有帮助。我还尝试安装 64 位版本的 python 3.1.3 但这没有帮助。有什么想法吗?
I am trying to get the Xdebug vim plugin to work which depends on python. Here is my environment: Windows 7 Professional 64bit, Vim 7.3. I got everything set up for this plugin, but when I hit F5 nothing happens. I found some blogs describing some additional steps to get this working on Windows. All of them stressed making sure the correct version of Python is installed correctly. I looked at the plugin code in the debugger.vim file and close to the top it checks to see if python is available and exits if it is not. I inserted an echo command to tell me if python is not installed, and sure enough a message box pops up informing me of such. Here is the modified code:
if !has("python")
echo 'python NOT loaded'
finish
endif
According to this blog http://phphints.wordpress.com/2008/08/20/add-debug-support-to-vim/ I need to install the version of python that includes the dll vim is looking for when I run the version command from vim. Mine reports:
-DDYNAMIC_PYTHON_DLL=\"python27.dll\" -DDYNAMIC_PYTHON3_DLL=\"python31.dll\"
So I installed the 64 bit version of python 2.7.1. Same result even though python27.dll is in the System 32 folder. I also tried adding the location of python.exe to the PATH, but this did not help. I also tried installing the 64 bit version of python 3.1.3 but this did not help. Any ideas?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我做了以下更改,现在 python 正在工作(从未达到条件 echo 语句)。我卸载了 Vim 并重新安装了它。我卸载了 64 位版本的 Python 2.7.1 和 3.1.3。我安装了32位版本的python 2.7.1。
我猜测造成差异的更改是使用 32 位版本的 Python 2.7.1,因为我使用的是 32 位版本的 Vim。你觉得怎么样(发表评论)?
I made the following changes, and now python is working (The conditional echo statement is never reached). I uninstalled Vim and re-installed it. I uninstalled the 64 bit versions of Python 2.7.1 and 3.1.3. I installed the 32 bit version of python 2.7.1.
I am guessing the change that made the difference is using the 32 bit version of Python 2.7.1 since I am using the 32 bit version of Vim. What do you think(leave a comment)?
这可能不是您问题的直接解决方案,但您需要确保使用 Python 支持编译 vim 可执行文件。
您可以通过在 vim 命令行中运行 :version 来检查编译了哪些选项。
另外,据我所知,python3支持是在vim7.3之后才添加的。如果您有 vim7.2,那么最好的选择是让 python 2 工作。
This may not be the direct solution to your problem, but you need to make sure the vim executable compiled with Python support.
You can check what options are compiled by running :version in the vim command line.
Also, as far as I know, python3 support only added after vim7.3. If you have vim7.2, your best bet is to get python 2 working.