Shougo / deoplete.nvim

:stars: Dark powered asynchronous completion framework for neovim/Vim8
Other
5.94k stars 295 forks source link

[deoplete] deoplete requires vim-hug-neovim-rpc plugin in Vim on clean installation #1029

Closed evandrocoan closed 5 years ago

evandrocoan commented 5 years ago

Problems summary

I have put on my .vimrc:

" https://github.com/junegunn/vim-plug/wiki/tips
if empty(glob('~/.vim/autoload/plug.vim'))
  silent !curl -fLo ~/.vim/autoload/plug.vim --create-dirs
    \ https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
  autocmd VimEnter * PlugInstall --sync | source $MYVIMRC
endif

call plug#begin('~/.vim/plugged')

if has('nvim')
  Plug 'Shougo/deoplete.nvim', { 'do': ':UpdateRemotePlugins' }
else
  Plug 'Shougo/deoplete.nvim'
  Plug 'roxma/nvim-yarp'
  Plug 'roxma/vim-hug-neovim-rpc'
endif
let g:deoplete#enable_at_startup = 1

" Initialize plugin system
call plug#end()

I have run the commands:

  1. rm -r .vim
  2. vim
    1 Updated. Elapsed time: 2.731396 sec.
    2 [===]
    3
    4 - Finishing ... Done!
    5 - vim-hug-neovim-rpc: remote: Total 40 (delta 17), reused 19 (de
    lta 6), pack-reused 0
    6 - deoplete.nvim: Resolving deltas: 100% (363/363), done.
    7 - nvim-yarp: remote: Total 27 (delta 7), reused 13 (delta 2), pa
    ck-reused 0

Now, when vim opens, it keeps telling:

  1. [deoplete] deoplete requires vim-hug-neovim-rpc plugin in Vim.
  2. image

Environment

# vim --version
VIM - Vi IMproved 8.0 (2016 Sep 12, compiled Jun 16 2019 17:06:40)
Included patches: 1-197, 322, 377-378, 550, 649, 651, 703, 706-707
Extra patches: 8.1.1401, 8.1.1382, 8.1.1368, 8.1.1367, 8.1.1366, 8.1.1365, 8.1.1046, 8.1.0613, 8.1.0547, 8.1.0546, 8.1.0544, 8.1.0540, 8.1.0539, 8.1.0538, 8.1.0506, 8.1.0208, 8.1.0206, 8.1.0205, 8.1.0189, 8.1.0177, 8.1.0066
Modified by pkg-vim-maintainers@lists.alioth.debian.org
Compiled by pkg-vim-maintainers@lists.alioth.debian.org
Huge version without GUI.  Features included (+) or not (-):
+acl             +file_in_path    +mouse_sgr       +tag_old_static
+arabic          +find_in_path    -mouse_sysmouse  -tag_any_white
+autocmd         +float           +mouse_urxvt     -tcl
-balloon_eval    +folding         +mouse_xterm     +termguicolors
-browse          -footer          +multi_byte      +terminfo
++builtin_terms  +fork()          +multi_lang      +termresponse
+byte_offset     +gettext         -mzscheme        +textobjects
+channel         -hangul_input    +netbeans_intg   +timers
+cindent         +iconv           +num64           +title
-clientserver    +insert_expand   +packages        -toolbar
-clipboard       +job             +path_extra      +user_commands
+cmdline_compl   +jumplist        -perl            +vertsplit
+cmdline_hist    +keymap          +persistent_undo +virtualedit
+cmdline_info    +lambda          +postscript      +visual
+comments        +langmap         +printer         +visualextra
+conceal         +libcall         +profile         +viminfo
+cryptv          +linebreak       -python          +vreplace
+cscope          +lispindent      -python3         +wildignore
+cursorbind      +listcmds        +quickfix        +wildmenu
+cursorshape     +localmap        +reltime         +windows
+dialog_con      -lua             +rightleft       +writebackup
+diff            +menu            -ruby            -X11
+digraphs        +mksession       +scrollbind      -xfontset
-dnd             +modify_fname    +signs           -xim
-ebcdic          +mouse           +smartindent     -xpm
+emacs_tags      -mouseshape      +startuptime     -xsmp
+eval            +mouse_dec       +statusline      -xterm_clipboard
+ex_extra        +mouse_gpm       -sun_workshop    -xterm_save
+extra_search    -mouse_jsbterm   +syntax          
+farsi           +mouse_netterm   +tag_binary      
   system vimrc file: "$VIM/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   -Wdate-time  -g -O2 -fdebug-prefix-map=/build/vim-J466AX/vim-8.0.0197=. -fstack-protector-strong -Wformat -Werror=format-security -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1       
