fsharp / zarchive-vim-fsharp

F# bindings for vim
MIT License
143 stars 34 forks source link

"Failed to load python3 host" on NeoVim #96

Closed ns-cweber closed 7 years ago

ns-cweber commented 7 years ago

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: e4294fd3b723e1626da282dc6297098128252c46 os: Mac OS 10.11.6

Banashek commented 7 years ago

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.

ns-cweber commented 7 years ago

Right you are. Thanks for the tip; I didn't know about :CheckHealth.

IvanCherepov commented 7 years ago

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/.

anthobio23 commented 2 years ago

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

N-TWD commented 2 years ago

Hola! 'antobio23' que sencilla la solución que me habeis dado. Muy agradecido. Atte. Alex

sathishmanohar commented 2 years ago

This worked for me python3 -m pip install --user --upgrade pynvim

CKristensen commented 1 year ago

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

scil commented 1 year ago

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
tongyaopu commented 1 year ago

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