vim-hug-neovim-rpc: Vim cannot find neovim module

Since a few days, I get the following error message when launching Vim on my (uptodate) Archlinux x86_64 :

[vim-hug-neovim-rpc] Vim(pythonx):ImportError: No module named neovim 
Error detected while processing function deoplete#enable[9]..deoplete#initialize[1]..deoplete#init#_initialize[10]..<SNR>120_ini
t_internal_variables[28]..neovim_rpc#serveraddr:
line   18:
E605: Exception not caught: [vim-hug-neovim-rpc] requires one of `:pythonx import [pynvim|neovim]` command to work

I think the problem occured after an update, either to my System (there has been a lot of python packages updated recently) or to my Vim Plugins after a PlugUpdate.

To solve the this problem, I tried different solutions found on the Web, but no luck. Finally, I uninstalled several packages pip, neovim, greenlet, … and reinstalled neovim.

$ sudo pip3 install neovim
Collecting neovim
  Downloading https://files.pythonhosted.org/packages/78/ec/ac9905ccab8774b64c37cdff9e08db320c349eda0ae3161aebcac83e5590/neovim-0.3.1.tar.gz
Collecting pynvim>=0.3.1 (from neovim)
  Downloading https://files.pythonhosted.org/packages/94/73/9fcf169c4bf1bc6d931a1f4002b139a34950ba5804b9066ffd35fc791550/pynvim-0.4.0.tar.gz
Requirement already satisfied: msgpack>=0.5.0 in /usr/lib/python3.8/site-packages (from pynvim>=0.3.1->neovim) (0.6.2)
Collecting greenlet (from pynvim>=0.3.1->neovim)
  Downloading https://files.pythonhosted.org/packages/f8/e8/b30ae23b45f69aa3f024b46064c0ac8e5fcb4f22ace0dca8d6f9c8bbe5e7/greenlet-0.4.15.tar.gz (59kB)
     |████████████████████████████████| 61kB 2.9MB/s 
Installing collected packages: greenlet, pynvim, neovim
  Running setup.py install for greenlet ... done
  Running setup.py install for pynvim ... done
  Running setup.py install for neovim ... done
Successfully installed greenlet-0.4.15 neovim-0.3.1 pynvim-0.4.0

but without success, error remains the same !

Vim says :

:echo has('python')   --> 1
:echo has('python3')   --> 0
:echo has('pythonx')   --> 1

Please, can you help ?

My Vim version is :

$ vim --version
VIM - Vi IMproved 8.1 (2018 May 18, compilé Nov  7 2019 22:30:47)
Rustines incluses : 1-2268
Compilé par Arch Linux
Énorme version avec interface graphique GTK3.
  Fonctionnalités incluses (+) ou non (-) :
+acl               -farsi             -mouse_sysmouse    -tag_any_white
+arabic            +file_in_path      +mouse_urxvt       +tcl/dyn
+autocmd           +find_in_path      +mouse_xterm       +termguicolors
+autochdir         +float             +multi_byte        +terminal
-autoservername    +folding           +multi_lang        +terminfo
+balloon_eval      -footer            -mzscheme          +termresponse
+balloon_eval_term +fork()            +netbeans_intg     +textobjects
+browse            +gettext           +num64             +textprop
++builtin_terms    -hangul_input      +packages          +timers
+byte_offset       +iconv             +path_extra        +title
+channel           +insert_expand     +perl/dyn          +toolbar
+cindent           +job               +persistent_undo   +user_commands
+clientserver      +jumplist          +postscript        +vartabs
+clipboard         +keymap            +printer           +vertsplit
+cmdline_compl     +lambda            +profile           +virtualedit
+cmdline_hist      +langmap           +python/dyn        +visual
+cmdline_info      +libcall           +python3/dyn       +visualextra
+comments          +linebreak         +quickfix          +viminfo
+conceal           +lispindent        +reltime           +vreplace
+cryptv            +listcmds          +rightleft         +wildignore
+cscope            +localmap          +ruby/dyn          +wildmenu
+cursorbind        +lua/dyn           +scrollbind        +windows
+cursorshape       +menu              +signs             +writebackup
+dialog_con_gui    +mksession         +smartindent       +X11
+diff              +modify_fname      +sound             -xfontset
+digraphs          +mouse             +spell             +xim
+dnd               +mouseshape        +startuptime       -xpm
-ebcdic            +mouse_dec         +statusline        +xsmp_interact
+emacs_tags        +mouse_gpm         -sun_workshop      +xterm_clipboard
+eval              -mouse_jsbterm     +syntax            -xterm_save
+ex_extra          +mouse_netterm     +tag_binary        
+extra_search      +mouse_sgr         -tag_old_static    
         fichier vimrc système : "/etc/vimrc"
     fichier vimrc utilisateur : "$HOME/.vimrc"
 2me fichier vimrc utilisateur : "~/.vim/vimrc"
      fichier exrc utilisateur : "$HOME/.exrc"
        fichier gvimrc système : "/etc/gvimrc"
    fichier gvimrc utilisateur : "$HOME/.gvimrc"
2me fichier gvimrc utilisateur : "~/.vim/gvimrc"
 fichier de valeurs par défaut : "$VIMRUNTIME/defaults.vim"
          fichier menu système : "$VIMRUNTIME/menu.vim"
               $VIM par défaut : "/usr/share/vim"
Compilation : gcc -c -I. -Iproto -DHAVE_CONFIG_H -DFEAT_GUI_GTK  -I/usr/include/gtk-3.0 -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/lib/libffi-3.2.1/include -I/usr/include/harfbuzz -I/usr/include/fribidi -I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/cairo -I/usr/include/pixman-1 -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/gio-unix-2.0 -I/usr/include/atk-1.0 -I/usr/include/at-spi2-atk/2.0 -I/usr/include/at-spi-2.0 -I/usr/include/dbus-1.0 -I/usr/lib/dbus-1.0/include -pthread  -D_FORTIFY_SOURCE=2  -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -D_REENTRANT  -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1       
Édition de liens : 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   -lgtk-3 -lgdk-3 -lz -lpangocairo-1.0 -lpango-1.0 -lharfbuzz -latk-1.0 -lcairo-gobject -lcairo -lgdk_pixbuf-2.0 -lgio-2.0 -lgobject-2.0 -lglib-2.0  -lSM -lICE -lXt -lX11 -lXdmcp -lSM -lICE  -lm -ltinfo -lelf -lnsl    -lcanberra  -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  

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Comments: 15 (2 by maintainers)

Most upvoted comments

@hutou Please read :help has-python.

							*has-python*
You can test what Python version is available with: >
	if has('python')
	  echo 'there is Python 2.x'
	endif
  	if has('python3')
	  echo 'there is Python 3.x'
	endif

Note however, that when Python 2 and 3 are both available and loaded
dynamically, these has() calls will try to load them.  If only one can be
loaded at a time, just checking if Python 2 or 3 are available will prevent
the other one from being available.

To avoid loading the dynamic library, only check if Vim was compiled with
python support: >
	if has('python_compiled')
	  echo 'compiled with Python 2.x support'
	  if has('python_dynamic')
	    echo 'Python 2.x dynamically loaded'
	  endif
	endif
  	if has('python3_compiled')
	  echo 'compiled with Python 3.x support'
	  if has('python3_dynamic')
	    echo 'Python 3.x dynamically loaded'
	  endif
	endif

This also tells you whether Python is dynamically loaded, which will fail if
the runtime library cannot be found.

I think Python2 is loaded before Python3 in your environment. So, Python2 is used and pynvim module is not installed in Python2.

You need to set python3 manually.

set pyxversion=3