Search code examples
pythonvisual-studio-codelinter

VSCode: Linting not working on Python 2.7


System: Win x64 10.0.18363

VSCode: 1.43.2

Python: 2.7.10 32-bit

My linter just stopped working on VSCode around the time I installed flake8. I have no clue what is wrong because the linter is running it just does not print any problems. Everytime I run the linter it shows me:

C:\Python27\python.exe -m pylint --disable=all --enable=F,unreachable,duplicate-key,unnecessary-semicolon,global-variable-not-assigned,unused-variable,unused-wildcard-import,binary-op-exception,bad-format-string,anomalous-backslash-in-string,bad-open-mode,E0001,E0011,E0012,E0100,E0101,E0102,E0103,E0104,E0105,E0107,E0108,E0110,E0111,E0112,E0113,E0114,E0115,E0116,E0117,E0118,E0202,E0203,E0211,E0213,E0236,E0237,E0238,E0239,E0240,E0241,E0301,E0302,E0303,E0401,E0402,E0601,E0602,E0603,E0604,E0611,E0632,E0633,E0701,E0702,E0703,E0704,E0710,E0711,E0712,E1003,E1101,E1102,E1111,E1120,E1121,E1123,E1124,E1125,E1126,E1127,E1128,E1129,E1130,E1131,E1132,E1133,E1134,E1135,E1136,E1137,E1138,E1139,E1200,E1201,E1205,E1206,E1300,E1301,E1302,E1303,E1304,E1305,E1306,E1310,E1700,E1701 --msg-template='{line},{column},{category},{symbol}:{msg}' --reports=n --output-format=text "c:\ Correct Path (removed for privacy reasons)"
cwd: c:\ Correct Path (removed for privacy reasons)
(first 2 lines printed again)
##########Linting Output - pylint##########

Nothing ever gets outputted. When I switch to Python 3.8 it works perfectly and shows me all the errors as it should. It has the exact same output with just different path for Python 3.8. My settings.json include the following:

"python.pythonPath": "C:\\Python27\\python.exe",
"python.linting.pylintEnabled": true,
"python.linting.pylintUseMinimalCheckers": true,
"python.linting.enabled": true,
"python.linting.mypyEnabled": false,

I tried every settings I could, but there is no difference. I tried over 5 linters and they all do the same thing. I just get no output whatsoever on my console anymore and I don't know why. It was working before so I know it is not any path issues.

The only hint I have, is that if I go to developer tools, there is an error on line 173 of console.ts

Error Python Extension: 2020-03-29 21:56:02: stderr jediProxy Error (stderr) completion.py:586: DeprecationWarning: Deprecated since version 0.16.0. Use Script(...).get_names instead.
  jedi.api.names(

for the code:

(console as any)[entry.severity].apply(console, consoleArgs); 
// underlined red is -> 'apply(console, consoleArgs);'

I tried googling this error, but I was not getting anything that was on my particular problem. Any help would be great.

EDIT

I found a temporary solution after a few hours. It is to simply turn off Jedi. You have to go to settings and find Python: Jedi Enabled and turn it off. I say it is temporary as I would prefer to have Jedi on so I will not answer my question just yet. This seems like a new bug so I hope this helps others.


Solution

  • It should be a Jedi version issue, I solve it by specifying the version.

    pip install jedi==0.15.2