# Fix VS Code Python Linting With Pylint Not Found in Path

VS Code shows no linting errors for your Python code, even though you know there are issues. The Python output panel reveals:

bash
Linter 'pylint' is not installed. Please install it or select another linter.

Or:

bash
pylint: command not found

The linter is either not installed in the active environment or VS Code cannot find it.

Step 1: Verify Pylint Is Installed

Check if pylint is installed in the current Python environment:

```bash # Check which Python VS Code is using # Look at the status bar: Python 3.11.x ('venv': venv)

# Then check that environment /path/to/venv/bin/python -m pylint --version ```

If pylint is not installed:

bash
/path/to/venv/bin/python -m pip install pylint

Always install linting tools in the project's virtual environment, not globally. This ensures VS Code finds the correct version.

Step 2: Configure Linter Path in VS Code

If pylint is installed in a non-standard location, configure the path:

json
{
    "python.linting.pylintPath": "/path/to/venv/bin/pylint"
}

Or use the module execution approach (recommended):

json
{
    "python.linting.pylintPath": "pylint"
}

When set to just "pylint", VS Code runs it as a module using the selected Python interpreter:

bash
python -m pylint

This automatically uses the pylint from the active environment.

Step 3: Enable Linting in Settings

Ensure linting is enabled:

json
{
    "python.linting.enabled": true,
    "python.linting.pylintEnabled": true,
    "python.linting.lintOnSave": true
}

If python.linting.enabled is false, no linter runs regardless of installation.

Step 4: Check for Conflicting Linters

VS Code supports multiple linters, but running more than one can cause confusion:

json
{
    "python.linting.pylintEnabled": true,
    "python.linting.flake8Enabled": false,
    "python.linting.mypyEnabled": false
}

Disable all linters except the one you want to use. Having multiple enabled can cause duplicate error messages and performance issues.

Step 5: Pylint Configuration File

Pylint may fail silently if its configuration file has errors. Check for .pylintrc or pyproject.toml in your project:

bash
pylint --generate-rcfile > .pylintrc

Test pylint manually:

bash
pylint your_file.py

If this produces errors about the configuration file, fix or remove it:

bash
rm .pylintrc

Step 6: Using Ruff as an Alternative

Pylint is slow on large codebases. Consider using Ruff, which is 10-100x faster:

bash
pip install ruff

Configure in VS Code:

json
{
    "python.linting.pylintEnabled": false,
    "[python]": {
        "editor.codeActionsOnSave": {
            "source.fixAll.ruff": "explicit",
            "source.organizeImports.ruff": "explicit"
        }
    }
}

Install the Ruff extension from the VS Code marketplace. Ruff replaces both Pylint (linting) and isort (import sorting) with a single tool.

Step 7: Linter Output for Debugging

Open the Python output panel:

bash
View > Output > Select "Python" from dropdown

This shows the exact lint command VS Code runs and its output:

bash
> pylint --msg-template='{line},{column},{category},{symbol}:{msg}' --reports=n --output-format=text src/main.py
cwd: /path/to/project

If you see pylint: command not found, the linter is not in the PATH of the selected Python interpreter.

Step 8: Workspace vs User Settings

Check that pylint is enabled in the correct settings scope. User settings apply globally, workspace settings apply to the current project:

bash
# Check workspace settings
cat .vscode/settings.json | grep lint

Workspace settings override user settings. If linting is disabled in .vscode/settings.json, it is disabled for the entire project regardless of user settings.

Step 9: Pylint Import Errors

Pylint may report import errors for valid imports:

bash
E0401: Unable to import 'mypackage' (import-error)

This happens when pylint cannot find the package in the Python path. Fix by configuring the Python path for pylint:

json
{
    "python.linting.pylintArgs": [
        "--init-hook",
        "import sys; sys.path.append('./src')"
    ]
}

Or use a .pylintrc file:

ini
[MASTER]
init-hook='import sys; sys.path.append("./src")'

This tells pylint where to find your project's modules.