Youcompleteme: Cannot import ycm_core. Server errors

Created on 28 Mar 2017  路  2Comments  路  Source: ycm-core/YouCompleteMe

Issue Prelude

  • [x] I have read and understood YCM's CONTRIBUTING document.
  • [x] I have read and understood YCM's CODE_OF_CONDUCT document.
  • [x] I have read and understood YCM's README, especially the
    Frequently Asked Questions section.
  • [x] I have searched YCM's issue tracker to find issues similar to the one I'm
    aout to report and couldn't find an answer to my problem. (Example Google
    search.
    )
  • [x] If filing a bug report, I have included the output of vim --version.
  • [x] If filing a bug report, I have included the output of :YcmDebugInfo.
  • [x] If filing a bug report, I have attached the contents of the logfiles using
    the :YcmToggleLogs command.
  • [x] If filing a bug report, I have included which OS (including specific OS
    version) I am using.
  • [ ] If filing a bug report, I have included a minimal test case that reproduces
    my issue, including what I expected to happen and what actually happened.
  • [x] If filing a installation failure report, I have included the entire output
    of install.py (or cmake/make/ninja) including its invocation
  • [x] I understand this is an open-source project staffed by volunteers and
    that any help I receive is a selfless, heartfelt _gift_ of their free time. I
    know I am not entitled to anything and will be polite and courteous.
  • [x] I understand my issue may be closed if it becomes obvious I didn't
    actually perform all of these steps.

Issue Details

I can't get YCM to work on a python3 file, the server errors and I get no autocomplete data. I installed YMC on neovim using dein, with python3.6 from anaconda3 and it compiled without errors. Also the tests appear fine (please check below).

However for some reason the server errors.

Diagnostic data

Output of ./run_tests.py

Ran 278 tests in 124.604s

OK (SKIP=3)

Output of vim --version

NVIM v0.2.0-dev                                                                                                        
Build type: RelWithDebInfo                                                                                             
Compilation: /usr/bin/x86_64-linux-gnu-gcc -g -O2 -fdebug-prefix-map=/build/neovim-spJi9u/neovim-0.1.7ubuntu1+git201703
271904+3269+23~ubuntu16.10.1=. -fstack-protector-strong -Wformat -Werror=format-security -Wconversion -U_FORTIFY_SOURCE
 -D_FORTIFY_SOURCE=1 -O2 -g -DDISABLE_LOG -Wall -Wextra -pedantic -Wno-unused-parameter -Wstrict-prototypes -std=gnu99 
-Wvla -fstack-protector-strong -fdiagnostics-color=auto -DINCLUDE_GENERATED_DECLARATIONS -DHAVE_CONFIG_H -D_GNU_SOURCE 
-I/build/neovim-spJi9u/neovim-0.1.7ubuntu1+git201703271904+3269+23~ubuntu16.10.1/build/config -I/build/neovim-spJi9u/ne
ovim-0.1.7ubuntu1+git201703271904+3269+23~ubuntu16.10.1/src -I/build/neovim-spJi9u/neovim-0.1.7ubuntu1+git201703271904+
3269+23~ubuntu16.10.1/.deps/usr/include -I/build/neovim-spJi9u/neovim-0.1.7ubuntu1+git201703271904+3269+23~ubuntu16.10.
1/.deps/usr/include -I/build/neovim-spJi9u/neovim-0.1.7ubuntu1+git201703271904+3269+23~ubuntu16.10.1/.deps/usr/include 
-I/build/neovim-spJi9u/neovim-0.1.7ubuntu1+git201703271904+3269+23~ubuntu16.10.1/.deps/usr/include -I/build/neovim-spJi
9u/neovim-0.1.7ubuntu1+git201703271904+3269+23~ubuntu16.10.1/.deps/usr/include -I/build/neovim-spJi9u/neovim-0.1.7ubunt
u1+git201703271904+3269+23~ubuntu16.10.1/.deps/usr/include -I/usr/include -I/build/neovim-spJi9u/neovim-0.1.7ubuntu1+gi
t201703271904+3269+23~ubuntu16.10.1/build/src/nvim/auto -I/build/neovim-spJi9u/neovim-0.1.7ubuntu1+git201703271904+3269
+23~ubuntu16.10.1/build/include                                                                                        
Compiled by root@lcy01-03                                                                                              

Optional features included (+) or not (-): +acl   +iconv    +jemalloc +tui                                             
For differences from Vim, see :help vim-differences                                                                    

   system vimrc file: "$VIM/sysinit.vim"                                                                               
  fall-back for $VIM: "/usr/share/nvim"

Output of YcmDebugInfo

