简体   繁体   中英

“Linter pylint is not installed” every time I start VS Code

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"
  ],```

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?

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:

    在此处输入图像描述

    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:

在此处输入图像描述

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM