Skip to content

Unable to get pylint to work in vscode #13678

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
karrtikr opened this issue Aug 29, 2020 · 9 comments
Closed

Unable to get pylint to work in vscode #13678

karrtikr opened this issue Aug 29, 2020 · 9 comments
Labels
bug Issue identified by VS Code Team member as probable bug investigating We are looking into the cause of the issue

Comments

@karrtikr
Copy link

Originally posted by @WinstonN in #7314 (comment)

I am unable to get pylint to work in vscode

Version: 1.48.2
Commit: a0479759d6e9ea56afa657e454193f72aef85bd0
Date: 2020-08-25T10:09:08.021Z (4 days ago)
Electron: 7.3.2
Chrome: 78.0.3904.130
Node.js: 12.8.1
V8: 7.8.279.23-electron.0
OS: Darwin x64 18.7.0

My settings file looks like

❯❯❯ cat .vscode/settings.json
{
    "python.linting.enabled": true,
    "python.linting.pylintEnabled": true,
    "python.languageServer": "Jedi"
}

Running linting does nothing

image

Can you please help me get this working?
Thanks!

@ghost ghost added the triage-needed Needs assignment to the proper sub-team label Aug 29, 2020
@karthiknadig karthiknadig added triage bug Issue identified by VS Code Team member as probable bug labels Aug 31, 2020
@ghost ghost removed the triage-needed Needs assignment to the proper sub-team label Aug 31, 2020
@ericsnowcurrently
Copy link

@WinstonN, how are you trying to run linting?

@ericsnowcurrently ericsnowcurrently added the info-needed Issue requires more information from poster label Aug 31, 2020
@WinstonN
Copy link

@WinstonN, how are you trying to run linting?

@ericsnowcurrently I tried multiple ways, saving the file and by using the command then selecting run python linting

@ericsnowcurrently
Copy link

Please provide the content of the "Python" output panel. Also, do you have the same problem if you set "python.languageServer": "Pylance" (instead of Jedi)?

@gusarg81
Copy link

gusarg81 commented Sep 1, 2020

Hi,

For me is not working under venv (before running my project ouside venv, was working). I've reported this to visual code repo but they redirected me here.

settings.json:

{
        "python.pythonPath": "venv/bin/python",
        "python.linting.enabled": true,
        "python.linting.pylintEnabled": true,
}

workspace:

{
        "folders": [
                {
                        "path": "."
                }
        ],
        "settings": {
                "python.pythonPath": "venv/bin/python"
        },
        "launch": {
                "version": "0.2.0",
                "configurations": [
                        {
                                "name": "Python: Django",
                                "type": "python",
                                "request": "launch",
                                "program": "${workspaceFolder}/manage.py",
                                "args": [
                                        "runserver",
                                        "--noreload"
                                ],
                                "django": true
                        }
                ]
        }
}

Python: v3.8.2 (using venv)
VCODE: v1.48.2
MS-Python ext: v2020.8.105369

@tyday
Copy link

tyday commented Sep 15, 2020

I don't know if this belongs here but I'm also having a problem with pylint. I can't get vs-code to install it on my Windows 10 machine. I'm using git bash. It will auto install if I change my terminal to PowerShell. You'll notice that it doesn't double up the slashes. I went through previous releases and it works before version 2020.6.88468 for me.

image

(virtenv) 
tyrda@DESKTOP-ISGAD51 MINGW64 /e/OneDrive/Programming/nonsense
$ e:/OneDrive/Programming/nonsense/virtenv/Scripts/python.exe c:\Users\tyrda\.vscode\extensions\ms-python.python-2020.8.108011\pythonFiles\pyvsc-run-isolated.py pip install -U pylint
E:\OneDrive\Programming\nonsense\virtenv\Scripts\python.exe: can't open file 'c:Userstyrda.vscodeextensionsms-python.python-2020.8.108011pythonFilespyvsc-run-isolated.py': [Errno 2] No such file or directory   

I noticed someone had the same problem on stackoverflow today.

@karthiknadig karthiknadig added investigating We are looking into the cause of the issue and removed triage labels Sep 15, 2020
@mark-turner
Copy link

I have the same issue as gusarg81: pylint does not work within VS Code when you have activated a virtual environment.

It works when using the system installed pylint outside of a venv.

Allowing the VS Code extension to install pylint in the venv completes successfully but still gives the missing pylint error afterward.

pylint_err1

pylint_err2

pylint_err3

@brettcannon brettcannon removed the info-needed Issue requires more information from poster label Nov 6, 2020
@sztal
Copy link

sztal commented Jul 4, 2021

Hi, I have the same problem (on Ubuntu). Pylint is installed in the Conda env I work with and I can successfully lint files from command line. However, no linting is done by VS Code even though PyLint is enabled in configuration.

I checked both with Jedi and PyLance servers and in both cases the problem persists.

EDIT.
It seems that it works with PyLance after all (but not with Jedi). However, PyLance seems to react only to some subset of possible errors/problems. But this may be due to something in my config, so I will check this later and let you know if PyLance is fully okay in my case or not.

@karthiknadig
Copy link
Member

@sztal when you use JediLSP/Pylance they use their own things to provide linting (i.e., you have to explicitly enable pylint linting for this to work). For better diagnosis, file a separate bug with your output logs and settings.

@kimadeline kimadeline modified the milestone: September 2021 Sep 21, 2021
@karthiknadig
Copy link
Member

In the latest release we changed how the Ls and pylint combination works. going forward pylint if needed will have to be explicitly enabled. If pylint fails to work, please file a separate bug.

@karthiknadig karthiknadig removed their assignment Oct 12, 2021
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 30, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by VS Code Team member as probable bug investigating We are looking into the cause of the issue
Projects
None yet
Development

No branches or pull requests

10 participants