Deoplete.nvim: Python Error after updating deoplete to the latest version with dein

Created on 19 Feb 2020  ยท  19Comments  ยท  Source: Shougo/deoplete.nvim

# Problems summary
After updating deoplete to the latest version, I receive following error when changing into insert mode after restarting neovim:

[deoplete] Traceback (most recent call last):
  File "/home/puresick/.cache/dein/.cache/minimal.vim/.dein/autoload/deoplete/_main.py", line 56, in main
    child.main_loop(stdout)
  File "/home/puresick/.cache/dein/.cache/minimal.vim/.dein/rplugin/python3/deoplete/child.py", line 60, in main_loop
    name = child_in['name']
KeyError: 'name'
Error in child: KeyError('name').  Use :messages / see above for error details.

Expected

No error message and deoplete running like before the update.

Environment Information

  • deoplete version (SHA1): b49d2a477e37b3dd8f59b59669b1ba33c1082f93 deoplete.vim

  • OS: Arch Linux

  • neovim/Vim :version output:

NVIM v0.4.3
Build type: Release
LuaJIT 2.0.5
Compilation: /usr/bin/cc -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -O2 -DNDEBUG -DMIN_LOG_LEVEL=3 -Wall -Wextra -peda
ntic -Wno-unused-parameter -Wstrict-prototypes -std=gnu99 -Wshadow -Wconversion -Wmissing-prototypes -Wimplicit-fallthrough
 -Wvla -fstack-protector-strong -fdiagnostics-color=always -DINCLUDE_GENERATED_DECLARATIONS -D_GNU_SOURCE -DNVIM_MSGPACK_HA
S_FLOAT32 -DNVIM_UNIBI_HAS_VAR_FROM -I/build/neovim/src/build/config -I/build/neovim/src/neovim-0.4.3/src -I/usr/include -I
/build/neovim/src/build/src/nvim/auto -I/build/neovim/src/build/include
Compiled by builduser

Features: +acl +iconv +tui
See ":help feature-compile"

   system vimrc file: "$VIM/sysinit.vim"
  fall-back for $VIM: "/usr/share/nvim"

  • :checkhealth or :CheckHealth result(neovim only):
health#deoplete#check
========================================================================
## deoplete.nvim
  - OK: exists("v:t_list") was successful
  - OK: has("timers") was successful
  - OK: has("python3") was successful
  - OK: Require Python 3.6.1+ was successful
  - ERROR: Require msgpack 1.0.0+ was not successful
    - ADVICE:
      - Please install/upgrade msgpack 1.0.0+.
  - INFO: If you're still having problems, try the following commands:
    $ export NVIM_PYTHON_LOG_FILE=/tmp/log
    $ export NVIM_PYTHON_LOG_LEVEL=DEBUG
    $ nvim
    $ cat /tmp/log_{PID}
    and then create an issue on github

health#nvim#check
========================================================================
## Configuration
  - OK: no issues found

## Performance
  - OK: Build type: Release

## Remote Plugins
  - WARNING: ".dein" is not registered.
  - WARNING: Out of date
    - ADVICE:
      - Run `:UpdateRemotePlugins`

