0

Each and every time I start VS Code a small window with a red cross pops up saying "Linter pylint is not installed" with three options to Install, Select Linter or Do not show again. However, when I click on Install it opens integrated terminal at /usr/bin/python and tells me that "Requirement already satisfied, skipping upgrade". When I click on Select linter I can select pylint at the end of the list. which pylint returns "pylint not found". This drives me nuts. It started misbehaving this way just recently, but I'm not sure what caused it. I have already tried all answers in this thread Linter pylint is not installed and this thread Getting error message "Linter pylint is not installed" but nothing changes. pip3 install pylint returns "Requirement already satisfied". I need some help.

These are my settings for linting:

  "python.pythonPath": "/usr/bin/python",
  "python.linting.enabled": true,
  "python.linting.pylintEnabled": true,
  "python.linting.pylintPath": "python -m pylint",
  "python.linting.pylintArgs": [
    "--extension-pkg-whitelist=pygame",
    "--errors-only"
  ],```
Bridge
  • 191
  • 9

2 Answers2

0

At the bottom left of the VS Code window it tells you which python environment the editor is currently using to evaluate/run your code. (This will only appear once you've opened a Python file in the editor.) You can click on it to change.

You need to make sure pylint is pip installed in the same environment you have selected. This may be the problem!

EDIT: In my settings.json, I don't have "python.pythonPath": "/usr/bin/python". Maybe this is causing problems, if it differs from the Python environment you have selected?

Dustin Michels
  • 2,951
  • 2
  • 19
  • 31
  • Thank you for the answer. Unfortunately, it does not solve the issue since I tried to pip install pylint in the same env and it says "Requirement already satisfied" – Bridge Jan 08 '21 at 13:29
  • 1
    Edited with one more suggestion! – Dustin Michels Jan 12 '21 at 08:33
  • The thing is this is the environment that I am working in (/usr/bin/python). I tried deleting that line in settings but nothing changed, "pylint is not installed" pops up as usual. – Bridge Jan 12 '21 at 10:15
  • 1
    Oh man!! Tragic. You could try uninstalling/reinstalling with `pip uninstall pylint`, and removing/re-adding the Python extensions for VS Code. – Dustin Michels Jan 12 '21 at 12:45
  • Also check that pip is synced up with python. Eg, `which pip` and `which python` (on mac/linux) to make sure they're in the same place. – Dustin Michels Jan 12 '21 at 12:46
  • Thanks for the suggestions. I will try uninstalling it. ```which pip``` returns ```/usr/bin/pip``` and ```which python``` returns ```/usr/bin/python/```. I'm on Linux (perhaps I should have mentioned that in my question too). – Bridge Jan 12 '21 at 15:34
  • So when I remove pylint by ```pip uninstall pylint``` it asks me: ```Would remove: /home/brij/.local/bin/epylint etc, Proceed (y/n)?``` Then I installed it again and it warns me: ```WARNING: The scripts epylint, pylint, etc are installed in '/home/brij/.local/bin' which is not on PATH. Consider adding this directory to PATH...``` – Bridge Jan 12 '21 at 16:21
  • Let us [continue this discussion in chat](https://chat.stackoverflow.com/rooms/227232/discussion-between-dustin-michels-and-brij). – Dustin Michels Jan 12 '21 at 22:16
0

Please check whether the installed module "Pylint" is successfully installed in the currently selected Python environment:

  1. Please use the command "python --version" to check which Python environment the VSCode terminal is currently in:

    enter image description here

    If the result is inconsistent with the one displayed in the lower left corner of VSCode, please use the shortcut key Ctrl+Shift+` to open a new VSCode terminal, and it will automatically enter the selected terminal.

2.We can use "pip show pylint" to check where 'Pylint' is installed:

enter image description here

Jill Cheng
  • 9,179
  • 1
  • 20
  • 25
  • Thank you for the answer. I followed all your points and my Python version is consistent with the one displayed in the lower left corner (3.9.1) and `pylint` is installed in /home//.local/lib/python3.9/site-packages – Bridge Jan 11 '21 at 18:22
  • @brij -How are things going? Now when you open VSCode, will you still receive "Linter pylint is not installed"? – Jill Cheng Jan 12 '21 at 01:16
  • Unfortunately, yes I still receive the same message and have to manually select pylint as my linter every time I start VSCode. – Bridge Jan 12 '21 at 10:11