1

So, I've tried the instructions here, and they don't seem to work. One problem could be the config directory specified in the instructions is wrong, so I change the configuration instructions to

cd ~
git clone https://github.com/vim/vim.git
cd vim
./configure --with-features=huge \
                            --enable-multibyte \
                            --enable-rubyinterp=yes \
                            --enable-pythoninterp=yes \
                            --with-python-config-dir=/usr/lib/python2.7/config-x86_64-linux-gnu \
                            --enable-python3interp=yes \
                            --with-python3-config-dir=/usr/lib/python3.6/config-3.6m-x86_64-linux-gnu \
                            --enable-perlinterp=yes \
                            --enable-luainterp=yes \
                            --enable-gui=gtk2 \
                            --enable-cscope \
                            --prefix=/usr/local
make VIMRUNTIMEDIR=/usr/local/share/vim/vim80

which accurately reflects my config directories. I have also verified that I have python installed on my command line, and python3, although, I'm not sure if they're the same versions used in the config file that I provided and don't know how to check that.

When I type vim --version, I get the following output:

vim $ vim --version
VIM - Vi IMproved 8.1 (2018 May 18, compiled Jul  2 2018 14:51:11)
Included patches: 1-137
Compiled by zane@tiki
Huge version without GUI.  Features included (+) or not (-):
+acl               +farsi             +mouse_sgr         -tag_any_white
+arabic            +file_in_path      -mouse_sysmouse    -tcl
+autocmd           +find_in_path      +mouse_urxvt       +termguicolors
-autoservername    +float             +mouse_xterm       +terminal
-balloon_eval      +folding           +multi_byte        +terminfo
+balloon_eval_term -footer            +multi_lang        +termresponse
-browse            +fork()            -mzscheme          +textobjects
++builtin_terms    +gettext           +netbeans_intg     +timers
+byte_offset       -hangul_input      +num64             +title
+channel           +iconv             +packages          -toolbar
+cindent           +insert_expand     +path_extra        +user_commands
-clientserver      +job               -perl              +vartabs
-clipboard         +jumplist          +persistent_undo   +vertsplit
+cmdline_compl     +keymap            +postscript        +virtualedit
+cmdline_hist      +lambda            +printer           +visual
+cmdline_info      +langmap           +profile           +visualextra
+comments          +libcall           +python/dyn        +viminfo
+conceal           +linebreak         +python3/dyn       +vreplace
+cryptv            +lispindent        +quickfix          +wildignore
+cscope            +listcmds          +reltime           +wildmenu
+cursorbind        +localmap          +rightleft         +windows
+cursorshape       -lua               -ruby              +writebackup
+dialog_con        +menu              +scrollbind        -X11
+diff              +mksession         +signs             -xfontset
+digraphs          +modify_fname      +smartindent       -xim
-dnd               +mouse             +startuptime       -xpm
-ebcdic            -mouseshape        +statusline        -xsmp
+emacs_tags        +mouse_dec         -sun_workshop      -xterm_clipboard
+eval              -mouse_gpm         +syntax            -xterm_save
+ex_extra          -mouse_jsbterm     +tag_binary        
+extra_search      +mouse_netterm     +tag_old_static    
   system vimrc file: "$VIM/vimrc"
     user vimrc file: "$HOME/.vimrc"
 2nd user vimrc file: "~/.vim/vimrc"
      user exrc file: "$HOME/.exrc"
       defaults file: "$VIMRUNTIME/defaults.vim"
  fall-back for $VIM: "/usr/local/share/vim"
 f-b for $VIMRUNTIME: "/usr/local/share/vim/vim80"
Compilation: gcc -c -I. -Iproto -DHAVE_CONFIG_H     -g -O2 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1       
Linking: gcc   -L/usr/local/lib -Wl,--as-needed -o vim        -lm -ltinfo -lnsl    -ldl   

You can see that python is checked for dynamically (even though I do not want that, but don't know how to change it). And when I try :echo has('python') or :echo has('python3'), both come back 0.

I'm wondering how I can correctly install vim with python and what I'm doing wrong.

1 Answer 1

2

I needed to install python-dev and python3-dev

For convenience:

sudo apt install python-dev python3-dev -yqq

Sign up to request clarification or add additional context in comments.

4 Comments

Your convenience solution will only work on Linux distributions that use apt.
Is there a way to do this on Windows?
@ashrasmun Install python? Maybe try choco install python
@ZaneHitchcox I was thinking about the equivalent of python-dev packages, but I am fairly sure it's not possible.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.