Linking: gcc   -Wl,-z,relro -Wl,-z,now -Wl,--as-needed -o vim        -lm -ltinfo -lnsl  -lselinux -lacl -lattr -lgpm -ldl

Shougo commented 5 years ago

Please upload :messages result.

Your environment seems broken.

Shougo commented 5 years ago

And you should read vim-hug-neovim-rpc requirements.

https://github.com/roxma/vim-hug-neovim-rpc#requirements

evandrocoan commented 5 years ago

The environment cannot be broken because I deleted the ~/.vim directory before vim-plug plugin run the command I showed on the first post.

The output of vim :messages has only the line

[deoplete] deoplete requires vim-hug-neovim-rpc plugin in Vim.

I will look into the vim-hug-neovim-rpc installation instructions.

Shougo commented 5 years ago

OK. I get the problem.

+cryptv          +linebreak       -python          +vreplace
+cscope          +lispindent      -python3         +wildignore

You need to enable Python 3 interface for Vim.

evandrocoan commented 5 years ago

Big thanks! I will follow these steps

  1. https://vi.stackexchange.com/questions/11526/how-to-enable-python-feature-in-vim
  2. https://vi.stackexchange.com/questions/12827/how-to-install-vim-with-python-support-for-debian-strech

And see if I can make it +python

evandrocoan commented 5 years ago

Just to be sure, I deleted the ~/.vim directory again, and I installed vim-nox which has -python but +python3. Now deoplete throws this error after installing everything, exiting vim and opening it back:

Messages maintainer: Bram Moolenaar <Bram@vim.org>
[deoplete] [yarp] [deoplete] job is dead. failed establishing channel for ['python3', '-u', '/root/.vim/plugged/nvim-yarp/pythonx/yarp.py', '/tmp/vX04ZOg/0',
2, 'deoplete']
[deoplete] function deoplete#enable[9]..deoplete#initialize[1]..deoplete#init#_initialize[15]..deoplete#init#_channel[20]..yarp#core#notify[1]..yarp#core#wait
_channel, line 13
'function deoplete#enable[9]..deoplete#initialize[1]..deoplete#init#_initialize[15]..deoplete#init#_channel'
Press ENTER or type command to continue
root@debian9:~# python3 --version
Python 3.5.3

root@debian9:~# pip3 show pynvim
Name: pynvim
Version: 0.3.2
Summary: Python client to neovim
Home-page: http://github.com/neovim/python-client
Author: Thiago de Arruda
Author-email: tpadilha84@gmail.com
License: Apache
Location: /usr/local/lib/python3.5/dist-packages
Requires: greenlet, msgpack

root@debian9:~# vim --version
VIM - Vi IMproved 8.0 (2016 Sep 12, compiled Jun 21 2019 04:10:35)
Included patches: 1-197, 322, 377-378, 550, 649, 651, 703, 706-707
Extra patches: 8.1.1401, 8.1.1382, 8.1.1368, 8.1.1367, 8.1.1366, 8.1.1365, 8.1.1046, 8.1.0613, 8.1.0547, 8.1.0546, 8.1.0544, 8.1.0540, 8.1.0539, 8.1.0538, 8.1.0506, 8.1.0208, 8.1.0206, 8.1.0205, 8.1.0189, 8.1.0177, 8.1.0067, 8.1.0066
Modified by pkg-vim-maintainers@lists.alioth.debian.org
Compiled by pkg-vim-maintainers@lists.alioth.debian.org
Huge version without GUI.  Features included (+) or not (-):
+acl             +file_in_path    +mouse_sgr       +tag_old_static
+arabic          +find_in_path    -mouse_sysmouse  -tag_any_white
+autocmd         +float           +mouse_urxvt     +tcl
-balloon_eval    +folding         +mouse_xterm     +termguicolors
-browse          -footer          +multi_byte      +terminfo
++builtin_terms  +fork()          +multi_lang      +termresponse
+byte_offset     +gettext         -mzscheme        +textobjects
+channel         -hangul_input    +netbeans_intg   +timers
+cindent         +iconv           +num64           +title
-clientserver    +insert_expand   +packages        -toolbar
-clipboard       +job             +path_extra      +user_commands
+cmdline_compl   +jumplist        +perl            +vertsplit
+cmdline_hist    +keymap          +persistent_undo +virtualedit
+cmdline_info    +lambda          +postscript      +visual
+comments        +langmap         +printer         +visualextra
+conceal         +libcall         +profile         +viminfo
+cryptv          +linebreak       -python          +vreplace
+cscope          +lispindent      +python3         +wildignore
+cursorbind      +listcmds        +quickfix        +wildmenu
+cursorshape     +localmap        +reltime         +windows
+dialog_con      +lua             +rightleft       +writebackup
+diff            +menu            +ruby            -X11
+digraphs        +mksession       +scrollbind      -xfontset
-dnd             +modify_fname    +signs           -xim
-ebcdic          +mouse           +smartindent     -xpm
+emacs_tags      -mouseshape      +startuptime     -xsmp
+eval            +mouse_dec       +statusline      -xterm_clipboard
+ex_extra        +mouse_gpm       -sun_workshop    -xterm_save
+extra_search    -mouse_jsbterm   +syntax
+farsi           +mouse_netterm   +tag_binary
   system vimrc file: "$VIM/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   -Wdate-time  -g -O2 -fdebug-prefix-map=/build/vim-xBMBkh/vim-8.0.0197=. -fstack-protector-strong -Wformat -Werror=format-security -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1
