1

I recently did a fresh install of Neovim and I'm trying to get YouCompleteMe to work. I installed the plugin with vim-plug with no errors, and followed the instructions on the YCM github page step by step, but my python completion is not working correctly. I have Jedi installed.

Here is a picture of what the current completion looks like. It doesn't show the function parameters, which YCM should be displaying enter image description here

Here is the output of :YcmDebugInfo

Printing YouCompleteMe debug information...
-- Client logfile: /tmp/ycm_mdkuez0_.log
-- Server Python interpreter: /usr/bin/python
-- Server Python version: 3.6.5
-- Server has Clang support compiled in: False
-- Clang version: None
-- No extra configuration file found
-- Python completer debug information:
--   JediHTTP running at: http://127.0.0.1:45829
--   JediHTTP process ID: 3114
--   JediHTTP executable: ~/.nvim_extensions/YouCompleteMe/third_party/ycmd/third_party/JediHTTP/jedihttp
--   JediHTTP logfiles:
--     /tmp/jedihttp_45829_stdout_dolu7lhk.log
--     /tmp/jedihttp_45829_stderr_hgbvicgz.log
--   Python interpreter: /usr/bin/python3
-- Server running at: http://127.0.0.1:60969
-- Server process ID: 3073
-- Server logfiles:
--   /tmp/ycmd_60969_stdout_peqrwtbw.log
--   /tmp/ycmd_60969_stderr__mr96bdw.log

The Jedi server seems to be running fine. Here is my init.vim :

set number
filetype on
let g:ycm_python_binary_path = '/usr/bin/python3'
set statusline+=%#warningmsg#
set statusline+=%{SyntasticStatuslineFlag()}
set statusline+=%*
let g:syntastic_always_populate_loc_list = 1
let g:syntastic_auto_loc_list = 1
let g:syntastic_check_on_open = 1
let g:syntastic_check_on_wq = 0
call plug#begin('~/.nvim_extensions')
Plug 'tpope/vim-fugitive'
Plug 'scrooloose/nerdtree'
Plug 'vim-syntastic/syntastic'
Plug 'Valloric/YouCompleteMe', { 'do': './install.py' }
call plug#end()

I am on Manjaro and everything is up to date. If you need any other info about my config please ask. Thank you.

1 Answer 1

1

I just ran into the same problem, and the fix is actually in the docs:

If the value of g:ycm_python_binary_path is an absolute path like above it will be used as-is, but if it's an executable name it will be searched through the PATH. So for example if you set:

let g:ycm_python_binary_path = 'python'

YCM will use the first python executable it finds in the PATH to run jedi. This means that if you are in a virtual environment and you start vim in that directory, the first python that YCM will find will be the one in the virtual environment, so jedi will be able to provide completions for every package you have in the virtual environment.

1
  • the link to the docs no longer works
    – bgenchel
    Jun 30, 2021 at 21:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.