Simon
Simon

Reputation: 631

Valloric/YouCompleteMe plugin for Vim

After installing the Valloric/YouCompleteMe plugin via Vundle I get the following error when I start up vim. I had no issues running the ./install.py script.

File "<string>", line 19, in <module>
  File "/Users/simonorlovsky/.vim/bundle/YouCompleteMe/autoload/../python/ycm/setup.py", line 37, in SetUpSystemPaths
    from ycmd import server_utils as su
  File "/Users/simonorlovsky/.vim/bundle/YouCompleteMe/python/ycm/../../third_party/ycmd/ycmd/server_utils.py", line 25, in <module>
    import io
  File "/usr/local/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7/lib/python2.7/io.py", line 51, in <module>
    import _io
ImportError: dlopen(/usr/local/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/_io.so, 2): Symbol not found: __PyCodecInfo_GetIncrementalDecoder
  Referenced from: /usr/local/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/_io.so
  Expected in: flat namespace
 in /usr/local/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/_io.so
YouCompleteMe unavailable: dlopen(/usr/local/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/_io.so, 2): Symbol not found: __PyCodecInfo_GetIncrementalDecoder
  Referenced from: /usr/local/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/_io.so
  Expected in: flat namespace
 in /usr/local/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/_io.so
Press ENTER or type command to continue

I am new to the vim plugin community so I was wondering if anyone has any insight to what the problem may be.


EDIT

Ultimately the solution was to reinstall macvim and remove the brew version of python on my machine.

Thanks for advice!

Upvotes: 1

Views: 4628

Answers (2)

gloriphobia
gloriphobia

Reputation: 1493

Thanks for asking this question, I was quite puzzled by this. I had a really tough time getting this plugin to work!

So the steps are as follows

The key thing to get around this specific error is to update vim.

brew install macvim --with-override-system-vim

After you do this, close your terminal and open a new terminal. Check the version of vim, it should be version 8 now, i.e.

vim --version | grep IMproved

should have the output:

VIM - Vi IMproved 8.0 (2016 Sep 12, compiled Apr 20 2017 20:02:24)

Note that it will still be the old mac version until you close your terminal and open a new one.

Now remove the incomplete copy of YouCompleteMe:

sudo rm -rf ~/.vim/bundle/YouCompleteMe

then open vim and install the plugin again

:PluginInstall

It should be successful and not have the error reported in this question. However, I found that when I tried to use it, it wasn't working correctly. You're not done yet! You still need to manually install YouCompleteMe. You can do this by (the --clang-completer is optional, it's just for if you want semantic support for c-family languages):

cd ~/.vim/bundle/YouCompleteMe
./install.py --clang-completer

You may need to install cmake to do this, so just in case, here is the command:

brew install cmake

I hope this works for you! Try it out in a python file. Here is the github repo if you want to checkout the readme: https://github.com/Valloric/YouCompleteMe

Let me know if you have any problems.

Upvotes: 2

sdeleon28
sdeleon28

Reputation: 329

This can also happen when you have a faulty YouCompleteMe installation. Removing the plugin and installing it again fixed it for me.

Upvotes: 0

Related Questions