46

I installed YCM with vim plug, but I may have shut down before process finished. Now when I start vim I get this error "The ycmd server SHUT DOWN (restart wit...the instructions in the documentation."

I've googled but can not find workable solution. I don't see anything in the documentation that helps. But I am new to vim and coding in general so may be missing something.

:YcmDebugInfo comes back with "Server errored, no debug info from server".

I have tried :YcmRestartServer, but to no result -- it pauses then returns the same error. I have also run :PlugInstall and :PlugUpdate, and all plug ins, including YCM, are coming back as up to date.

Chris
  • 28,822
  • 27
  • 83
  • 158
AgentConfusedLlama
  • 599
  • 1
  • 4
  • 11
  • it would be greatly helpful if you also give the log or debug info along with OS and other environment details. – Albatross May 21 '19 at 19:21

9 Answers9

82

I ran into the same issue with Vundle and fixed it like this:
After installing cmake, I cd'd into ~.vim/bundle/YouCompleteMe and ran python install.py

Anushka--x
  • 960
  • 9
  • 9
12

Another problem that may cause that error is conda, you should run install.py from the python's system and not the conda one, to do that use

/usr/bin/python ./install.py

from the youcompleteme folder inside vim

Mike W
  • 1,303
  • 1
  • 21
  • 31
  • Quite similarly `pyenv` introduce shims which when invoking the `python` binary rely on static Python library instead of dynamic ones. Solution is to use the system Python with `/usr/bin/python` as suggested by Mike in his answer. – Cbhihe Feb 01 '22 at 10:46
  • Thanks, this worked for me in 2023 -- had the same issue with Anaconda. – Harsh Verma Jan 20 '23 at 11:29
11

I was also facing the same problem with vim and I am using vim-plug plugin manager. To overcome this I did this:

cd ~/.vim/plugged/youcompleteme
python3 install.py

Done !!!

7

I was also facing the same issue but I have solved by executing the following commands in the Ubuntu terminal

cd ~/.vim/bundle/YouCompleteMe/
sudo pip install cmake
python install.py

or

cd ~/.vim/bundle/YouCompleteMe/
sudo pip install cmake
python3 install.py
  • Thanks. I used your code with one modification:```sudo pip3 install cmake```. In most system, pip3 is used along with python3. – Diablo Jun 21 '23 at 13:28
3

Here is how I have solved Mac OS Catalina 10.15.3 python 3.7 vim 8.2

Install ycm with 'Vim-plug' using Plug 'ycm-core/YouCompleteMe'

  1. cd ~/.vim/plugged/YouCompleteMe
  2. brew install cmake
  3. python ./install.py
lvxi
  • 31
  • 1
1
$ cd ~/.vim/plugged/youcompleteme
$ bash install.sh
(or)
$ python3 install.py

It will only work if you have installed the python3.7 version

Martin Brisiak
  • 3,872
  • 12
  • 37
  • 51
1

2023:

  • macOS Monterey
  • Anaconda
  • Python installed with homebrew

Had to :

cd ~/.vim/bundle/YouCompleteMe/
# DONT use conda python in the following install step
/opt/homebrew/bin/python3 ./install.py
Harsh Verma
  • 529
  • 6
  • 10
0

Here is how I did this recently with following environments

Mac OS Mojave 10.14.3

Vim 8.1.300

Python 3.7

Java version 1.8.0_40

$vim --version | grep python
+comments          +libcall           -python            +viminfo
+conceal           +linebreak         +python3           +vreplace

Installed ycm with Vundle using Plugin 'Valloric/YouCompleteMe' and then running :PluginInstall

The plugins in downloaded to ~/.vim/bundle/YouCompleteMe

$cd  ~/.vim/bundle/YouCompleteMe
$python3 installer.py --java-completer

This creates appropriate files under /.vim/bundle/YouCompleteMe/third_party/ycmd/third_party/eclipse.jdt.ls (make sure these and inner directories are not owned by root unless you always work as a root)

now open vim and execute :YcmRestartServer

You should be good to go.

Try :YcmDebugInfo to check if everything is fine

Printing YouCompleteMe debug information...
-- Client logfile: /var/folders/t4/y8zpydv91sv2dszlb1_3qw_r0000gn/T/ycm_1xgp1ub9.log
-- Server Python interpreter: /usr/local/bin/python
-- Server Python version: 3.7.0
-- Server has Clang support compiled in: False
-- Clang version: None
-- Extra configuration file found but not loaded
-- Extra configuration path: ~/.vim/bundle/YouCompleteMe/third_party/ycmd/.ycm_extra_conf.py
-- Server running at: http://127.0.0.1:58050
-- Server process ID: 2334
-- Server logfiles:
--   /var/folders/t4/y8zpydv91sv2dszlb1_3qw_r0000gn/T/ycmd_58050_stdout_wzk9oksu.log
--   /var/folders/t4/y8zpydv91sv2dszlb1_3qw_r0000gn/T/ycmd_58050_stderr_xjb7zjn2.log

CentOS Linux release 7.6.1810 (Core)

Vim 8.1.1362

Python 3.7.3

Java openjdk version "1.8.0_191"

Overall process remains same, but I had couple of difficulties on Centos

  • Vim was not compiled with Python support
sudo vi /etc/ld.so.conf

added /usr/local/lib to it which had libpython3.7m.so.1.0 file

sudo ldconfig
git clone https://github.com/vim/vim.git
cd vim
./configure --prefix=/usr/local/ --enable-python3interp=yes --with-python3-command=/usr/local/bin/python --with-python3-config-dir=

Rest of the procedure remains the same.

Albatross
  • 669
  • 7
  • 24
0

I had a very similar issue and fixed it today. Here's what I've done

  • Install YCM's requirement in vundle

    cd ~/.vim/bundle/YouCompleteMe; python3 install.py

  • Reproduce the problem, then check its log in vi mode. The error I had reads

    Traceback (most recent call last): File ImportAndCheckCore ycm_core = Import Core() File /.vim/bundle/YouCompleteMe/third_party/ycmd/ycmd/utils.py", line 493, in ImportCore import ycm_core as ycm_core ImportError: ~/miniconda3/lib/libstdc++.so.6: version 'GLIBCXX_3.4.30' not found

  • Check whether libstdc++.so.6 contains GLIBCXX_3.4.30, but receive GLIBCXX_3.4.2x which apparently doesn't satisfy the dependency

    strings ~/miniconda3/lib/libstdc++.so.6 | grep GLIBCXX_3.4.30
    GLIBCXX_3.4.2x
    
  • Then seek the correct libstdc++.so.6 that contains the expected GLIBCXX_3.4.30

    sudo find /usr -type f -name "libstdc++.so.6*"
    /usr/lib64/libstdc++.so.6.0.30
    
    strings /usr/lib64/libstdc++.so.6.0.30 | grep GLIBCXX_3.4.30
    GLIBCXX_3.4.30
    
  • Copy /usr/lib64/libstdc++.so.6.0.30 and create a softlink to ~/miniconda3/lib/libstdc++.so.6


Edited on 20230606

On 6.1.31-1-MANJARO, the same problem got fixed after running cd ~/.vim/bundle/YouCompleteMe; python3 install.py

j3ffyang
  • 1,049
  • 12
  • 12