Linter pylint is not installed error in VS Code [Solved]

avatar
Borislav Hadzhiev

Last updated: Apr 6, 2024
4 min

banner

# Linter pylint is not installed error in VS Code [Solved]

The VS Code error "pylint is not installed" occurs when the Python extension cannot find the pylint module on your machine.

To solve the error, click on the Install button to install pylint.

vscode linter pylint is not installed

If you don't see an Install button, open your terminal and run the following command.

shell
pip install pylint --upgrade

install pylint windows

If you get a permissions error when running the installation command, you have to start CMD as an administrator and rerun the command.

To open CMD as an administrator:

  1. Click on the Search bar and type CMD.

  2. Right-click on the Command Prompt application and click "Run as administrator".

run cmd as administrator

Alternatively, you can try to install the module with the --user flag.

shell
pip install pylint --upgrade --user

If you are on macOS or Linux, try running the command with pip3 as well.

shell
pip3 install pylint --upgrade

install pylint macos linux

If you get a permissions error when running the command on macOS or Linux, prefix it with sudo.

shell
sudo pip3 install pylint --upgrade

Alternatively, you can try to install the module with the --user flag.

shell
pip3 install pylint --upgrade --user

If you are on macOS or Linux, you might also have to install pylint using a specific pip version.

You can get your Python version by issuing the following command.

shell
python --version

get python version

For example, my Python version is 3.11.2, so I would install pylint as follows:

shell
pip3.11 install pylint --upgrade

install pylint using specific pip version

Note: this only applies to macOS or Linux in case you have multiple Python versions.

In most cases, the error should be resolved after you install pylint.

# Explicitly specifying the path to the Pylint module

If the error persists, you have to explicitly set the path to the pylint module.

First, make sure you have the Pylint linter selected.

  1. Press:
  • Ctrl + Shift + P on Windows and Linux.
  • Command + Shift + P on macOS.
Note: you can also press F1 to open the Command Palette.
  1. Type python linter and click on Python: Select Linter.

python select linter

  1. Select Pylint from the list of options.

select pylint

If you still get the error, issue the following command to get the path to the pylint module.

# Setting the Pylint Path on Windows

On Windows:

  1. Issue the where pylint command.
shell
where pylint

find where pylint installed windows

  1. Copy the complete path to the module.

  2. Press:

  • Ctrl + Shift + P on Windows and Linux.
  • Command + Shift + P on macOS.
Note: you can also press F1 to open the Command Palette.
  1. Type Pylint path, scroll down to the Python Linting: Pylint path setting and paste the path.

set pylint path correctly

# Setting the Pylint Path on macOS or Linux

On macOS or Linux:

  1. Issue the which pylint command.
shell
which pylint

issue which pylint command

  1. Copy the complete path to the module.

  2. Press:

  • Ctrl + Shift + P on Windows and Linux.
  • Command + Shift + P on macOS.
Note: you can also press F1 to open the Command Palette.
  1. Type Pylint path, scroll down to the Python Linting: Pylint path setting and paste the path.

set pylint path on macos and linux

# Try to run the Pylint linter

After you've set up the path correctly, try to run the Pylint linter.

  1. Open a Python file in VS Code.
  2. Press:
  • Ctrl + Shift + P on Windows and Linux.
  • Command + Shift + P on macOS.
Note: you can also press F1 to open the Command Palette.
  1. Type Run linting and select Python: Run Linting.

python run linting

# Disable Python linting

If the error persists and you'd rather disable Python linting:

  1. Open a Python file in VS Code.

  2. Press:

  • Ctrl + Shift + P on Windows and Linux.
  • Command + Shift + P on macOS.
Note: you can also press F1 to open the Command Palette.
  1. Type python linting and click on Python: Enable/Disable Linting.

disable python linting

  1. Then select Disable.

select disable

If you'd rather find another way to resolve the issue, make sure you have selected the correct Python interpreter by following the step-by-step instructions in my change python version & select correct Interpreter in VS Code article.

I've also written an article on how to add a run button in VS Code.

# Additional Resources

You can learn more about the related topics by checking out the following tutorials:

I wrote a book in which I share everything I know about how to become a better, more efficient programmer.
book cover
You can use the search field on my Home Page to filter through all of my articles.