Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/linux/26.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
vim在linux上加载python_Python_Linux_Vim_Vim Plugin - Fatal编程技术网

vim在linux上加载python

vim在linux上加载python,python,linux,vim,vim-plugin,Python,Linux,Vim,Vim Plugin,我的Debian中有Python 2.7和Python 3.3。我使用arg——enable shared重新构建了这两个函数 之后,我使用参数“--enable-pythoninterp--enable-python3interp--with-features=great--with-python-config-dir=PathToConfig--with-python3-config-dir=PathToConfig”构建了VIM 7.4 当我给出vim--version注释时,我可以看到标

我的Debian中有Python 2.7和Python 3.3。我使用arg
——enable shared
重新构建了这两个函数

  • 之后,我使用参数“
    --enable-pythoninterp--enable-python3interp--with-features=great--with-python-config-dir=PathToConfig--with-python3-config-dir=PathToConfig
    ”构建了VIM 7.4

  • 当我给出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文档:指定:“在MS Windows上,可以动态加载Python库。”

    基本上答案是:不,“动态”在任何Mac/*nix系统上都不起作用


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

    确保您的python库位于
    $LD\u LIBRARY\u PATH
    中,并且
    $PATH
    @Farhadix
    PATH
    与此无关。除了在构建vim时必须首先显示适当的python之外,您必须使用将要使用vim的python库进行构建。出现这些错误是因为您使用一个二进制文件构建了vim,并试图将其与另一个二进制文件一起使用。通常您不必指定“-with python config dir”,它将由configure确定。因此,请尝试省略这些参数来构建。请确保已安装适当的
    -dev
    软件包,否则它将无法工作。@Farhadix我可以在/usr/local/lib中看到'libpython2.7.so','libpython2.7.so.1'和'libpython2.7.so.1.0','libpython3.3m.so.1.0','libpython3.3m.so'和'libpython3.3m.a'。我已将这两个路径添加到$path。但是,当我对$LD_LIBRARY_PATH进行echo时,不会显示任何内容。我无法在加载期间修改它。在这些更改之后,VIM问题仍然存在。@ZyX当我构建VIM时没有“--with python config dir”,我得到的错误是找不到配置文件。因此,我根据这些文件的安装位置添加了这些配置参数。