Reputation: 1
I am running a django server on Linux environment. When running pylint from commandline there is no error.
Versions
pylint 2.15.5
astroid 2.12.12
Python 3.10.6 (main, Nov 2 2022, 18:53:38) [GCC 11.3.0]
pylint_django 2.5.3
VSCode:
Version: 1.73.1 (system setup)
Commit: 6261075646f055b99068d3688932416f2346dd3b
Date: 2022-11-09T04:27:29.066Z
Electron: 19.0.17
Chromium: 102.0.5005.167
Node.js: 16.14.2
V8: 10.2.154.15-electron.0
OS: Windows_NT x64 10.0.22000
Sandboxed: No
pylint --load-plugins=pylint_django --django-settings-module=server.settings /root/server/app/test.py
But when .pylintrc file is editted and I add these values to the config. I get the following error.
##########Linting Output - pylint##########
[ERROR 2022-10-30 19:15:36.361]: Linter 'pylint' failed to parse the output '. SyntaxError: Unexpected end of JSON input
at JSON.parse (<anonymous>)
at s.parseMessages (/root/.vscode-server/extensions/ms-python.python-2022.18.2/src/client/linters/pylint.ts:48:39)
at s.run (/root/.vscode-server/extensions/ms-python.python-2022.18.2/src/client/linters/baseLinter.ts:99:31)
at runMicrotasks (<anonymous>)
at process.messages (node:internal/process/task_queues:96:5)
at s.runLinter (/root/.vscode-server/extensions/ms-python.python-2022.18.2/src/client/linters/pylint.ts:21:15)
Anyone who has encountered the same problem and knowns how to fix this issue.
Tried running the command and that worked, but when it's run from the default python extension it gives an error.
Upvotes: 0
Views: 261
Reputation: 172
VScode with the remote plugin sets the wrong path for pylint.
Go to settings and search for: @id:python.linting.pylintPath pylint
.
You'll be able to set the path to pylint inside your venv.
See also:
https://github.com/microsoft/vscode-python/issues/17999
Upvotes: 1