2018/03/03

Python 3 が /usr/local/bin/python に配置されるようになった Homebrew で NeoVim の :CheckHealth をパスさせる

いつの間にか Homebrew の /usr/local/bin/python が python3 になってました。中々気合が入っている変更ですね。
私は Python そのものはあまり使わないのですが、 Neovim が使っているのでいろいろと調整したログ。

さて、この変更がある前の Neovim + Python 周りをまとめると
  • $ brew install python
    • python 2 系が入る
    • $ pip2 install neovim
    • pip2 は /usr/local/bin/pip2
  • $ brew install python3
    • python 3 系が入る
    • $ pip3 install neovim
    • pip3 は /usr/local/bin/pip3
といった感じだったのですが、変更後は
  • $ brew install python
    • python 3 系が入る
    • pip3 は /usr/local/bin/pip
  • $ brew install python@2
    • python 2 系が入る
    • が、keg-only の formula 。
    • python2 や pip2 を使うには  /usr/local/opt/python@2/ などに PATH を通す必要がある
    • 詳しくは $ brew info python@2 
という形になっているようです。
keg-only の formula を使い続けると混乱しそうなので、python@2 はアンインストール。

Python 2 系は system builtin のものを使うことにしました。
root で書き込む必要があるのでしくじった時のダメージが大きいですが……

ということで
  • $ brew uninstall python@2
  • $ sudo easy_install-2.7 neovim
して解決。

具体的な :CheckHealth の結果は
  • before
  • health#deoplete#check
    ========================================================================
    ## deoplete.nvim
    - OK: has("nvim") was successful
    - OK: exists("v:t_list") 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: $COLORTERM=''
    - INFO: $SSH_TTY=''
    health#provider#check
    ========================================================================
    ## Clipboard (optional)
    - OK: Clipboard tool found: pbcopy
    ## Python 2 provider (optional)
    - WARNING: No Python interpreter was found with the neovim module. Using the first available for diagnostics.
    - WARNING: provider/pythonx: Could not load Python 2:
    python2 not found in search path or not executable.
    /usr/bin/python2.7 does not have the "neovim" module. :help |provider-python|
    /usr/bin/python2.6 does not have the "neovim" module. :help |provider-python|
    /usr/local/bin/python is Python 3.6 and cannot provide Python 2.
    - ERROR: Python provider error
    - ADVICE:
    - provider/pythonx: Could not load Python 2:
    python2 not found in search path or not executable.
    /usr/bin/python2.7 does not have the "neovim" module. :help |provider-python|
    /usr/bin/python2.6 does not have the "neovim" module. :help |provider-python|
    /usr/local/bin/python is Python 3.6 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/local/bin/python3
    - INFO: Python3 version: 3.6.4
    - INFO: python3-neovim version: 0.2.3
    - OK: Latest python3-neovim is installed: 0.2.3
    ## Ruby provider (optional)
    - INFO: Ruby: ruby 2.5.0p0 (2017-12-25 revision 61468) [x86_64-darwin16]
    - INFO: Host: /Users/atton/.rbenv/shims/neovim-ruby-host
    - OK: Latest "neovim" gem is installed: 0.6.2
    ## Node provider (optional)
    - INFO: Node: v9.7.1
    - INFO: Host: /usr/local/bin/neovim-node-host
    - OK: Latest "neovim" npm is installed: 3.5.2
  • after
  • health#deoplete#check
    ========================================================================
    ## deoplete.nvim
    - OK: has("nvim") was successful
    - OK: exists("v:t_list") 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: $COLORTERM=''
    - INFO: $SSH_TTY=''
    health#provider#check
    ========================================================================
    ## Clipboard (optional)
    - OK: Clipboard tool found: pbcopy
    ## Python 2 provider (optional)
    - INFO: `g:python_host_prog` is not set. Searching for python2.7 in the environment.
    - INFO: Executable: /usr/bin/python2.7
    - INFO: Python2 version: 2.7.10
    - INFO: python2.7-neovim version: 0.2.3
    - OK: Latest python2.7-neovim is installed: 0.2.3
    ## Python 3 provider (optional)
    - INFO: `g:python3_host_prog` is not set. Searching for python3 in the environment.
    - INFO: Executable: /usr/local/bin/python3
    - INFO: Python3 version: 3.6.4
    - INFO: python3-neovim version: 0.2.3
    - OK: Latest python3-neovim is installed: 0.2.3
    ## Ruby provider (optional)
    - INFO: Ruby: ruby 2.5.0p0 (2017-12-25 revision 61468) [x86_64-darwin16]
    - INFO: Host: /Users/atton/.rbenv/shims/neovim-ruby-host
    - OK: Latest "neovim" gem is installed: 0.6.2
    ## Node provider (optional)
    - INFO: Node: v9.7.1
    - INFO: Host: /usr/local/bin/neovim-node-host
    - OK: Latest "neovim" npm is installed: 3.5.2

といった感じです。:CheckHealth 便利。


環境

  • macOS: 10.12.6
  • Homebrew: 1.5.7
  • Homebrew/homebrew-core (git revision b33d4d; last commit 2018-03-03)
  • NeoVim: 0.2.2
  • python2.7: 2.7.10 (macOS provided)
  • python: 3.6.4 (Homebrew provided)

0 件のコメント:

コメントを投稿