Skip to content

Instantly share code, notes, and snippets.

@techsolx
Last active September 18, 2020 21:16
Show Gist options
  • Save techsolx/4107a4f18ca2286412a2dc8c78810b3a to your computer and use it in GitHub Desktop.
Save techsolx/4107a4f18ca2286412a2dc8c78810b3a to your computer and use it in GitHub Desktop.
Updating ycm_core with pyenv

The problem I had was how to update ycm_core when it is out of date.

Using pyenv and pyenv virtualenv

Linux 20.04 box with build deps installed:

apt-get -y install build-essential cmake vim python3-dev

ycm installed with: Vundle

Requirement was for dynamic lib.

ERROR: found static Python library (/home/john/.pyenv/versions/3.8.5/lib/python3.8/config-3.8-x86_64-linux-gnu/libpython3.8.a) but a dynamic one is required. You must use a Python compiled with the --enable-shared flag. If using pyenv, you need to run the command:
  export PYTHON_CONFIGURE_OPTS="--enable-shared"

Solution is here:

In vim run:

PluginUpdate

then since I already had 3.8.5 installed but built without "enable shared" I had to do --force it:

env PYTHON_CONFIGURE_OPTS="--enable-shared" pyenv install --force 3.8.5

Then:

cd ~/.vim/bundle/youcompleteme
python install.py --all

Restart vim and you should be good.

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