Linking: gcc   -L. -Wl,-z,relro -Wl,-z,now -fstack-protector -rdynamic -Wl,-export-dynamic -Wl,-E  -Wl,-z,relro -Wl,-z,now -Wl,--as-needed -o vim        -lm -ltinfo -lnsl  -lselinux  -lacl -lattr -lgpm -ldl  -L/usr/lib -llua5.2 -Wl,-E  -fstack-protector-strong -L/usr/local/lib  -L/usr/lib/x86_64-linux-gnu/perl/5.24/CORE -lperl -ldl -lm -lpthread -lcrypt  -L/usr/lib/python3.5/config-3.5m-x86_64-linux-gnu -lpython3.5m -lpthread -ldl -lutil -lm -L/usr/lib/x86_64-linux-gnu -ltcl8.6 -ldl -lz -lpthread -lieee -lm -lruby-2.3 -lpthread -lgmp -ldl -lcrypt -lm
evandrocoan commented 5 years ago

The vim-hug-neovim-rpc installation is working because they say I should run the command :echo neovim_rpc#serveraddr() to check if the vim-hug-neovim-rpc installation is working. Then, after running it, it correctly printed /tmp/v4Hoig3/0 as they say it should: https://github.com/roxma/vim-hug-neovim-rpc#requirements

Shougo commented 5 years ago

Hm...

Please test the command manually.

$ vim
:echo neovim_rpc#serveraddr()
$ python3 -u /root/.vim/plugged/nvim-yarp/pythonx/yarp.py {neovim_rpc#serveraddr() result} 'deoplete'  # in another terminal
Shougo commented 5 years ago

I recommend for you to use neovim instead.

evandrocoan commented 5 years ago
  1. :echo neovim_rpc#serveraddr() /tmp/vTlxiCt/0
  2. python3 -u /root/.vim/plugged/nvim-yarp/pythonx/yarp.py /tmp/vTlxiCt/0 'deoplete'
    root@debian9:~# python3 -u /root/.vim/plugged/nvim-yarp/pythonx/yarp.py /tmp/vTlxiCt/0 'deoplete'
    Traceback (most recent call last):
     File "/root/.vim/plugged/nvim-yarp/pythonx/yarp.py", line 18, in <module>
       yarpid = int(sys.argv[2])
    ValueError: invalid literal for int() with base 10: 'deoplete'
evandrocoan commented 5 years ago

I think you missed the number 2. In that case, the output is:

root@debian9:~# python3 -u /root/.vim/plugged/nvim-yarp/pythonx/yarp.py /tmp/vTlxiCt/0 2 'deoplete'
Traceback (most recent call last):
  File "/root/.vim/plugged/nvim-yarp/pythonx/yarp.py", line 65, in <module>
    module_obj = importlib.import_module(module)
  File "/usr/lib/python3.5/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 986, in _gcd_import
  File "<frozen importlib._bootstrap>", line 969, in _find_and_load
  File "<frozen importlib._bootstrap>", line 958, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 673, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 673, in exec_module
  File "<frozen importlib._bootstrap>", line 222, in _call_with_frames_removed
  File "/root/.vim/plugged/deoplete.nvim/rplugin/python3/deoplete/__init__.py", line 10, in <module>
    from deoplete.deoplete import Deoplete
  File "/root/.vim/plugged/deoplete.nvim/rplugin/python3/deoplete/deoplete.py", line 29
    self._runtimepath_list: typing.List[str] = []
                          ^
SyntaxError: invalid syntax
Shougo commented 5 years ago

OK. I get it.

Note: deoplete requires Neovim (0.3.0+) or Vim8 (latest is recommended) with
Python3.6.1+ and |+timers| enabled.

Please use Python 3.6.1+.