Printing YouCompleteMe debug information...                                                                            
-- Client logfile: /tmp/ycm_pqqz2vmp.log                                                                               
-- Server errored, no debug info from server                                                                           
-- Server running at: http://127.0.0.1:35379                                                                           
-- Server process ID: 19577                                                                                            
-- Server logfiles:                                                                                                    
--   /tmp/ycmd_35379_stdout_zj1rocwk.log                                                                               
--   /tmp/ycmd_35379_stderr_q9n5vc0h.log

Contents of YCM, ycmd and completion engine logfiles

/tmp/ycm_y23uhmoi.log: gist

ycmd_stderr:

2017-03-28 12:28:51,118 - ERROR - ycm_core library not detected; you need to compile it by running the build.py script. See the documentation for more details.
Traceback (most recent call last):
  File "/home/florin/.config/nvim/dein/.cache/init.vim/.dein/third_party/ycmd/ycmd/server_utils.py", line 95, in CompatibleWithCurrentCore
    ycm_core = ImportCore()
  File "/home/florin/.config/nvim/dein/.cache/init.vim/.dein/third_party/ycmd/ycmd/server_utils.py", line 87, in ImportCore
    import ycm_core as ycm_core
ImportError: No module named 'ycm_core'

ycmd_stderr: empty

OS version, distribution, etc.

OS: Ubuntu 16.10 x86_64
Kernel: 4.8.0-42-generic

Output of build/install commands

~/Tools/anaconda3/bin/python3.6 install.py --clang-completer

Searching Python 3.6 libraries...
Found Python library: /home/florin/Tools/anaconda3/lib/libpython3.6m.so
Found Python headers folder: /home/florin/Tools/anaconda3/include/python3.6m
-- The C compiler identification is GNU 4.8.5
-- The CXX compiler identification is GNU 4.8.5
-- Check for working C compiler: /home/florin/Tools/anaconda3/bin/cc
-- Check for working C compiler: /home/florin/Tools/anaconda3/bin/cc -- works
-- Detecting C compiler ABI info
-- Checking if C linker supports --verbose
-- Checking if C linker supports --verbose - yes
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /home/florin/Tools/anaconda3/bin/c++
-- Check for working CXX compiler: /home/florin/Tools/anaconda3/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Checking if CXX linker supports --verbose
-- Checking if CXX linker supports --verbose - yes
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found PythonLibs: /home/florin/Tools/anaconda3/lib/libpython3.6m.so (found suitable version "3.6.0", minimum required is "3.3") 

Downloading Clang 4.0.0
-- [download 100% complete]

Using libclang to provide semantic completion for C/C++/ObjC
Using external libclang: /tmp/ycm_build_ndsf3dey/clang+llvm-4.0.0-x86_64-linux-gnu-ubuntu-14.04/lib/libclang.so.4
-- Found PythonInterp: /home/florin/Tools/anaconda3/bin/python3.6 (found version "3.6") 
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Looking for pthread_create
-- Looking for pthread_create - not found
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE  
-- Configuring done
-- Generating done
-- Build files have been written to: /tmp/ycm_build_ndsf3dey
[133/133] Linking CXX shared library /home/florin/.config/...ub.com/Valloric/YouCompleteMe/third_party/ycmd/ycm_core.so

Most helpful comment

See the dein documentation:

Q: YouCompleteMe does not work.  I have built YouCompleteMe manually.

A: dein.vim has merge feature.  It copys the plugins into the merge directory.
So dein.vim does not know the manually built binary.  It does not be copied.
You should disable the merge feature manually. >
call dein#add('Valloric/YouCompleteMe', {'merged': 0})

Another solution is to clear dein cache after building YCM with:

:call dein#recache_runtimepath()

and restart the server (:YcmRestartServer) or restart Vim.

All 2 comments

See the dein documentation:

Q: YouCompleteMe does not work.  I have built YouCompleteMe manually.

A: dein.vim has merge feature.  It copys the plugins into the merge directory.
So dein.vim does not know the manually built binary.  It does not be copied.
You should disable the merge feature manually. >
call dein#add('Valloric/YouCompleteMe', {'merged': 0})

Another solution is to clear dein cache after building YCM with:

:call dein#recache_runtimepath()

and restart the server (:YcmRestartServer) or restart Vim.

@micbou thank you. I tried the second work-around you suggested and it worked just fine.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

hkurj picture hkurj  路  3Comments

d0u9 picture d0u9  路  4Comments

vbextreme picture vbextreme  路  4Comments

Bercio picture Bercio  路  5Comments

tgzhou98 picture tgzhou98  路  3Comments