Youcompleteme: won't work on macOS Mojave

Created on 5 Nov 2018  路  12Comments  路  Source: ycm-core/YouCompleteMe

YouCompleteMe unavailable: dlopen(/usr/local/Cellar/python@2/2.7.15_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/_io.so, 0x0002): code signature in (/usr/local/Cellar/python@2/2.7.15_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/_io.so) not valid for use in process: mapped file has no cdhash, completely unsigned? Code has to be at least ad-hoc signed.

Most helpful comment

@StevenShi-23 I fixed the issue for myself, running all these commands (I use pathogen.vim so YouCompleteMe is installed in ~/.vim/bundle):

brew install vim
cd ~/.vim/bundle/YouCompleteMe
python install.py

My python --version is

Python 2.7.15

and I think it's installed with homebrew:

$ which python
/usr/local/bin/python

All 12 comments

@theonlygusti I have a similar case. I am not quite sure what does it mean by fixing the Python installation path described in issue #3158 . My python installation path seems to be correct. Maybe a more legitimate fix is to get YCM signed, as opposed to disabling System Integrity Protection?

Can your vim do :py print(1) or :py3 print(1)? If not it's a python/vim installation issue.

Yup, :py print(1) works for me.

How about :py import _io?

No, it returns the same error:

Traceback (most recent call last):
  File "<string>", line 1, in <module>
ImportError: dlopen(/usr/local/Cellar/python@2/2.7.14_3/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/_io.so, 0x0002): code signature in (/usr/local/Cellar/python@2/2.7.14_3/Framework
s/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/_io.so) not valid for use in process: mapped file has no cdhash, completely unsigned? Code has to be at least ad-hoc signed.

Then this is definitely a problem with your vim/python installation. Come to https://gitter.im/Valloric/YouCompleteMe if you want further help, as this is not a YCM bug.

Duplicate of #3158.

@StevenShi-23 I fixed the issue for myself, running all these commands (I use pathogen.vim so YouCompleteMe is installed in ~/.vim/bundle):

brew install vim
cd ~/.vim/bundle/YouCompleteMe
python install.py

My python --version is

Python 2.7.15

and I think it's installed with homebrew:

$ which python
/usr/local/bin/python

@theonlygusti Thank you. For me, it works with vim installed via brew (v 8.1), but does not work on native vim (v 8.0) from MacOS.

For me, uninstalling Homebrew's python@2 fixed it.

I had this error before and this combination seems to work.

` ~ python --version Python 2.7.16 ~ python2 --version Python 2.7.16 ~ python3 --version Python 3.7.3 ~ vim --version VIM - Vi IMproved 8.1 (2018 May 18, compiled Apr 11 2019 17:46:54) macOS version Included patches: 1-1150 Compiled by Homebrew ~ git clone [email protected]:johndgiese/dotvim.git ~/.vim ~ sh ~/.vim/install.sh # this will run for a while and install various plugins including YCM ~ alias vi='/usr/local/bin/vim'

@StevenShi-23 I fixed the issue for myself, running all these commands (I use pathogen.vim so YouCompleteMe is installed in ~/.vim/bundle):

brew install vim
cd ~/.vim/bundle/YouCompleteMe
python install.py

My python --version is

Python 2.7.15

and I think it's installed with homebrew:

$ which python
/usr/local/bin/python

I try to work as u said. But I cannot use python to run install.py. Seems that build.py does not support python2.

YouCompleteMe git:(master) python install.py
  File "/Users/neal/.vim/plugged/YouCompleteMe/third_party/ycmd/build.py", line 965
    print( *args, **kwargs )
           ^
SyntaxError: invalid syntax
Was this page helpful?
0 / 5 - 0 ratings