Required vim compiled with +python

10,947

Features marked as */dyn may or may not be available. The support for these features is not built in. It depends on the presence of dedicated shared objects.

To some of the features "/dyn" is added when the feature is only available when the related library can be dynamically loaded.

To check if your vim can use a dynamic feature, e.g. python do:

:echo has('python')

It will print 0 (false) or 1 (true)

See also python-dynamic.

Update:

If you installed vim from source, you will have to rebuild it. Use --enable-pythoninterp, --with-python-config-dir options. Also make sure you have python development headers and libraries installed (devel package).

Share:
10,947
Liangmin Li
Author by

Liangmin Li

Updated on June 29, 2022

Comments

  • Liangmin Li
    Liangmin Li almost 2 years

    When I typed in raw and hit <C-x><C-o> in a python file, I get the Error:Required vim compiled with +python. But according to the result of command :version, there is a + rather than - in front of python, what should I do to fix this problem?

    +arabic          +cursorbind      -footer          +mksession       +path_extra      +startuptime     +visual
    +autocmd         +cursorshape     +fork()          +modify_fname    -perl            +statusline      +visualextra
    -balloon_eval    +dialog_con      +gettext         +mouse           +persistent_undo -sun_workshop    +viminfo
    -browse          +diff            -hangul_input    -mouseshape      +postscript      +syntax          +vreplace
    ++builtin_terms  +digraphs        +iconv           +mouse_dec       +printer         +tag_binary      +wildignore
    +byte_offset     -dnd             +insert_expand   -mouse_gpm       +profile         +tag_old_static  +wildmenu
    +cindent         -ebcdic          +jumplist        -mouse_jsbterm   +python/dyn      -tag_any_white   +windows
    +clientserver    +emacs_tags      +keymap          +mouse_netterm   +python3/dyn     -tcl             +writebackup
    +clipboard       +eval            +langmap         +mouse_sgr       +quickfix        +terminfo        +X11
    +cmdline_compl   +ex_extra        +libcall         -mouse_sysmouse  +reltime         +termresponse    +xfontset
    +cmdline_hist    +extra_search    +linebreak       +mouse_urxvt     +rightleft       +textobjects     -xim
    +cmdline_info    +farsi           +lispindent      +mouse_xterm     -ruby            +title           -xsmp
    +comments        +file_in_path    +listcmds        +multi_byte      +scrollbind      -toolbar         +xterm_clipboard
    +conceal         +find_in_path    +localmap        +multi_lang      +signs           +user_commands   -xterm_save
    +cryptv          +float           -lua             -mzscheme        +smartindent     +vertsplit
    +cscope          +folding         +menu            +netbeans_intg   -sniff           +virtualedit
    

    Thanks

    • therealak12
      therealak12 over 4 years
      I had the same problem, the accepted answer here solved my problem. During the installation of vim through building from source, you need to execute the configure script with some parameters and the mentioned answer says the --with-python3-config-dir= parameter is deprecated and shouldn't be used.
  • Liangmin Li
    Liangmin Li almost 9 years
    Thanks for your answer. after I executed :echo has('python') in my vim, I get the following errors: E448: Could not load library function _PyArg_Parse_SizeT E263: Sorry, this command is disabled, the Python library could not be loaded.
  • Liangmin Li
    Liangmin Li almost 9 years
    the python-dynamic is seemingly used on Windows, but I runs vim in Centos 7, and I installed it by the source
  • Alex Kroll
    Alex Kroll almost 9 years
    Also. You may have :echo has('python')=0 but :echo has('python3')=1
  • Michael Draper
    Michael Draper over 4 years
    This is the case for me, (has('python') = 0, has('python3')=1) But how do stop the error from showing when I launch nvim on a python file?
  • theSekyi
    theSekyi over 3 years
    @MichaelDraper were you able to resolve this?