New issue

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

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

Already on GitHub? Sign in to your account

ImportError: No module named ycm_core #1707

Closed
vinllen opened this Issue Sep 28, 2015 · 17 comments

Comments

Projects
None yet
10 participants
@vinllen

vinllen commented Sep 28, 2015

Hi, all:

I install the ycm success:

[ 95%] Building CXX object ycm/CMakeFiles/ycm_client_support.dir/Result.cpp.o
[ 95%] Building CXX object ycm/CMakeFiles/ycm_client_support.dir/Utils.cpp.o
[ 95%] Building CXX object ycm/CMakeFiles/ycm_core.dir/Utils.cpp.o
[ 96%] Building CXX object ycm/CMakeFiles/ycm_client_support.dir/versioning.cpp.o
[ 97%] Building CXX object ycm/CMakeFiles/ycm_core.dir/versioning.cpp.o
[ 98%] Building CXX object ycm/CMakeFiles/ycm_client_support.dir/ycm_client_support.cpp.o
[100%] Building CXX object ycm/CMakeFiles/ycm_core.dir/ycm_core.cpp.o
[100%] Linking CXX shared library /Users/vinllen/.vim/bundle/YouCompleteMe/third_party/ycmd/ycm_client_support.so
[100%] Built target ycm_client_support
[100%] Linking CXX shared library /Users/vinllen/.vim/bundle/YouCompleteMe/third_party/ycmd/ycm_core.so
[100%] Built target ycm_core
Scanning dependencies of target ycm_support_libs
[100%] Built target ycm_support_libs

Then i add the code into my .vimrc:

let g:ycm_global_ycm_extra_conf = '~/.vim/bundle/YouCompleteMe/.ycm_extra_conf.py'

but it has no effect. When i try to run the .ycm_extra_conf.py, some errors occurs:

Traceback (most recent call last):
  File ".ycm_extra_conf.py", line 32, in <module>
    import ycm_core
ImportError: No module named ycm_core

But the ycm_core was install success at the first compile

@vheon

This comment has been minimized.

Show comment
Hide comment
@vheon

vheon Sep 28, 2015

Collaborator

let g:ycm_global_ycm_extra_conf = '~/.vim/bundle/YouCompleteMe/.ycm_extra_conf.py'

Try moving the global ycm_extra_conf out of the YouCompleteMe folder.

Collaborator

vheon commented Sep 28, 2015

let g:ycm_global_ycm_extra_conf = '~/.vim/bundle/YouCompleteMe/.ycm_extra_conf.py'

Try moving the global ycm_extra_conf out of the YouCompleteMe folder.

@vinllen

This comment has been minimized.

Show comment
Hide comment
@vinllen

vinllen Sep 30, 2015

still cannot solve this problem

vinllen commented Sep 30, 2015

still cannot solve this problem

@micbou

This comment has been minimized.

Show comment
Hide comment
@micbou

micbou Sep 30, 2015

Collaborator

.ycm_extra_conf.py file is not meant to be directly run. Read the documentation.

I am closing because you did not tell us what you are trying to achieve and the reported issue is not actually an issue.

Collaborator

micbou commented Sep 30, 2015

.ycm_extra_conf.py file is not meant to be directly run. Read the documentation.

I am closing because you did not tell us what you are trying to achieve and the reported issue is not actually an issue.

@micbou micbou closed this Sep 30, 2015

@broccolii

This comment has been minimized.

Show comment
Hide comment
@broccolii

broccolii May 27, 2016

I use this command can fix this bug
cd ~/.vim/bundle/YouCompleteMe
./install.py --clang-completer

broccolii commented May 27, 2016

I use this command can fix this bug
cd ~/.vim/bundle/YouCompleteMe
./install.py --clang-completer

@shahril96

This comment has been minimized.

Show comment
Hide comment
@shahril96

shahril96 Sep 13, 2016

@broccolii Thanks! Your solution works for me.

shahril96 commented Sep 13, 2016

@broccolii Thanks! Your solution works for me.

@maiyuyu

This comment has been minimized.

Show comment
Hide comment
@maiyuyu

maiyuyu Nov 7, 2016

@broccolii Thank you very much!

maiyuyu commented Nov 7, 2016

@broccolii Thank you very much!

@puremourning

This comment has been minimized.

Show comment
Hide comment
@puremourning

puremourning Nov 7, 2016

Collaborator

I use this command can fix this bug

