Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

vim loading python on linux

  1. I have Python 2.7 and Python 3.3 in my Debian. I rebuilt both using the arg --enable-shared.

  2. After than I built VIM 7.4 using the args " --enable-pythoninterp --enable-python3interp --with-features=huge --with-python-config-dir=PathToConfig --with-python3-config-dir=PathToConfig"

  3. when i give the comment vim --version, I could see the flags '+python/dyn and +python3/dyn'

However when I type the command ':python import sys', I get the error message:

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

When I type the command ':python3 import sys', I get the error message:

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

all the vim plugins that needs python is not working due to this.

Please let me know how to fix this.

like image 233
Srik Avatar asked Nov 20 '13 19:11

Srik


1 Answers

"Dynamic" Python loading is only available for use on Windows, unfortunately. I have looked into this as well, and it is not available on any other operating system.

The Vim docs: http://vimdoc.sourceforge.net/htmldoc/if_pyth.html#python-dynamic specify: "On MS-Windows the Python library can be loaded dynamically."

Basically the answer is: Nope, "dynamic" will not work on any Mac/*nix systems.

What I've done on my own system is to compile two versions of vim, one with Python2 and the other with Python3 links. Then in my .vimrc I include a version-check to use the right python exec for plugins, etc.

like image 59
Cometsong Avatar answered Sep 24 '22 15:09

Cometsong