Skip to content

Instantly share code, notes, and snippets.



Last active Apr 15, 2020
What would you like to do?
OSX vim +python +python3 (pyenv)
#! /bin/sh
# This is just a stub for the Unix configure script, to provide support for
# doing "./configure" in the top Vim directory.
PY_CONFIG=`pyenv prefix 2.7.11/lib/python2.7/config`
PY3_PREFIX=`pyenv prefix 3.4.4`
PY3_CONFIG=`$PY3_PREFIX/bin/python-config --configdir`
cd src && exec ./configure \
--with-features=huge \
--enable-multibyte \
--enable-pythoninterp=dynamic \
--enable-python3interp=dynamic \
--with-python-config-dir=$PY_CONFIG \
--with-python3-config-dir=$PY3_CONFIG \
--enable-cscope \
--prefix=/usr/local $@
# cd src && exec ./configure "$@"
$ env PYTHON_CONFIGURE_OPTS="--enable-shared" pyenv install -fk 2.7.11
$ env PYTHON_CONFIGURE_OPTS="--enable-shared" pyenv install -fk 3.4.4
$ mkdir -p ~/lib
$ cd ~/lib
$ ln -s ../.pyenv/versions/2.7.11/lib/libpython2.7.dylib
$ ln -s ../.pyenv/versions/3.4.4/lib/libpython3.4m.dylib

This comment has been minimized.

Copy link

@cryptoeraser cryptoeraser commented Oct 17, 2018

Great resource, thank you very much! Question about the .dylib bit.

How does Python(s) and Vim know where to find the .dylib files. In your case, ~/lib is not a standard LD path?

~/lib/libpython2.7.dylib -> ../.pyenv/versions/2.7.11/lib/libpython2.7.dylib
~/lib/libpython3.4m.dylib -> ../.pyenv/versions/3.4.4/lib/libpython3.4m.dylib


Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment