I am at the end of hour-long research on why I cannot install vim with proper python support. Problems already recognized: Impossible to install python 2 and 3 support together on ubuntu 16.04; oh well.
After finding this gist detailing options someone got to work with pyenv and OSX, I arrived at the following parameters to compile vim, which should really work from the best of my knowledge:
- No sudo,
- no python development libraries -> get Python via pyenv seems sensible.
- Installed pyenv, installed a python 2.7 in there this way:
env PYTHON_CONFIGURE_OPTS="--enable-shared" pyenv install -fk 2.7
export LIBRARY_PATH="$HOME/.pyenv/versions/2.7/lib:$LIBRARY_PATH" PY_CONFIG="$HOME/.pyenv/prefix 2.7/lib/python2.7/config" # I checked that this exists ./configure \ --with-features=huge \ --enable-multibyte \ --enable-pythoninterp=yes \ --with-python-config-dir=$PY_CONFIG \ --enable-gui=gtk2 \ --enable-cscope \ --prefix="$HOME/.local" $@ make install
The configuration yielded i.a.
checking for python2... (cached) /usr/bin/python2 checking Python version... (cached) 2.7 checking Python is 2.3 or better... yep checking Python's install prefix... (cached) /usr checking Python's execution prefix... (cached) /usr (cached) checking Python's configuration directory... (cached) /home/simon/.pyenv/versions/2.7/lib/python2.7/config (cached) checking Python's dll name... (cached) libpython2.7.a checking if -pthread should be used... yes checking if compile and link flags for Python are sane... yes
Which seems okay, right?
vim --version tells me I have compiled with +python support.
But when I try to use a python-related plugin:
Error detected while processing function <SNR>78_init..<SNR>78_exec_file: line 3: E887: Sorry, this command is disabled, the Python's site module could not be loaded.
Why god why :( Please help, thank you so much!