Last updated: Apr 6, 2024
Reading time·4 min
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.
If you don't see an Install button, open your terminal and run the following command.
pip install pylint --upgrade
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:
Click on the Search bar and type CMD.
Right-click on the Command Prompt application and click "Run as administrator".
Alternatively, you can try to install the module with the --user
flag.
pip install pylint --upgrade --user
If you are on macOS or Linux, try running the command with pip3
as well.
pip3 install pylint --upgrade
If you get a permissions error when running the command on macOS or Linux,
prefix it with sudo
.
sudo pip3 install pylint --upgrade
Alternatively, you can try to install the module with the --user
flag.
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.
python --version
For example, my Python version is 3.11.2
, so I would install pylint
as
follows:
pip3.11 install pylint --upgrade
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
.
If the error persists, you have to explicitly set the path to the pylint
module.
First, make sure you have the Pylint linter selected.
Ctrl
+ Shift
+ P
on Windows and Linux.Command
+ Shift
+ P
on macOS.F1
to open the Command Palette.If you still get the error, issue the following command to get the path to the
pylint
module.
On Windows:
where pylint
command.where pylint
Copy the complete path to the module.
Press:
Ctrl
+ Shift
+ P
on Windows and Linux.Command
+ Shift
+ P
on macOS.F1
to open the Command Palette.On macOS or Linux:
which pylint
command.which pylint
Copy the complete path to the module.
Press:
Ctrl
+ Shift
+ P
on Windows and Linux.Command
+ Shift
+ P
on macOS.F1
to open the Command Palette.After you've set up the path correctly, try to run the Pylint linter.
Ctrl
+ Shift
+ P
on Windows and Linux.Command
+ Shift
+ P
on macOS.F1
to open the Command Palette.If the error persists and you'd rather disable Python linting:
Open a Python file in VS Code.
Press:
Ctrl
+ Shift
+ P
on Windows and Linux.Command
+ Shift
+ P
on macOS.F1
to open the Command Palette.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.
You can learn more about the related topics by checking out the following tutorials: