Skip to content
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 · 19 comments
Closed

ImportError: No module named ycm_core #1707

vinllen opened this issue Sep 28, 2015 · 19 comments

Comments

@vinllen
Copy link

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
Copy link
Contributor

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
Copy link
Author

vinllen commented Sep 30, 2015

still cannot solve this problem

@micbou
Copy link
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 as completed Sep 30, 2015
@broccolii
Copy link

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

@shahrilnet
Copy link

shahrilnet commented Sep 13, 2016

@broccolii Thanks! Your solution works for me.

@dbthinking
Copy link

@broccolii Thank you very much!

@puremourning
Copy link
Member

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
Copy link
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
Copy link
Contributor

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
Copy link
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.

@micbou
Copy link
Collaborator

micbou commented Nov 8, 2016

@bstaletic And nothing in :messages?

@bstaletic
Copy link
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.

@vheon
Copy link
Contributor

vheon commented Nov 10, 2016

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

@cocconat
Copy link

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
Copy link
Member

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
Copy link

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
Copy link
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.

@sshsu
Copy link

sshsu commented Dec 19, 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...

the same with you , I ran install.py --clang-completer but mentiond ERROR -ycm_core library not detected ......, really troubles me

@micbou
Copy link
Collaborator

micbou commented Dec 19, 2018

@sshsu My guess is that you are experiencing this dein issue.

I am locking this thread as the most upvoted answer boils down to following the instructions in the docs which seems common sense to me.

@ycm-core ycm-core locked as resolved and limited conversation to collaborators Dec 19, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests