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:
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.
I had this issue this weekend. It seems to have happened because I opened my project in my venv, but I also opened a second instance outside of the venv. I never closed either instance - I just shut my PC down and let Windows do the work. When I went back and called up Visual Studio Code from within my venv, both the project, and the other non-venv window opened. That's when I started seeing this error.
To fix it, I had to remove the \.vscode folder from the workspace directory.
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.
I also had this problem. If you also have Visual Studio installed with the Python extension, the system will want to use Studio's version of Python. Set the Environment Path to the version in Studio's Shared folder. For me, that was:
##########Linting Output - pylint##########
c:\WS\myproject> C:\Python34\python.exe _tools\python3\Scripts\pylint
--rcfile c:\WS\framework\pylintrc
--msg-template='{line},{column},{category},{msg_id}:{msg}'
--reports=n
--output-format=text
c:\WS\myproject\myScriptToLint.py
Using config file c:\WS\myproject\pylintrc
------------------------------------
Your code has been rated at 10.00/10
✓ Visual Studio Code uses the Pylint version from my toolchain!
If your Python 3 is installed in the /usr/bin/python3.6 folder, run the following command, and it should work fine. Last, make sure your Visual Studio Code is running the Python 3 interpreter, not Python 2.7 which is default in Ubuntu.
If you're reading this in (or after) 2020 and are still having issues with Pylint in Visual Studio Code for Windows 10, here is a quick solution that worked for me:
Make sure Python is installed for Windows, and note the installation path.
From an elevated command prompt, go to the installation directory for Python:
cd C:\Users\[username]\Programs\Python\Python[version]\
Install Pylint:
python -m pip install pylint
Pylint is now installed in the 'Python\Python[version]\Scripts\' directory, note/copy the path for later.
Open settings in Visual Studio Code: Ctrl + ','
Type in python.defaultInterpreterPath in the search field, and paste in the path to the Windows installation path for Python: