hotoolong's blog

RailsやVim、業務で気になったことを綴ってます

brew install で Warning: python is outdated になり、nvimでWarningが発生する

Macgawkのインストールを行いたくなり

brew install gawk

したときに

==> Deleted Formulae
python3 ✔                llvm@3.8                 mal4s                    mimetic                  nazghul                  picolisp                 ufoai                    voltdb
==> Processing python3 formula rename to python
==> Unlinking python3
==> Temporarily unlinking python
==> Moving python3 versions to /usr/local/Cellar/python
==> Relinking python
Warning: python is outdated!
To avoid broken installations, as soon as possible please run:
  brew upgrade
Or, if you're OK with a less reliable fix:
  brew upgrade python

python3が削除されてしまって python になってるんですかね。

vi hogehoge.txt

vimで編集すると

function remote#define#FunctionBootstrap[1]..remote#host#Require[10]..provider#pythonx#Require, line 15
Vim(if):E475: 無効な引数です: Channel id must be a positive integer
[deoplete] deoplete failed to load: Failed to load python3 host. You can try to see what happened by starting nvim with $NVIM_PYTHON_LOG_FILE set and opening the generated log file. Also, the host stderr
is available in messages.. Try the :UpdateRemotePlugins command and restart Neovim. See also :CheckHealth.
続けるにはENTERを押すかコマンドを入力してください

となってしまって

何故かパスが外れたと勘違いしてしまい

brew install python3
Updating Homebrew...
==> Auto-updated Homebrew!
Updated 2 taps (homebrew/core, caskroom/cask). 
==> Updated Formulae
pipenv

Error: python 2.7.14_3 is already installed
To upgrade to 3.6.4_4, run `brew upgrade python`

python3入れ直すとエラーになり、pythonでいれてねということなので

brew upgrade python

して

再度vimを起動

vi hogehoge.txt

エラーはでてなくなった。念のため

:CheckHealth

しておくと

Running healthchecks...

  health#deoplete#check
  ========================================================================
  ## deoplete.nvim
    - OK: has("nvim") was successful
    - OK: has("python3") was successful
    - 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
    - OK: Up to date

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

  ## tmux
    - OK: escape-time: 0ms
    - INFO: $TERM: screen-256color


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

  ## Python 2 provider (optional)
    - INFO: Using: g:python_host_prog = "/usr/local/bin/python"
    - INFO: Executable: /usr/bin/python
    - ERROR: Command error (job=9): '/usr/bin/python' '-c' 'import neovim; print(neovim.file)'
      Output: Traceback (most recent call last):  File "<string>", line 1, in <module>ImportError: No module named neovim
    - INFO: Python2 version: 2.7.10
    - INFO: python-neovim version: unable to load neovim Python module
    - ERROR: Neovim Python client is not installed.
      Error: unable to load neovim Python module
      - ADVICE:
        - Run in shell: pip2 install neovim

  ## Python 3 provider (optional)
    - INFO: Using: g:python3_host_prog = "/usr/local/bin/python3"
    - INFO: Executable: /usr/local/bin/python3
    - INFO: Python3 version: 3.6.4
    - INFO: python3-neovim version: 0.1.13 (outdated; from /usr/local/lib/python3.6/site-packages/neovim)
    - WARNING: Latest python3-neovim is NOT installed: 0.2.4

  ## Ruby provider (optional)
    - INFO: Ruby: ruby 2.4.3p205 (2017-12-14 revision 61247) [x86_64-darwin17]
    - INFO: Host: /Users/hotoolong/.rbenv/shims/neovim-ruby-host
    - OK: Latest "neovim" gem is installed: 0.7.0

  ## Node provider (optional)
    - INFO: Node: v8.9.4
    - INFO: Host: /Users/hotoolong/.nvm/versions/node/v8.9.4/bin/neovim-node-host
    - OK: Latest "neovim" npm is installed: 3.5.2

エラーは出なくなった。brew install 時にはメッセージちゃんと見ておかないと嵌りそう。