pynvim-python-interpreter is a thin wrapper designed to expose the Python
interpreter associated with Neovim's pynvim library. When placed on the
executable PATH, pynvim-python-interpreter chains to the Python interpreter
associated with pynvim, essentially providing a renamed Python interpreter
that won't collide with other Python interpreters on PATH.
NOTE: Ideally, pynvim and Neovim would adopt this idea to make a
zero-configuration solution. For that reason, this project leaves the shorter
name pynvim-python available in case the Neovim project would like to
implement this idea in some form.
Typical installation uses uv1 or pipx2 to install
pynvim-python-interpreter on the PATH, e.g.:
-
For
uv:uv tool install pynvim-python-interpreter
-
For
pipx:pipx install pynvim-python-interpreter
After installing pynvim-python-interpreter, configure Neovim to use it by
setting the global variable python3_host_prog to be the string
pynvim-python-interpreter:
-
Via Vimscript in
init.vim:let g:python3_host_prog = 'pynvim-python-interpreter'
-
Via Lua in
init.lua:vim.g.python3_host_prog = 'pynvim-python-interpreter'