OK, this is a strange one, I switch from using pipenv to asdf and poetry which is great for python and other virtual environments. Poetry and asdf are much faster and works per directory unlike condo, but one of the results is that neovim can get confused. Even though I never activate pipenv ever, with neovim, I can get into a state where it is trying to use the “old” pipenv environment and you get this strange error message:
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.
You can see what is going on by running this in neovim
:check health
I’ve seen this before and it is hard to figure out what to do, but the hint is if you see a path for python3 that looks like and it will complain that the package neovim
is not available
/home/user/workspace/venv/
This is the hint that you installed pipenv at some point and the fix is to remove that environment:
pipenv --rm
This should unshadow the pipenv environment and you are good to go.
Leave a Reply
Only people in my network can comment.