I'm trying to understand why people are coming across this. First, of course it isn't a bug. Second, I thought that when this happened we issued a message saying that installation was required.

Are people not getting that message?

Collaborator

puremourning commented Nov 7, 2016

I use this command can fix this bug

I'm trying to understand why people are coming across this. First, of course it isn't a bug. Second, I thought that when this happened we issued a message saying that installation was required.

Are people not getting that message?

@bstaletic

This comment has been minimized.

Show comment
Hide comment
@bstaletic

bstaletic Nov 8, 2016

Collaborator

@puremourning

Are people not getting that message?

I've been wondering if it just me or is the message not showing. I've just tried making a clean clone of the YCM repo and starting YCM without compiling. As expected the message was not shown anywhere. Actually the message is in stderr, but is not shown unless user explicitly opens the stderr log.

Collaborator

bstaletic commented Nov 8, 2016

@puremourning

Are people not getting that message?

I've been wondering if it just me or is the message not showing. I've just tried making a clean clone of the YCM repo and starting YCM without compiling. As expected the message was not shown anywhere. Actually the message is in stderr, but is not shown unless user explicitly opens the stderr log.

@vheon

This comment has been minimized.

Show comment
Hide comment
@vheon

vheon Nov 8, 2016

Collaborator

@bstaletic you should get the message as soon as YCM is needed. So if you didn't run the compilation step, after you type a couple of character you should get the error.

Collaborator

vheon commented Nov 8, 2016

@bstaletic you should get the message as soon as YCM is needed. So if you didn't run the compilation step, after you type a couple of character you should get the error.

@bstaletic

This comment has been minimized.

Show comment
Hide comment
@bstaletic

bstaletic Nov 8, 2016

Collaborator

@vheon Fair enough. I tried it again, this time typing more than enough characters, using :YcmForceCompileAndDiagnostics and :YcmShowDetailedDiagnostics.

The only message I've got is:

Native filetype completion not supported for current file, cannot force recompilation.

That was after :YcmForceCompileAndDiagnostics. :YcmShowDetailedDiagnostics produced no outpu.

The desired

2016-11-08 20:26:07,798 - ERROR - ycm_core library not detected; you need to compile it by running the build.py script. See the documentation for more details.

was nowhere to be seen, except in the stderr file itself.

Collaborator

bstaletic commented Nov 8, 2016

@vheon Fair enough. I tried it again, this time typing more than enough characters, using :YcmForceCompileAndDiagnostics and :YcmShowDetailedDiagnostics.

The only message I've got is:

Native filetype completion not supported for current file, cannot force recompilation.

That was after :YcmForceCompileAndDiagnostics. :YcmShowDetailedDiagnostics produced no outpu.

The desired

2016-11-08 20:26:07,798 - ERROR - ycm_core library not detected; you need to compile it by running the build.py script. See the documentation for more details.

was nowhere to be seen, except in the stderr file itself.

@micbou

This comment has been minimized.

Show comment
Hide comment
@micbou

micbou Nov 8, 2016

Collaborator

@bstaletic And nothing in :messages?

Collaborator

micbou commented Nov 8, 2016

@bstaletic And nothing in :messages?

@bstaletic

This comment has been minimized.

Show comment
Hide comment
@bstaletic

bstaletic Nov 8, 2016

Collaborator

:messages has the desired message, but I am pretty sure I had seen that message without opening :messages. In fact I think I did not know about :messages back then.

Collaborator

bstaletic commented Nov 8, 2016

:messages has the desired message, but I am pretty sure I had seen that message without opening :messages. In fact I think I did not know about :messages back then.

@vheon

This comment has been minimized.

Show comment
Hide comment
@vheon

vheon Nov 10, 2016

Collaborator

@micbou I think we should make the "compile ycmd message" more clear: #1652 (comment)

Collaborator

vheon commented Nov 10, 2016

@micbou I think we should make the "compile ycmd message" more clear: #1652 (comment)

@cocconat

This comment has been minimized.

Show comment
Hide comment
@cocconat

cocconat Mar 14, 2017

Ok, the problem is the documentation in Full Installation isn't very clear how to behave with the ./install.sh

I mean: I ve built and compiled as the author of the issue in ycm_build, following the guide, step by step.

Then it says 'you have done', without any reference to ./install.sh, furthermore during install.sh it downloads the libclang which I already download for the installation!
So can you be more detailed in the doc :)

cocconat commented Mar 14, 2017

