The problem

I want to use Pylint in Neovim, and I want to use a standard installation that is directly managed by Neovim. Hence I have installed Mason and used Mason to install Pylint.

Now this is a problem when working with virtual environments: Pylint searches the packages in their own virtual environment (which is now managed by Mason and hidden somewhere in nvim’s storage) and does not understand my local imports.

My solution

Going basic to a solution that should work with Pylint out of the box: In the working directory, add a file called .pylintrc and add the following lines:

[MASTER]
init-hook='import sys; sys.path.append("./env/lib/python3.14/site-packages")'

Now Pylint also checks this path for dependencies and hence can correctly check my imports!