我编译了 Vim 的开发版本,同时支持 Python 2 和 Python 3。的输出vim --version
has +python/dyn
and +python3/dyn
在里面。我运行配置文件
G./configure --enable-pythoninterp --enable-python3interp --with-python-config-dir=/usr/lib64/python2.7/config --with-python3-config-dir=/usr/lib64/python3.3/config --with-x --with-features=huge
然而当我跑步时:python import sys; print(sys.version)
I get
E448: Could not load library function _PyArg_Parse_SizeT
E263: Sorry, this command is disabled, the Python library could not be loaded.
为什么会这样呢?我发现是因为 YouCompleteMe 声明它需要使用 2.x 支持编译的 Vim。
Thanks
我的 Debian 机器上也有类似的问题。如果您使用基于 Debian 的系统,您将无法同时加载两个 Python 库。这就是为什么当你设置--enable-python-interp
and --enable-python3-interp
它们总是加载 /dyn 后缀。
如果您的 vim 插件不需要这两个版本,您应该只选择其中一个版本并坚持使用。下面的链接提供了更多信息。
由 Debian 维护者解释 https://bugs.debian.org/cgi-bin/bugreport.cgi?msg=10;att=0;bug=729924
Vim Python 支持 http://vimhelp.appspot.com/if_pyth.txt.html#python3
附: - 如果您也在 Windows 上尝试过此操作,则加载任一 Python 版本都可以工作,因此 /dyn 在那里不是问题。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)