Neovim Python client (pynvim)
raw JSON → 0.3.1 verified Fri May 01 auth: no python deprecated
The Python client for Neovim, providing a programming interface to control Neovim from Python. This package ('neovim') is a transitional package for 'pynvim' (version 0.3.1) and is deprecated; users should use the 'pynvim' package (current version 0.6.0) instead. The project has an active maintenance and release cadence of roughly once a year.
pip install pynvim Common errors
error ImportError: No module named neovim ↓
cause The 'neovim' package is transitional and may not be installed if you installed 'pynvim' instead. Or vice versa.
fix
Install pynvim: pip install pynvim
error AttributeError: module 'pynvim' has no attribute 'attach' ↓
cause Installed an old version of pynvim (pre-0.4.0) or possibly installed the wrong package.
fix
Ensure you have pynvim >= 0.4.0: pip install --upgrade pynvim
Warnings
breaking 'neovim' package on PyPI is deprecated/transitional. The actual library has been renamed to 'pynvim' since version 0.3.1. Continue using 'import neovim' works as an alias but may break in future. ↓
fix Uninstall both 'neovim' and 'pynvim', then install 'pynvim': pip uninstall neovim pynvim && pip install pynvim
gotcha Python 3.6 support dropped in pynvim 0.5.0. Minimum Python 3.7 required. ↓
fix Upgrade to Python 3.7+ or use pynvim < 0.5.0
gotcha 'pip install --upgrade neovim' may fail due to pip conflicts. Safest upgrade path: uninstall both 'neovim' and 'pynvim', then reinstall 'pynvim'. ↓
fix pip uninstall neovim pynvim && pip install pynvim
Install
pip install neovim Imports
- pynvim wrong
import neovimcorrectfrom pynvim import attach - Nvim
from pynvim import Nvim
Quickstart
import pynvim
nvim = pynvim.attach('socket', path='/tmp/nvim.sock')
print(nvim.eval('$VIMRUNTIME'))