Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Trying to install YCM for hours, unsuccessfully. #1605

Closed
lifeBalance opened this issue Jul 28, 2015 · 26 comments
Closed

Trying to install YCM for hours, unsuccessfully. #1605

lifeBalance opened this issue Jul 28, 2015 · 26 comments

Comments

@lifeBalance
Copy link

I'm on Yosemite, MacVim version 7.4 compiled from source(not homebrew), works fine.
I'm using cmake version 3.3.0, installed using Homebrew.

  1. Installed YCM using vundle.
  2. Created ycm_build directory, cd into it.
  3. cmake -G "Unix Makefiles" . ~/.vim/bundle/YouCompleteMe/third_party/ycmd/cpp
-- The C compiler identification is AppleClang 6.1.0.6020053
-- The CXX compiler identification is AppleClang 6.1.0.6020053
-- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc
-- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++
-- Check for working CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
Your C++ compiler supports C++11, compiling in that mode.
-- Found PythonLibs: /usr/lib/libpython2.7.dylib (found suitable version "2.7.6", minimum required is "2.6")
-- Found PythonInterp: /usr/bin/python2.6 (found suitable version "2.6.9", minimum required is "2.6")
NOT using libclang, no semantic completion for C/C++/ObjC will be available
-- Found PythonInterp: /usr/bin/python2.6 (found version "2.6.9")
-- Looking for include file pthread.h
-- Looking for include file pthread.h - found
-- Looking for pthread_create
-- Looking for pthread_create - found
-- Found Threads: TRUE
-- Configuring done
-- Generating done
-- Build files have been written to: /Users/javi/ycm_build

Then I run:

$ make ycm_support_libs
...

And upon starting Vim, this is what I see:

Error detected while processing function youcompleteme#Enable..<SNR>63_SetUpPython:
line   34:
Traceback (most recent call last):
Press ENTER or type command to continue
Error detected while processing function youcompleteme#Enable..<SNR>63_SetUpPython:
line   34:
  File "<string>", line 25, in <module>
Press ENTER or type command to continue
Error detected while processing function youcompleteme#Enable..<SNR>63_SetUpPython:
line   34:
  File "/Users/javi/GoogleDrive/dotfiles/vim/bundle/YouCompleteMe/autoload/../third_party/ycmd/ycmd/utils.py", line 277, in SafePo
pen
Press ENTER or type command to continue
Error detected while processing function youcompleteme#Enable..<SNR>63_SetUpPython:
line   34:
    return subprocess.Popen( *args, **kwargs )
Press ENTER or type command to continue
Error detected while processing function youcompleteme#Enable..<SNR>63_SetUpPython:
line   34:
  File "/usr/local/Cellar/python/2.7.10_2/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 710, in __in
it__
Press ENTER or type command to continue
Error detected while processing function youcompleteme#Enable..<SNR>63_SetUpPython:
line   34:
    errread, errwrite)
Press ENTER or type command to continue
Error detected while processing function youcompleteme#Enable..<SNR>63_SetUpPython:
line   34:
  File "/usr/local/Cellar/python/2.7.10_2/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 1335, in _ex
ecute_child
Press ENTER or type command to continue
Error detected while processing function youcompleteme#Enable..<SNR>63_SetUpPython:
line   34:
    raise child_exception
Press ENTER or type command to continue
Error detected while processing function youcompleteme#Enable..<SNR>63_SetUpPython:
line   34:
OSError: [Errno 2] No such file or directory
Press ENTER or type command to continue

Something to do with Python, which I have installed using Homebrew. I know it has something to do with the output of cmake:

...
-- Found PythonLibs: /usr/lib/libpython2.7.dylib (found suitable version "2.7.6", minimum required is "2.6")
-- Found PythonInterp: /usr/bin/python2.6 (found suitable version "2.6.9", minimum required is "2.6")
NOT using libclang, no semantic completion for C/C++/ObjC will be available
-- Found PythonInterp: /usr/bin/python2.6 (found version "2.6.9")
...

But don't know exactly how to fix it. Any help will be wellcome.

@vheon
Copy link
Contributor

vheon commented Jul 28, 2015

Try to unlink the brewed python, reinstall YCM through the ./install.sh script and then after reinstall the brewed python.

@lifeBalance
Copy link
Author

All right, I did:

$ brew uninstall python
$ brew update

Reinstall YCM:

  1. deleted the plugin.
  2. :PluginInstall
  3. And finally:
$ cd ~/.vim/bundle/YouCompleteMe
$ ./install.sh

When running vim, this is the result:

Error detected while processing /Users/javi/.vim/bundle/YouCompleteMe/autoload/youcompleteme.vim:
line  674:
E887: Sorry, this command is disabled, the Python's site module could not be loaded.
Press ENTER or type command to continue

Error detected while processing function youcompleteme#Enable..<SNR>63_SetUpPython:
line   34:
E887: Sorry, this command is disabled, the Python's site module could not be loaded.
Press ENTER or type command to continue

Only two errors, we're getting closer.

@vheon
Copy link
Contributor

vheon commented Jul 28, 2015

is it just MacVim or terminal vim as well?

@lifeBalance
Copy link
Author

I hadn't used the gui version, but now that you've mentioned it, I've tried it, and the error messages are identical.

@vheon
Copy link
Contributor

vheon commented Jul 28, 2015

looks like there's still something wrong with you're python. Are you sure you've unbrewed correctly? Look #8 (comment) and the rest of the issue for other tips.

