Linux
When I tried to install YouCompleteMe, which is a plugin for vim, he told me with a polite error statement, "Shared object isn't there, install python with the enable-shared option."
Run in terminal
env PYTHON_CONFIGURE_OPTS="--enable-shared"pyenv install version
See here https://github.com/pyenv/pyenv/wiki#how-to-build-cpython-with---enable-shared