Ok, the problem is the documentation in Full Installation isn't very clear how to behave with the ./install.sh

I mean: I ve built and compiled as the author of the issue in ycm_build, following the guide, step by step.

Then it says 'you have done', without any reference to ./install.sh, furthermore during install.sh it downloads the libclang which I already download for the installation!
So can you be more detailed in the doc :)

@puremourning

This comment has been minimized.

Show comment
Hide comment
@puremourning

puremourning Mar 14, 2017

Collaborator

The docs are pretty clear:

Compiling YCM with semantic support for C-family languages:

cd ~/.vim/bundle/YouCompleteMe
./install.py --clang-completer
Compiling YCM without semantic support for C-family languages:

cd ~/.vim/bundle/YouCompleteMe
./install.py
The following additional language support options are available:

C# support: install Mono and add --omnisharp-completer when calling ./install.py.
Go support: install Go and add --gocode-completer when calling ./install.py.
TypeScript support: install Node.js and npm then install the TypeScript SDK with npm install -g typescript.
JavaScript support: install Node.js and npm and add --tern-completer when calling ./install.py.
Rust support: install Rust and add --racer-completer when calling ./install.py.
To simply compile with everything enabled, there's a --all flag. So, to install with all language features, ensure xbuild, go, tsserver, node, npm, rustc, and cargo tools are installed and in your PATH, then simply run:

cd ~/.vim/bundle/YouCompleteMe
./install.py --all
That's it. You're done. Refer to the User Guide section on how to use YCM. Don't forget that if you want the C-family semantic completion engine to work, you will need to provide the compilation flags for your project to YCM. It's all in the User Guide.

Collaborator

puremourning commented Mar 14, 2017

The docs are pretty clear:

Compiling YCM with semantic support for C-family languages:

cd ~/.vim/bundle/YouCompleteMe
./install.py --clang-completer
Compiling YCM without semantic support for C-family languages:

cd ~/.vim/bundle/YouCompleteMe
./install.py
The following additional language support options are available:

C# support: install Mono and add --omnisharp-completer when calling ./install.py.
Go support: install Go and add --gocode-completer when calling ./install.py.
TypeScript support: install Node.js and npm then install the TypeScript SDK with npm install -g typescript.
JavaScript support: install Node.js and npm and add --tern-completer when calling ./install.py.
Rust support: install Rust and add --racer-completer when calling ./install.py.
To simply compile with everything enabled, there's a --all flag. So, to install with all language features, ensure xbuild, go, tsserver, node, npm, rustc, and cargo tools are installed and in your PATH, then simply run:

cd ~/.vim/bundle/YouCompleteMe
./install.py --all
That's it. You're done. Refer to the User Guide section on how to use YCM. Don't forget that if you want the C-family semantic completion engine to work, you will need to provide the compilation flags for your project to YCM. It's all in the User Guide.

@bgenchel

This comment has been minimized.

Show comment
Hide comment
@bgenchel

bgenchel Jul 6, 2018

Running on 4.13.0-39-generic GNU/Linux

Getting the same error, that the ycm_core cannot be imported.

Ran install.py with --clang-completer flag.

Not really sure what to do. I've rebuilt several times. The error message in the log files says I should run build.py, specifically:

2018-07-06 16:36:21,534 - ERROR - ycm_core library not detected; you need to compile it by running the build.py script. See the documentation for more details

I don't see build.py in ycm's home dir, and I don't see anything about it in the docs...

bgenchel commented Jul 6, 2018

Running on 4.13.0-39-generic GNU/Linux

Getting the same error, that the ycm_core cannot be imported.

Ran install.py with --clang-completer flag.

Not really sure what to do. I've rebuilt several times. The error message in the log files says I should run build.py, specifically:

2018-07-06 16:36:21,534 - ERROR - ycm_core library not detected; you need to compile it by running the build.py script. See the documentation for more details

I don't see build.py in ycm's home dir, and I don't see anything about it in the docs...

@bstaletic

This comment has been minimized.

Show comment
Hide comment
@bstaletic

bstaletic Jul 6, 2018

Collaborator

It's better to open a new thread and provide all the requested info. Or even ask on gitter.
At this point, there's a bunch of stuff that might have gone wrong and we have no information to go from.

Collaborator

bstaletic commented Jul 6, 2018

It's better to open a new thread and provide all the requested info. Or even ask on gitter.
At this point, there's a bunch of stuff that might have gone wrong and we have no information to go from.

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