{"id":24352,"library":"pylint-venv","title":"pylint-venv","description":"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.","status":"active","version":"3.0.4","language":"python","source_language":"en","source_url":"https://github.com/jgosmann/pylint-venv/","tags":["pylint","linting","virtualenv","venv","plugin"],"install":[{"cmd":"pip install pylint-venv","lang":"bash","label":"Install from PyPI"}],"dependencies":[{"reason":"Required. pylint-venv is a plugin that modifies Pylint's behavior.","package":"pylint","optional":false}],"imports":[{"note":"inithook is the main function to install the hook.","symbol":"inithook","correct":"from pylint_venv import inithook"}],"quickstart":{"code":"# Add to your .pylintrc [MAIN] section:\n# init-hook=import pylint_venv; pylint_venv.inithook()\n\n# Or programmatically:\nfrom pylint_venv import inithook\ninithook()","lang":"python","description":"Configure Pylint to automatically detect and use the virtual environment's packages."},"warnings":[{"fix":"Use `inithook(force_venv_activation=True)` instead of `inithook(True)`.","message":"In v3.0.0, the `force_venv_activation` argument to `inithook` must be passed as a keyword argument. Positional usage breaks.","severity":"breaking","affected_versions":">=3.0.0"},{"fix":"Ensure the line is under `[MAIN]` in your configuration file.","message":"The init-hook must be placed in the `[MAIN]` section of .pylintrc, not elsewhere like `[BASIC]`. Common mistake.","severity":"gotcha","affected_versions":"all"},{"fix":"Place configuration under `[tool.pylint.MAIN]` in pyproject.toml.","message":"When using `pyproject.toml`, the hook must be configured via `[tool.pylint.MAIN]` section. People often put it under wrong tool table.","severity":"gotcha","affected_versions":">=3.0.3"},{"fix":"Upgrade Python to 3.7+ or use pylint-venv 2.x.","message":"Python 3.6 support was removed in v3.0.0. Using pylint-venv 3.x on Python 3.6 will fail.","severity":"deprecated","affected_versions":">=3.0.0"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Change to `inithook(force_venv_activation=True)`.","cause":"Using `inithook(True)` in pylint-venv 3.0+ where positional arguments are no longer allowed.","error":"ValueError: 'force_venv_activation' must be passed as a keyword argument"},{"fix":"Install pylint-venv in the same environment as pylint: `pip install pylint-venv`.","cause":"pylint-venv not installed in the environment where pylint runs, or wrong Python interpreter.","error":"ModuleNotFoundError: No module named 'pylint_venv'"},{"fix":"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()`","cause":"The init-hook string in .pylintrc is not properly escaped or has syntax errors.","error":"pylint: error: argument --init-hook: invalid value: 'import pylint_venv; pylint_venv.inithook()'"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}