When I installed Neovim with homebrew, I was prompted to run the : CheckHealth
command. When I try to run the command according to the instructions, I get some WARNING and ERROR. Some of them were about Python 2 provider and Python 3 provider. I want to fix this.
## Python 2 provider
- WARNING: No Python interpreter was found with the neovim module. Using the first available for diagnostics.
- WARNING: provider/pythonx: Could not load Python 2:
/usr/local/bin/python2 does not have the neovim module installed. See provider-python.
/usr/local/bin/python2.7 does not have the neovim module installed. See provider-python.
/usr/bin/python2.6 does not have the neovim module installed. See provider-python.
/usr/local/bin/python does not have the neovim module installed. See provider-python.
- INFO: `g:python_host_prog` is not set. Searching for python2 in the environment.
- SUCCESS: pyenv found: "/usr/local/Cellar/pyenv/1.0.10_1/libexec/pyenv"
- ERROR: Command error (1) "/usr/local/Cellar/pyenv/1.0.10_1/libexec/pyenv" which python2 2>/dev/null:
- WARNING: pyenv couldn't find python2.
- WARNING: pyenv is not set up optimally.
- SUGGESTIONS:
- Suggestion: Create a virtualenv specifically for Neovim using pyenv and use "g:python_host_prog". This will avoid the need to install Neovim's Pytho
n client in each version/virtualenv.
- INFO: Executable: /usr/local/bin/python2
- ERROR: Command error (4) /usr/local/bin/python2 -c import neovim; print(neovim.__file__): Traceback (most recent call last): File "<string>", line 1, in
<module>ImportError: No module named neovim
- INFO: Python2 version: 2.7.13
- INFO: python2-neovim version: unable to find nvim executable
- ERROR: Neovim Python client is not installed.
- SUGGESTIONS:
- Error found was: unable to find nvim executable
- Use the command `$ pip2 install neovim`
- WARNING: Latest python2-neovim is NOT installed: 0.1.13
## Python 3 provider
- WARNING: No Python interpreter was found with the neovim module. Using the first available for diagnostics.
- WARNING: provider/pythonx: Could not load Python 3:
/usr/local/bin/python3 does not have the neovim module installed. See provider-python.
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/local/bin/python is Python 2.7 and cannot provide Python 3.
- INFO: `g:python3_host_prog` is not set. Searching for python3 in the environment.
- SUCCESS: pyenv found: "/usr/local/Cellar/pyenv/1.0.10_1/libexec/pyenv"
- ERROR: Command error (5) "/usr/local/Cellar/pyenv/1.0.10_1/libexec/pyenv" which python3 2>/dev/null:
- WARNING: pyenv couldn't find python3.
- WARNING: pyenv is not set up optimally.
- SUGGESTIONS:
- Suggestion: Create a virtualenv specifically for Neovim using pyenv and use "g:python3_host_prog". This will avoid the need to install Neovim's Pyth
on client in each version/virtualenv.
- INFO: Executable: /usr/local/bin/python3
- ERROR: Command error (8) /usr/local/bin/python3 -c import neovim; print(neovim.__file__): Traceback (most recent call last): File "<string>", line 1, in
<module>ModuleNotFoundError: No module named 'neovim'
- INFO: Python3 version: 3.6.1
- INFO: python3-neovim version: unable to find nvim executable
- ERROR: Neovim Python client is not installed.
- SUGGESTIONS:
- Error found was: unable to find nvim executable
- Use the command `$ pip3 install neovim`
- WARNING: Latest python3-neovim is NOT installed: 0.1.13
I also installed pyenv and pyenv-virtualenv with homebrew, and the shell settings (such as ʻeval "$ (pyenv init-)" `) were already done. However, no environment other than system is installed. As pointed out in the above error that there is pyenv but python3 is missing.
I'm using pyenv and pyenv-virtualenv, so if it's not installed, install it first.
I installed the latest version of each as I checked with pyenv install --list
.
pyenv install 2.7.13
pyenv install 3.6.1
I created a virtualenv called neovim-2, activated it, and installed the neovim package.
pyenv virtualenv 2.7.13 neovim-2 # 2.7.Neovim with 13-Create a virtualenv called 2
pyenv shell neovim-2 #Temporarily neovim-Enable 2
pip install neovim # neovim-Install neovim package on 2
I also made neovim-3
pyenv virtualenv 3.6.1 neovim-3
pyenv shell neovim-3
pip install neovim
As shown in the error message, I specified g: python_host_prog
and g: python3_host_prog
as follows. (Assuming that PYENV_ROOT = ~ / .pyenv
is set)
init.vim
let g:python_host_prog=$PYENV_ROOT.'/versions/neovim-2/bin/python'
let g:python3_host_prog=$PYENV_ROOT.'/versions/neovim-3/bin/python'
: CheckHealth
I restarted NeoVim and tried : CheckHealth
again, and WARNING and ERROR disappeared.
... it was supposed to be, but when I tried it again, WARNING appeared: sweat_smile :. But it's not ERROR, so I'll ignore it
## Python 2 provider
- INFO: Using: g:python_host_prog = "/Users/yuku/.pyenv/versions/neovim-2/bin/python"
- WARNING: Your virtualenv is not set up optimally.
- SUGGESTIONS:
- Suggestion: Create a virtualenv specifically for Neovim and use "g:python_host_prog". This will avoid the need to install Neovim's Python client in each virtualenv.
- INFO: Executable: /Users/yuku/.pyenv/versions/neovim-2/bin/python
- INFO: Python2 version: 2.7.13
- INFO: python-neovim version: 0.1.13
- SUCCESS: Latest python-neovim is installed: 0.1.13
## Python 3 provider
- INFO: Using: g:python3_host_prog = "/Users/yuku/.pyenv/versions/neovim-3/bin/python"
- WARNING: Your virtualenv is not set up optimally.
- SUGGESTIONS:
- Suggestion: Create a virtualenv specifically for Neovim and use "g:python3_host_prog". This will avoid the need to install Neovim's Python client in each virtualenv.
- INFO: Executable: /Users/yuku/.pyenv/versions/neovim-3/bin/python
- INFO: Python3 version: 3.6.1
- INFO: python-neovim version: 0.1.13
- SUCCESS: Latest python-neovim is installed: 0.1.13