hotoolong's blog

プログラムのことやエンジニアリングに関することを記事にしています。

neovimでpython3のエラーに遭遇

概要

結果としてはpython3のバージョンを上げてしまったのでエラーがでてたので対応したというものです。

起動時のエラー内容

ERROR: Failed to run healthcheck for "denite" plugin. Exception:
  function health#check[21]..health#denite#check[3]..<SNR>211_check_required_python[7]..denite#init#_python_version_check, line 8
  Vim(python3):E319: No "python3" provider found. Run ":checkhealth provider"

上記のような内容のエラーが出ていました。

詳細確認

:checkhealthしてみたところ

## Python 3 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 3:
          /usr/local/bin/python3 does not have the "neovim" module. :help |provider-python|
          python3.9 not found in search path or not executable.
          /usr/local/bin/python3.8 does not have the "neovim" module. :help |provider-python|
          python3.7 not found in search path or not executable.
          python3.6 not found in search path or not executable.
          python3.5 not found in search path or not executable.
          python3.4 not found in search path or not executable.
          python3.3 not found in search path or not executable.
          /usr/bin/python is Python 2.7 and cannot provide Python 3.
  - INFO: Executable: Not found

というメッセージが出ていたので help provider-pythonして確認すると

To use Python plugins, you need the "pynvim" module. Run |:checkhealth| to see
if you already have it (some package managers install the module with Nvim
itself).

For Python 3 plugins:
1. Make sure Python 3.4+ is available in your $PATH.
2. Install the module (try "python" if "python3" is missing): >
   python3 -m pip install --user --upgrade pynvim

解決方法

python3 -m pip install --user --upgrade pynvim

を実行して解決しました。 めでたし。