Please complete these steps and check these boxes (by putting an x inside
the brackets) _before_ filing your issue:
vim --version.:YcmDebugInfo.:YcmToggleLogs command.vim -Nu /path/to/YCM/vimrc_ycm_minimal, including what Iinstall.py (or cmake/make/ninja) including its invocationThank you for adhering to this process! It ensures your issue is resolved
quickly and that neither your nor our time is needlessly wasted.
Despite popularity of this error, and variety of solutions to solve, unfortunately none of the already proposed solutions worked for me.
Include steps to reproduce here.
I get this error when I open vim.
Include description of a minimal test case, including any actual code required
to reproduce the issue.
If you made changes to
vimrc_ycm_minimal, pase them here:
I made no change tovimrc_ycm_minimal
Enable debugging
let g:ycm_keep_logfiles = 1
let g:ycm_log_level = 'debug'
" If the base settings don't repro, paste your existing config for YCM only,
" here:
" let g:ycm_....
" Load YCM (only)
let &rtp .= ',' . expand( '<sfile>:p:h' )
filetype plugin indent on
What did you expect to happen?
No error.
What actually happened?
I get error and autocompletion doesn't work.
vim --versionVIM - Vi IMproved 8.2 (2019 Dec 12, compiled May 23 2020 22:02:57)
Included patches: 1-814
Compiled by Arch Linux
Huge version without GUI. Features included (+) or not (-):
+acl -farsi +mouse_sgr +tag_binary
+arabic +file_in_path -mouse_sysmouse -tag_old_static
+autocmd +find_in_path +mouse_urxvt -tag_any_white
+autochdir +float +mouse_xterm +tcl/dyn
-autoservername +folding +multi_byte +termguicolors
-balloon_eval -footer +multi_lang +terminal
+balloon_eval_term +fork() -mzscheme +terminfo
-browse +gettext +netbeans_intg +termresponse
++builtin_terms -hangul_input +num64 +textobjects
+byte_offset +iconv +packages +textprop
+channel +insert_expand +path_extra +timers
+cindent +ipv6 +perl/dyn +title
-clientserver +job +persistent_undo -toolbar
-clipboard +jumplist +popupwin +user_commands
+cmdline_compl +keymap +postscript +vartabs
+cmdline_hist +lambda +printer +vertsplit
+cmdline_info +langmap +profile +virtualedit
+comments +libcall +python/dyn +visual
+conceal +linebreak +python3/dyn +visualextra
+cryptv +lispindent +quickfix +viminfo
+cscope +listcmds +reltime +vreplace
+cursorbind +localmap +rightleft +wildignore
+cursorshape +lua/dyn +ruby/dyn +wildmenu
+dialog_con +menu +scrollbind +windows
+diff +mksession +signs +writebackup
+digraphs +modify_fname +smartindent -X11
-dnd +mouse -sound -xfontset
-ebcdic -mouseshape +spell -xim
+emacs_tags +mouse_dec +startuptime -xpm
+eval +mouse_gpm +statusline -xsmp
+ex_extra -mouse_jsbterm -sun_workshop -xterm_clipboard
+extra_search +mouse_netterm +syntax -xterm_save
system vimrc file: "/etc/vimrc"
user vimrc file: "$HOME/.vimrc"
2nd user vimrc file: "~/.vim/vimrc"
user exrc file: "$HOME/.exrc"
defaults file: "$VIMRUNTIME/defaults.vim"
fall-back for $VIM: "/usr/share/vim"
Compilation: gcc -c -I. -Iproto -DHAVE_CONFIG_H -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1
Linking: gcc -L. -Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now -fstack-protector-strong -rdynamic -Wl,-export-dynamic -Wl,-E -Wl,-rpath,/usr/lib/perl5/5.30/core_perl/CORE -Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now -L/usr/local/lib -Wl,--as-needed -o vim -lm -ltinfo -lelf -lacl -lattr -lgpm -ldl -Wl,-E -Wl,-rpath,/usr/lib/perl5/5.30/core_perl/CORE -Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now -fstack-protector-strong -L/usr/local/lib -L/usr/lib/perl5/5.30/core_perl/CORE -lperl -lpthread -ldl -lm -lcrypt -lutil -lc -L/usr/lib -ltclstub8.6 -ldl -lz -lpthread -lm
YcmDebugInfoE492: Not an editor command: YcmDebugInfo
I think this could cause the issue, I couldn't find ~/.vim/bundle/YouCompleteMe/autoload/youcompleteme.vim in the output :scriptnames. Although I did add set rtp+=~/.vim/bundle/YouCompleteMe to ~/.vimrc, but no help.
YcmDiagsE492: Not an editor command: YcmDebugInfo
git rev-parse HEAD in YouCompleteMe installation directory
Reproduce the issue with
vim -Nu /path/to/YCM/vimrc_ycm_minimal, which
enabled debug logging and other useful diagnostics. Include a link to a
gist containing all of the log files listed by:YcmToggleLogs.
Linux archlinux 5.4.47-1-lts #1 SMP x86_64 GNU/Linux
Include link to a gist containing the invocation and entire output of
install.pyif reporting an installation issue.
Hi. Can you do :py3 pass in your vim?
Hi,
py3 pass outputs
E837: This Vim cannot execute :py3 after using :python
E263: Sorry, this command is disabled, the Python library could not be loaded.
the only python I have installed is Python 3.8.3.
which python -> /usr/bin/python
If I ran py print("hello") or pyth0n print("hello") -> it does output hello.
also:
vim --version | grep python
+comments +libcall +python/dyn +visual
+conceal +linebreak +python3/dyn +visualextra
Thanks for the help.
If I ran py print("hello") or pyth0n print("hello") -> it does output hello.
That's loading python2. YCM requires python 3. Vim can only load one version of libpython.so. If another plugin that needs python2 is loaded first, YCM won't be able to work.
As Boris said your vim needs functioning python3.
I recommend finding out which plugin or whatever is using python2 and upgrading it. Otehrwsie there are instructions on the front page for using our legacy python2 branch.
You are absolutely right,
It was my own fault in fact. To add virtualenv support I'd added
"python with virtualenv support
py << EOF
import os
import sys
if 'VIRTUAL_ENV' in os.environ:
project_base_dir = os.environ['VIRTUAL_ENV']
activate_this = os.path.join(project_base_dir, 'bin/activate_this.py')
execfile(activate_this, dict(__file__=activate_this))
EOF
where the py << EOF was causing the error. It got fixed after changing to py3 << EOF
Thanks for the help.
I recently upgraded from fedora 30 to fedora 32 and ran into this issue.
Running :py3 pass made error that vim could not find module libpython37.so. I have python 3 installed, but I needed to install python37. sudo dnf install python37 fixed issue for me. Just commenting in case somebody else has issue. I'm sure there are a lot of culprits for unable to load python.
I recently upgraded MacVim and ran into this issue. MacVim has updated from 3.8 to 3.9, and i only had ~3.9~ 3.8 installed via homebrew. Upgrading python fixed the issue for me.
I recently upgraded MacVim and ran into this issue. MacVim has updated from 3.8 to 3.9, and i only had 3.9 installed via homebrew. Upgrading python fixed the issue for me.
You upgraded python or MacVim?
You upgraded python or MacVim?
Sorry had a confusing typo in my comment.
Upgrading MacVim broke YCM, as it MacVim expected python 3.9 after the upgrade and couldn't start python 3 at all without it present. So, upgrading python fixed the issue.
Most helpful comment
You are absolutely right,
It was my own fault in fact. To add virtualenv support I'd added
where the
py << EOFwas causing the error. It got fixed after changing topy3 << EOFThanks for the help.