pylint-venv provides a Pylint init-hook to automatically use the same Pylint installation with different virtual environments. Version 3.0.4 supports Python 3.7-3.13 and Pylint 3. It resolves virtual environment paths and configures the hook via pylintrc, pyproject.toml, or toml. Released as needed.
pip install pylint-venvVerified import paths — ran on the pinned version, not inferred.
Configure Pylint to automatically detect and use the virtual environment's packages.
Use `inithook(force_venv_activation=True)` instead of `inithook(True)`.
Ensure the line is under `[MAIN]` in your configuration file.
Place configuration under `[tool.pylint.MAIN]` in pyproject.toml.
Upgrade Python to 3.7+ or use pylint-venv 2.x.
Change to `inithook(force_venv_activation=True)`.
Install pylint-venv in the same environment as pylint: `pip install pylint-venv`.
Ensure the hook is on one line and does not contain quotes that break the config parser. Use: `init-hook=import pylint_venv; pylint_venv.inithook()`