"Failed to load python3 host" on NeoVim
ns-cweber opened this issue ยท 9 comments
When I open a .fs file in NeoVim, I get:
function provider#python3#Call[9]..remote#host#Require[10]..provider#pythonx#Require, line 15
Vim(if):E475: Invalid argument: Channel id must be a positive integer
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.
Setting NVIM_PYTHON_LOG_FILE does nothing (the log file doesn't get created). Not sure if this is an issue on vim-fsharp or NeoVim's side, but all of my other plugins seem to work.
nvim version 0.2.0
vim-fsharp commit: e4294fd
os: Mac OS 10.11.6
Run :CheckHealth from within neovim.
That will help to determine where the problem might lie (but it looks more like a neovim config issue).
I personally use pyenv with virtualenv to set up a specific python2 and python3 environment that neovim uses.
Right you are. Thanks for the tip; I didn't know about :CheckHealth.
I was able to fix the same issue by running cp /usr/bin/python2.7 /usr/local/bin/ and cp /usr/bin/python3.6 /usr/local/bin/.
A package would be missing within the virtual environment which identifies the executable.
Check for error with into nvim
:CheckHealth the variable python3_host_prog within setting.nvim does not read the executable without the pynvim package. install it inside the virtual environment with
pip install pynvim
this would be enough for nvim to detect the python interpreter without errors for python3 versions
Hola! 'antobio23' que sencilla la soluciรณn que me habeis dado. Muy agradecido. Atte. Alex
This worked for me python3 -m pip install --user --upgrade pynvim
In my case I had to run :CheckHealth
then I saw the pip package neovim pip was missing.
But it was using a different python path than if i just did pip install neovim
so i copied the path that neovim was using to the python interpreter and did the pip install...
/usr/bin/python3 -m pip install neovim
i use scoop to install neovim and python.
:checkhealth and found error: neovim no module named greenlet._greenlet
someone manully download greenlet from https://www.lfd.uci.edu/~gohlke/pythonlibs/#greenlet and I failed to install
I success with these
python -m pip uninstall greenlet
python -m pip install --user --upgrade pynvim
I failed to load python host during :UpdateRemotePlugins with the same error message.
checkhealth suggests I have python 3 and pynvim recognized but not python 2.
I solved this issue by specifying in the init.vim,
let g:python_host_prog='/home/tongyao/.pyenv/shims/python3' instead of suggested specifying python3_host_prog