Error message "Linter pylint is not installed"

184,342

Solution 1

  1. Open a terminal (ctrl+~)
  2. Run the command pip install pylint

If that doesn't work: On the off chance you've configured a non-default Python path for your editor, you'll need to match that Python's install location with the pip executable you're calling from the terminal.

This is an issue because the Python extension's settings enable Pylint by default. If you'd rather turn off linting, you can instead change this setting from true to false in your user or workspace settings:

"python.linting.pylintEnabled": false

Solution 2

Check the path Pylint has been installed to, by typing which pylint on your terminal.

You will get something like: /usr/local/bin/pylint

Copy it.

Go to your Visual Studio Code settings in the preferences tab and find the line that goes

"python.linting.pylintPath": "pylint"

Edit the line to be

"python.linting.pylintPath": "/usr/local/bin/pylint",

replacing the value "pylint" with the path you got from typing which pylint.

Save your changes and reload Visual Studio Code.

Solution 3

If you're working in a virtual environment (virtualenv), you'll definitely need to update the python.lintint.pylintPath setting (and probably the python.pythonPath setting, as well, if you haven't already) if you want linting to work, like this:

// File "settings.json" (workspace-specific one is probably best)
{
    // ...
    "python.linting.pylintPath": "C:/myproject/venv/Scripts/pylint.exe",
    "python.pythonPath": "C:/myproject/venv/Scripts/python.exe",
    // ...
}

That's for Windows, but other OSs are similar. The .exe extension was necessary for it to work for me on Windows, even though it's not required when actually running it in the console.

If you just want to disable it, then use the python.linting.pylintEnabled": false setting as mentioned in Ben Delaney's answer.

Solution 4

This solved the issue for me:

pip install pylint -U

I.e., upgrade the pylint package.

Solution 5

Try doing this if you're running Visual Studio Code on a Windows machine and getting this error (I'm using Windows 10).

Go to the settings and change the Python path to the location of YOUR python installation.

I.e.,

Change: "python.pythonPath": "python"

To: "python.pythonPath": "C:\\Python36\\python.exe"

And then: Save and reload Visual Studio Code.

Now when you get the prompt telling you that "Linter pylint is not installed", just select the option to 'install pylint'.

Since you've now provided the correct path to your Python installation, the Pylint installation will be successfully completed in the Windows PowerShell Terminal.

Share:
184,342
Naveed Aheer
Author by

Naveed Aheer

Angular, React, Node JS, JavaScript

Updated on January 23, 2021

Comments

  • Naveed Aheer
    Naveed Aheer over 3 years

    I want to run Python code in Microsoft Visual Studio Code but it gives an error:

    Linter pylint is not installed

    I installed:

    • The Visual Studio Code Python extension
    • Python 3
    • Anaconda

    How can I install Pylint?

  • Naveed Aheer
    Naveed Aheer about 7 years
    pip install pylint command gives this error 'pip' is not recognized as an internal or external command, operable program or batch file
  • Ben Delaney
    Ben Delaney about 7 years
    This is likely because pip isn't on your path, so you can't run it directly from the terminal. If python is on your path, you should be able to run python -m pip install pylint.
  • Ben Delaney
    Ben Delaney about 7 years
    If Python isn't on your path, you may want to add it, so you can run Python from the command line in the future. Instructions for adding an executable to your path vary by platform, but should be easy to find. Alternatively, you could just turn off linting, for now :-)
  • Naveed Aheer
    Naveed Aheer about 7 years
    Thanks for your suggestions
  • Naveed Aheer
    Naveed Aheer about 7 years
    Thank You @Ben for solution
  • DrStrangepork
    DrStrangepork over 6 years
    My problem was that the message Module pylinter not installed would pop up constantly, but pylinter was installed in both Python2 and Python3. Upgrading pylint from within the terminal (ctrl+~) resolved my issue.
  • srking
    srking over 6 years
    This solution worked for me where others didn't. Some systems like Fedora Linux and Python 3.x support need pip3 install pylint -U
  • Sirius
    Sirius almost 6 years
    pylint.exe is needed in pylint installation folder. But the .exe is not in the settings.json. I.e.: "python.linting.pylintPath": "C:/myproject/venv/Scripts/pylint"
  • user2867432
    user2867432 over 5 years
    This would be a good approach if the installation happened already. In this case it seems that since pylint isn't there it's not the best approach.
  • vintprox
    vintprox over 5 years
    Yep, also if somebody's wondering why it still complains after pipenv install pylint, just reload your workspace in VSCode.
  • Steven C. Howell
    Steven C. Howell over 5 years
    @user2867432 The OP states that Anaconda Python is installed, which comes with pylint already installed. The problem is that Anaconda Python is not automatically added to the path. For those who do not have access/desire to change their path, this is absolutely the best approach.
  • Steven C. Howell
    Steven C. Howell over 5 years
    See @RutoCollins solution for how to configure VS Code to use the pylint already installed (which is installed if, like the OP states, you installed Anaconda Python). If you do not have desire/access to change you PATH variable, that is the best option.
  • Antonvh
    Antonvh over 5 years
    VScode does weird stuff here. If I open a terminal inside my vscode project, inside the pipenv I'm using, i can type flake8 or pylint or which pylint no problem. Still VSCode seems to require an explicit path. :/
  • Steven C. Howell
    Steven C. Howell almost 5 years
    The following worked for my Anaconda install on windows C:\Users\username\AppData\Local\Continuum\Anaconda3\Scripts\‌​pylint.exe. Not too surprising, it did not work with forward slashes.
  • Kay
    Kay over 4 years
    Fow windows users, which is linux command and you must use where. Although for me where pylint did not help. Hence I just performed pip3 install pylint, which told me the path by: Requirement already satisfied: pylint in c:\users\keshavb\appdata\roaming\python\python37\site-packag‌​es (2.4.2)
  • Kay
    Kay over 4 years
    Easier way, just can change the pyLintPath to C:\Users\_your_username_AppData\Roaming\Python\Python37\Scri‌​pts\pylint.exe
  • Vince
    Vince over 3 years
    The terminal (Ctrl-` not Ctrl-~) uses the same Python environment as the actual shell and pylint is installed. VSCode is using something different and I'm not sure why.
  • Vince
    Vince over 3 years
    This works, but I'd love to know why VSCode isn't using the same python, pip, and pylint that are in the PATH of the shell I started it from.
  • Vince
    Vince over 3 years
    -U will upgrade an installed pylint, but this doesn't help if VSCode isn't finding pylint even though it's installed.
  • Vince
    Vince over 3 years
    It may be effective, but it's a hack. The problem is that VSCode doesn't find pylint even if it's installed and in the PATH. I'd rather fix VSCode than work around the problem like this.
  • Peter Mortensen
    Peter Mortensen over 3 years
    But the question was about Visual Studio Code, not Visual Studio.
  • Aeroradish
    Aeroradish over 3 years
    @PeterMortensen The comment was "If you also have Visual Studio installed", meaning "in addition to Code". At the time, Windows would reset VS Code's version of Python to whatever Visual Studio's was. In other words, Visual Studio's setting would override VS Code's. I don't know if that's still true now, three years later, but it was then.