gpt4 book ai didi

python - vim 在 linux 上加载 python

转载 作者:IT王子 更新时间:2023-10-29 00:43:52 30 4
gpt4 key购买 nike

  1. 我的 Debian 中有 Python 2.7 和 Python 3.3。我使用 arg --enable-shared 重建了两者。

  2. 在我使用参数构建 VIM 7.4 之后 --enable-pythoninterp --enable-python3interp --with-features=huge --with-python-config-dir=PathToConfig --with -python3-config-dir=PathToConfig"

  3. 当我给出评论 vim --version 时,我可以看到标志 '+python/dyn 和 +python3/dyn'

但是,当我键入命令“:python import sys”时,我收到错误消息:

E448: Could not load library function _PyArg_Parse_SizeT
E263: Sorry, this command is disabled, the Python library could not be loaded.

当我输入命令 ':python3 import sys' 时,我收到错误消息:

E448: Could not load library function PySys_SetArgv
E263: Sorry, this command is disabled, the Python library could not be loaded.

因此,所有需要 python 的 vim 插件都无法正常工作。

请告诉我如何解决这个问题。

最佳答案

不幸的是,“动态”Python 加载可用于 Windows。我也研究过这个,它在任何其他操作系统上都不可用。

Vim 文档:http://vimdoc.sourceforge.net/htmldoc/if_pyth.html#python-dynamic指定:“在 MS-Windows 上,Python 库可以动态加载。”

基本上答案是:不,“动态”不适用于任何 Mac/*nix 系统。

我在自己的系统上所做的是编译两个版本的 vim,一个使用 Python2,另一个使用 Python3 链接。然后在我的 .vimrc 中包含一个版本检查,以便为插件等使用正确的 python exec。

关于python - vim 在 linux 上加载 python,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20104827/

30 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com