## terminal
  - INFO: key_backspace (kbs) terminfo entry: key_backspace=^H
  - INFO: key_dc (kdch1) terminfo entry: key_dc=\E[3~
  - INFO: $VTE_VERSION='5803'
  - INFO: $COLORTERM='truecolor'

health#provider#check
========================================================================
## Clipboard (optional)
  - OK: Clipboard tool found: workaroundClipboard

## Python 2 provider (optional)
  - WARNING: No Python executable found that can `import neovim`. Using the first available executable for diagnostics.
  - ERROR: Python provider error:
    - ADVICE:
      - provider/pythonx: Could not load Python 2:
          /usr/bin/python2 does not have the "neovim" module. :help |provider-python|
          /usr/bin/python2.7 does not have the "neovim" module. :help |provider-python|
          python2.6 not found in search path or not executable.
          /usr/bin/python is Python 3.8 and cannot provide Python 2.
  - INFO: Executable: Not found

## Python 3 provider (optional)
  - INFO: `g:python3_host_prog` is not set.  Searching for python3 in the environment.
  - INFO: Executable: /usr/bin/python3
  - INFO: Python version: 3.8.1
  - INFO: pynvim version: 0.4.1
  - OK: Latest pynvim is installed.

## Ruby provider (optional)
  - INFO: Ruby: ruby 2.7.0p0 (2019-12-25 revision 647ee6f091) [x86_64-linux]
  - WARNING: `neovim-ruby-host` not found.
    - ADVICE:
      - Run `gem install neovim` to ensure the neovim RubyGem is installed.
      - Run `gem environment` to ensure the gem bin directory is in $PATH.
      - If you are using rvm/rbenv/chruby, try "rehashing".
      - See :help |g:ruby_host_prog| for non-standard gem installations.

## Node.js provider (optional)
  - INFO: Node.js: v12.16.1
  - WARNING: Missing "neovim" npm (or yarn) package.
    - ADVICE:
      - Run in shell: npm install -g neovim
      - Run in shell (if you use yarn): yarn global add neovim

Provide a minimal init.vim/vimrc with less than 50 lines (Required!)

" Your minimal init.vim/vimrc
set runtimepath+=$HOME/.cache/dein/repos/github.com/Shougo/dein.vim

if dein#load_state('$HOME/.cache/dein')
    call dein#begin('$HOME/.cache/dein')
    call dein#add('$HOME/.cache/dein/repos/github.com/Shougo/dein.vim')

    call dein#add('Shougo/deoplete.nvim')

    " required
    call dein#end()
    call dein#save_state()
endif

let g:deoplete#enable_at_startup = 1

How to reproduce the problem from neovim/Vim startup (Required!)

  1. Start neovim
  2. update deoplete to latest version (in my case with dein => :call dein:update()
  3. Restart neovim
  4. enter inster mode
  5. Receive error message

Most helpful comment

Using pip3 to install/update msgpack resolved it for me with current HEAD / latest commit.
I checked the Arch Linux repository package, which is still on 0.6.2., and their Github, where the 1.0.0 tag is hidden because 0.6.2. is still marked as stable release.

You are right, the pacman -Qi python-msgpack gives 0.6.2. But pip can find version 1.0.0. To install 1.0.0 on Arch:

sudo pip3 install msgpack -U

If anyone happens to uninstall the msgpack first with pip uninstall msgpack which makes pip install doesn't work anymore:

โฏ pip install msgpack
Traceback (most recent call last):
  File "/usr/bin/pip", line 11, in <module>
    load_entry_point('pip==19.3', 'console_scripts', 'pip')()
  File "/usr/lib/python3.8/site-packages/pip/_internal/main.py", line 45, in main
    command = create_command(cmd_name, isolated=("--isolated" in cmd_args))
  File "/usr/lib/python3.8/site-packages/pip/_internal/commands/__init__.py", line 96, in create_command
    module = importlib.import_module(module_path)
  File "/usr/lib/python3.8/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
  File "<frozen importlib._bootstrap>", line 991, in _find_and_load
  File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 671, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 783, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/usr/lib/python3.8/site-packages/pip/_internal/commands/install.py", line 24, in <module>
    from pip._internal.cli.req_command import RequirementCommand
  File "/usr/lib/python3.8/site-packages/pip/_internal/cli/req_command.py", line 20, in <module>
    from pip._internal.network.session import PipSession
  File "/usr/lib/python3.8/site-packages/pip/_internal/network/session.py", line 18, in <module>
    from pip._vendor.cachecontrol import CacheControlAdapter
ModuleNotFoundError: No module named 'pip._vendor.cachecontrol'

You can use sudo pacman -S python-msgpack to reinstall this package, and then use pip to install the 1.0.0 version.

All 19 comments

I get the same error with vim-plug, so it's not an issue with dein.

I'm also able to confirm that it works in tagged version 5.2. So this change:

https://github.com/Shougo/deoplete.nvim/compare/5.2...master#diff-e700726088c6524226eff1c59ca1b06b

or this change:

https://github.com/Shougo/deoplete.nvim/compare/5.2...master#diff-ef1297544d28470bc7abb3da4b2c5541

is probably the culprit. For vim-plug users, I ran cd ~/.local/share/nvim/plugged/deoplete.nvim && git checkout 5.2.

Same here as another vim-plug user. I've reverted to 5.2 for the time being.

Same here with neovim -- reverted to 5.2

pip installing msgpack seems to fix it (had to use pip3)

Using pip3 to install/update msgpack resolved it for me with current HEAD / latest commit.
I checked the Arch Linux repository package, which is still on 0.6.2., and their Github, where the 1.0.0 tag is hidden because 0.6.2. is still marked as stable release.

Using pip3 to install/update msgpack resolved it for me with current HEAD / latest commit.
I checked the Arch Linux repository package, which is still on 0.6.2., and their Github, where the 1.0.0 tag is hidden because 0.6.2. is still marked as stable release.

You are right, the pacman -Qi python-msgpack gives 0.6.2. But pip can find version 1.0.0. To install 1.0.0 on Arch:

sudo pip3 install msgpack -U

If anyone happens to uninstall the msgpack first with pip uninstall msgpack which makes pip install doesn't work anymore:

โฏ pip install msgpack
Traceback (most recent call last):
  File "/usr/bin/pip", line 11, in <module>
    load_entry_point('pip==19.3', 'console_scripts', 'pip')()
  File "/usr/lib/python3.8/site-packages/pip/_internal/main.py", line 45, in main
    command = create_command(cmd_name, isolated=("--isolated" in cmd_args))
  File "/usr/lib/python3.8/site-packages/pip/_internal/commands/__init__.py", line 96, in create_command
    module = importlib.import_module(module_path)
  File "/usr/lib/python3.8/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
  File "<frozen importlib._bootstrap>", line 991, in _find_and_load
  File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 671, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 783, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/usr/lib/python3.8/site-packages/pip/_internal/commands/install.py", line 24, in <module>
    from pip._internal.cli.req_command import RequirementCommand
  File "/usr/lib/python3.8/site-packages/pip/_internal/cli/req_command.py", line 20, in <module>
    from pip._internal.network.session import PipSession
  File "/usr/lib/python3.8/site-packages/pip/_internal/network/session.py", line 18, in <module>
    from pip._vendor.cachecontrol import CacheControlAdapter
ModuleNotFoundError: No module named 'pip._vendor.cachecontrol'

You can use sudo pacman -S python-msgpack to reinstall this package, and then use pip to install the 1.0.0 version.

Upgrading msgpack to 1.0.0 screwed things even more for me (macOS 10.14, Deoplete failed to load _completely_, citing something missing... forgot to copy the :messages output, sorry), probably because of other things I have installed that depend on old msgpack...?

I had to go the git checkout 5.2 route and stick to msgpack==0.5.6. YMMV.

I have improved msgpack version check when initialize.

@dkvasnicka I don't know, but other library may be needed old msgpack.
It is not deoplete problem.

Why I need to update for latest msgpack.
https://github.com/Shougo/deoplete.nvim/issues/1071

For the record: I had the same problem and while deoplete told me I needed to install msgpack, it didn't tell me that I needed to install pynvim.

Please fix the error message so that it detects both missing dependencies.

Note: Here's the relevant pip command for others having the same issue.

pip3 install --user pynvim

@Cypher1 Sorry, it is already documented and deoplete checks Python3 support (and nvim-yarp in Vim8).

They requires pynvim package. So I don't add the check.
Why don't you read the documentation???

@Shougo I have a bunch of plugins that all upgraded at the same time. Googling the message got me here (not to the documentation). I installed the package that you explained was needed and it wasn't enough (hence my comment asking for the error message to check that pynvim is installed, not just python3 or msgpack).

It's not because I can't read the documentation, it's because I don't want configuring vim/nvim to waste people's time.

It's not because I can't read the documentation, it's because I don't want configuring vim/nvim to waste people time.

Wow.

It is OK to add the message if other people complain it.

@Shougo Would it be possible to use a separate Python virtualenv _just for this plugin_ (as opposed to Nvim as a whole) and how? That would fix the problem with other plugins depending on older version of msgpack, right?

For neovim, g:python3_host_prog variable.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

markers16123 picture markers16123  ยท  3Comments

westlywright picture westlywright  ยท  6Comments

letharion picture letharion  ยท  5Comments

marcus picture marcus  ยท  6Comments

pr4th4m picture pr4th4m  ยท  4Comments