Skip to content

Pylint not working when in pipenv virtualenv #18802

Description

Discussed in #18787

Originally posted by bmarden March 26, 2022
I think this is a bug, but I'm not sure so posting in Q&A

When I try to use pylint in a virtual environment using pipenv, pylint fails with the error below. When using my globally installed version of pylint, it works correctly.

Vscode output tab:

> ~/.local/share/virtualenvs/blog-db-loader-7J7v1WBI/bin/python ~/.vscode/extensions/ms-python.python-2022.0.1814523869/pythonFiles/linter.py -m pylint ./main.py
cwd: .
##########Linting Output - pylint##########


[ERROR 2022-2-26 19:34:41.31]: Linter 'pylint' failed to parse the output '. SyntaxError: Unexpected end of JSON input
    at JSON.parse (<anonymous>)
    at s.parseMessages (/Users/bmarden/.vscode/extensions/ms-python.python-2022.0.1814523869/out/client/extension.js:78:360175)
    at s.run (/Users/bmarden/.vscode/extensions/ms-python.python-2022.0.1814523869/out/client/extension.js:24:218086)
    at processTicksAndRejections (internal/process/task_queues.js:93:5)
    at s.runLinter (/Users/bmarden/.vscode/extensions/ms-python.python-2022.0.1814523869/out/client/extension.js:78:359692)

If I run the pylint command in the terminal, it works correctly

~/.local/share/virtualenvs/blog-db-loader-7J7v1WBI/bin/python -m pylint ./main.py

I have the following workspace settings:

{
  "python.linting.pylintEnabled": true,
  "python.linting.enabled": true,
}

I've also tried using the pre-release version and the previous version, v2022.0.1814523869, of the python extension.

Any help would be greatly appreciated. Thank you!

System information

  • MacOS Monterey 12.3
  • python 3.10.2 via homebrew

Metadata

Metadata

Labels

area-lintingbugIssue identified by VS Code Team member as probable buginfo-neededIssue requires more information from poster

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions