rafi/vim-venom

Requires python3 host modules installed in virtual environment

cprn opened this issue · 2 comments

cprn commented

I'm not sure I understand correctly what this plugin is supposed to do but I'm having trouble using NeoVim with modified $PATH. How is this supposed to work exactly?

I have python3 provider (neovim python module) and e.g. pylint installed globally. When I install this plugin and open NeoVim it automatically activates detected virtual environment but stops detecting both neovim and pylint modules so many NeoVim plugins stop working. The only way to make it work is to install these modules inside the virtual environment which beats the purpose of isolation in the first place.

I'd imagine this plugin exists exactly to solve this issue i.e. to let NeoVim keep the host's $PATH and only overwrite it for shells spawned by :! and :terminal. This way one could run NeoVim and use it as it was in global context, with all the dependencies, plugins and python modules loaded from the host, while running all the shell commands in the virtual environment.

rafi commented

Are you setting the g:python3_host_prog variable in your Neovim init?

This is how I manage the pynvim/neovim python module, as a separate venv, and I always set g:python3_host_prog to that venv path (See here). For Vim8, you can use set pythonthreehome=. Let me know if that helps.

cprn commented

Curious. It works when I have neovim module installed in a separate virtual environment and g:python3_host_prog points to python in that environment... but doesn't when it points to my system /usr/bin/python3 even though I have neovim module installed globally. Will investigate. Thank you, closing this for now.