@lifeBalance
Copy link
Author

brew uninstall python, there's no much more I can do, or is there? As to my python:

$ python --version
Python 2.7.6
$ which python
/usr/bin/python

Abouth #8 (comment) I've read it about 4 times today, and it's a mess of contradictory theories, solutions and whatnots, if you could give me more concrete instructions, I would be grateful.
As I said in the first comment, I think the problem is in the output of cmake:

...
-- Found PythonLibs: /usr/lib/libpython2.7.dylib (found suitable version "2.7.6", minimum required is "2.6")
-- Found PythonInterp: /usr/bin/python2.6 (found suitable version "2.6.9", minimum required is "2.6")
NOT using libclang, no semantic completion for C/C++/ObjC will be available
-- Found PythonInterp: /usr/bin/python2.6 (found version "2.6.9")
...

There's a contradiction between the version of the PythonLibs, and the PythonInterp, 2.7 and 2.6 respectively. A friend told me he had the same problem and he solved it passing some options to cmake but he didn't tell me which ones.
How can I pass the PythonInterp option? That could help...

@vheon
Copy link
Contributor

vheon commented Jul 28, 2015

if you could give me more concrete instructions, I would be grateful.

I can't because I've never experience any problem installing YCM since the first day I tried, sorry.

Regarding the flags, check the the https://github.com/Valloric/ycmd/blob/master/build.py

@lifeBalance
Copy link
Author

You didn't experience any issue installing YCM? I have a fresh install of Yosemite, I wasn't even using Homebrew, I just installed it because the README requires it for installing Cmake.
What am I supossed to do with that file? What flags?

@vheon
Copy link
Contributor

vheon commented Jul 28, 2015

That file is what builds ycmd and there you should see what flags you can pass.

@lifeBalance
Copy link
Author

Should I? What a flag looks like?

@vheon
Copy link
Contributor

vheon commented Jul 28, 2015

There is an env variable EXTRA_CMAKE_ARGS which the script will read and pass its content to cmake.

@lifeBalance
Copy link
Author

As neverpanic mentions in issue number 8, there are two flags to be passed to the compiler(Cmake) -DPYTHON_LIBRARY and -DPYTHON_INCLUDE_DIR, in case the install.sh script don't get it right, which in my case looks like it didn't. Does anyone know what values pass to this options, and where to get these values? Thanks.

@vheon
Copy link
Contributor

vheon commented Jul 28, 2015

I guess you should ask over there since this is really a configuration problem and not a YCM bug.

@vheon vheon closed this as completed Jul 28, 2015
@lifeBalance
Copy link
Author

Well, that issue is pretty old and messy. Not everybody has the time to read it through, like I did a couple of times. There's good advice in it, and a lot of noise too. That's why I decided to open a new issue, it maybe helpful for users in my situation. I don't know but, why did you close this issue?

@vheon
Copy link
Contributor

vheon commented Jul 28, 2015

I'll quote myself:

this is really a configuration problem and not a YCM bug

@lifeBalance
Copy link
Author

Who's saying it's a bug? I'm not. An issue is not a but, is it? I'm just trying to get some help for installing the YCM plugin, I'll quote myself:
As neverpanic mentions in issue number 8, there are two flags to be passed to the compiler(Cmake) - DPYTHON_LIBRARY and -DPYTHON_INCLUDE_DIR, in case the install.sh script don't get it right, which in my case looks like it didn't. Does anyone know what values pass to this options, and where to get these values? Thanks.

@vheon
Copy link
Contributor

vheon commented Jul 28, 2015

Then you should look at the first paragraph in CONTRIBUTING.md:

First things first: the issue tracker is NOT for tech support. It is for reporting bugs and requesting features. If your issue amounts to "I can't get YCM to work on my machine" and the reason why is obviously related to your machine configuration and the problem would not be resolved with reasonable changes to the YCM codebase, then the issue is likely to be closed.

@lifeBalance
Copy link
Author

Oh all right then, I hadn't read that. Thanks?

@magic0524
Copy link

I meet this problem before. It is the wrong path to Python which is not I set in YCM building. May sure there's only one Python interpreter on you mac, or you can set the right path to Python by g:ycm_path_to_python_interpreter

@mkolodny
Copy link

Reinstalling vim/macvim with homebrew using fixed this issue for me.

@symbolix
Copy link

I never use homebrew. So never have such issues. But glad that you solved it.

@RussellBradley
Copy link

Just encountered this issue as well - uninstalling vim/macvim via brew as @mkolodny mentioned fixed it for me too.

@slve
Copy link

slve commented Sep 27, 2016

uninstall was not a solution in my case, vim complained at the very beginning, that is not finding python support
I did the following:
cd /usr/local/Cellar/python/2.7.12/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/
mv _io.so _io.so.orig
cp /usr/lib/python2.7/lib-dynload/_io.so ./

( I've built vim8 from source - from github.com/vim/vim.git
./configure --enable-pythoninterp --with-python-config-dir=/usr/lib/python2.7/config/
make
sudo make install)

@liuzongquan
Copy link

@Rhonin1220 That's the answer!

@kamengyi
Copy link

@Rhonin1220 Thanks!

@yinyanghu
Copy link

@Rhonin1220 Works, thanks a lot!

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 17, 2021
# for free to subscribe to this conversation on GitHub. Already have an account? #.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

10 participants