Lorsque j'ai installé Neovim avec homebrew, j'ai été invité à exécuter la commande : CheckHealth
. Lorsque j'essaye d'exécuter la commande selon les instructions, j'obtiens un AVERTISSEMENT et une ERREUR. Certains d'entre eux concernaient le fournisseur Python 2 et le fournisseur Python 3. Je veux résoudre ce problème.
## 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
J'ai également installé pyenv et pyenv-virtualenv avec homebrew, et les paramètres du shell (tels que ʻeval "$ (pyenv init-)" `) étaient déjà faits. Cependant, aucun environnement autre que le système n'est installé. Comme indiqué dans l'erreur ci-dessus, il existe pyenv mais pas python3.
J'utilise pyenv et pyenv-virtualenv, donc s'il n'est pas installé, installez-le d'abord.
J'ai installé la dernière version de chacun comme je l'ai vérifié avec pyenv install --list
.
pyenv install 2.7.13
pyenv install 3.6.1
J'ai créé un virtualenv appelé neovim-2, l'ai activé et installé le package neovim.
pyenv virtualenv 2.7.13 neovim-2 # 2.7.Neovim avec 13-Créez une virtualenv appelée 2
pyenv shell neovim-2 #Neovim temporairement-Activer 2
pip install neovim # neovim-Installer le package neovim sur 2
J'ai aussi fait neovim-3
pyenv virtualenv 3.6.1 neovim-3
pyenv shell neovim-3
pip install neovim
Comme indiqué dans le message d'erreur, j'ai spécifié g: python_host_prog
et g: python3_host_prog
comme suit. (En supposant que PYENV_ROOT = ~ / .pyenv
est défini)
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
Quand j'ai redémarré NeoVim et essayé à nouveau : CheckHealth
, WARNING et ERROR ont disparu.
... c'était censé l'être, mais quand je l'ai réessayé, un AVERTISSEMENT est apparu: sweat_smile:. Mais ce n'est pas une ERREUR, alors je vais l'ignorer
## 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
Recommended Posts