Pylint Error: Linting failed with error: pylint.exceptions.InvalidArgsError: Missing filename required for --from-stdin

Installed the Pylint extension a few days ago in VS Code, and the next day I got the error below (possibly after some updates to my laptop). I cannot find any information on the web about this error except in the Pylint documentation, which is a little over my head. After the error message, it appears to be sending and receiving responses. I’m not sure what that means; I still see minimal linting in my code, not nearly as much as expected.

I tried updating to the newest version of Python and uninstalling old version, and it didn’t help. Does anyone know how to fix this? I’m using Windows 10 Enterprise 22H2 19045.3448. Thanks

2023-10-16 08:28:41.505 [info] [Trace - 8:28:41 AM] Received notification 'window/logMessage'.
2023-10-16 08:28:41.505 [info] [Error - 8:28:41 AM] Linting failed with error:
Traceback (most recent call last):
  File "c:\Users\username\.vscode\extensions\ms-python.pylint-2023.9.12891007\bundled\tool\lsp_server.py", line 122, in _linting_helper
    result = _run_tool_on_document(document, use_stdin=True, extra_args=extra_args)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "c:\Users\username\.vscode\extensions\ms-python.pylint-2023.9.12891007\bundled\tool\lsp_server.py", line 725, in _run_tool_on_document
    result = utils.run_module(
             ^^^^^^^^^^^^^^^^^
  File "c:\Users\username\.vscode\extensions\ms-python.pylint-2023.9.12891007\bundled\tool\lsp_utils.py", line 200, in run_module
    return _run_module(module, argv, use_stdin, source)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "c:\Users\username\.vscode\extensions\ms-python.pylint-2023.9.12891007\bundled\tool\lsp_utils.py", line 185, in _run_module
    runpy.run_module(module, run_name="__main__")
  File "<frozen runpy>", line 229, in run_module
  File "<frozen runpy>", line 88, in _run_code
  File "c:\Users\username\.vscode\extensions\ms-python.pylint-2023.9.12891007\bundled\libs\pylint\__main__.py", line 10, in <module>
    pylint.run_pylint()
  File "c:\Users\username\.vscode\extensions\ms-python.pylint-2023.9.12891007\bundled\libs\pylint\__init__.py", line 34, in run_pylint
    PylintRun(argv or sys.argv[1:])
  File "c:\Users\username\.vscode\extensions\ms-python.pylint-2023.9.12891007\bundled\libs\pylint\lint\run.py", line 211, in __init__
    linter.check(args)
  File "c:\Users\username\.vscode\extensions\ms-python.pylint-2023.9.12891007\bundled\libs\pylint\lint\pylinter.py", line 665, in check
    raise exceptions.InvalidArgsError(
pylint.exceptions.InvalidArgsError: Missing filename required for --from-stdin

2023-10-16 08:28:41.506 [info] [Trace - 8:28:41 AM] Received notification 'textDocument/publishDiagnostics'.
2023-10-16 08:28:41.506 [info] [Trace - 8:28:41 AM] Received response 'textDocument/codeAction - (1)' in 473ms.
2023-10-16 08:28:41.507 [info] [Trace - 8:28:41 AM] Received response 'textDocument/codeAction - (2)' in 207ms.
2023-10-16 08:28:44.621 [info] [Trace - 8:28:44 AM] Sending request 'textDocument/codeAction - (3)'.
2023-10-16 08:28:44.623 [info] [Trace - 8:28:44 AM] Received response 'textDocument/codeAction - (3)' in 2ms.
1 Like

Hey Brown are other extensions that you have installed working correctly… if it was after updating Windows then that might be the start of the cause of the problem… was it working correctly before updating Windows

@kyle yes, the Python extension is working correctly, and yes, Pylint was working before installing updates. This is my work computer with updated company software, so it’s a bit of a black box as to what went wrong.

Hi! I have the same issue. I have been working with pylint and vscode without problems, but I noticed that I wasn’t receiving pyling messages and after checking pylint ouput I saw this:

2023-10-26 22:08:52.671 [info] [Error - 10:08:52 PM] Linting failed with error:
Traceback (most recent call last):
  File "c:\Users\x-x-x-x\.vscode\extensions\ms-python.pylint-2023.8.1\bundled\tool\lsp_server.py", line 122, in _linting_helper
    result = _run_tool_on_document(document, use_stdin=True, extra_args=extra_args)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "c:\Users\x-x-x-x\.vscode\extensions\ms-python.pylint-2023.8.1\bundled\tool\lsp_server.py", line 725, in _run_tool_on_document
    result = utils.run_module(
             ^^^^^^^^^^^^^^^^^
  File "c:\Users\x-x-x-x\.vscode\extensions\ms-python.pylint-2023.8.1\bundled\tool\lsp_utils.py", line 200, in run_module
    return _run_module(module, argv, use_stdin, source)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "c:\Users\x-x-x-x\.vscode\extensions\ms-python.pylint-2023.8.1\bundled\tool\lsp_utils.py", line 185, in _run_module
    runpy.run_module(module, run_name="__main__")
  File "<frozen runpy>", line 229, in run_module
  File "<frozen runpy>", line 88, in _run_code
  File "d:\projects\my_project\.venv\Lib\site-packages\pylint\__main__.py", line 10, in <module>
    pylint.run_pylint()
  File "d:\projects\my_project\.venv\Lib\site-packages\pylint\__init__.py", line 36, in run_pylint
    PylintRun(argv or sys.argv[1:])
  File "d:\projects\my_project\.venv\Lib\site-packages\pylint\lint\run.py", line 215, in __init__
    linter.check(args)
  File "d:\projects\my_project\.venv\Lib\site-packages\pylint\lint\pylinter.py", line 679, in check
    raise exceptions.InvalidArgsError(
pylint.exceptions.InvalidArgsError: Missing filename required for --from-stdin

VSCode details are:

Version: 1.83.1 (user setup)
Commit: f1b07bd25dfad64b0167beb15359ae573aecd2cc
Date: 2023-10-10T23:48:05.904Z
Electron: 25.8.4
ElectronBuildId: 24154031
Chromium: 114.0.5735.289
Node.js: 18.15.0
V8: 11.4.183.29-electron.0
OS: Windows_NT x64 10.0.22621

and the pylint version installed on the virtual enviroment of the project is 2.17.7

1 Like

I had the same problem, found out that setting “pylint.args” was corrupted (I’ve initially edited it via gui editor so I think there’s a bug in ms-python.pylint extension).

The corrupted line in settings.json was:

"pylint.args": ["\"pylint.args\": [\"--rcfile=.pylintrc\"]"],

And I’ve changed it to:

"pylint.args": ["--rcfile=.pylintrc"],

That fixed the problem for me. If that isn’t the case for you, paste the linting-related settings from settings.json (or the whole file), maybe we’ll find another cause. To open settings.json press F1, type “settings” and select user or workspace settings with “(JSON)”.

2 Likes

Hi! I didn’t see your response until now. Now it seems to be working properly so I didn’t need to modify settings.json. Thanks anyway!

Had same problem for last day also in VS Code in venv. PyLint did stop working when I used VSC settings GUI to adjust PyLint args using their suggested syntax: * "pylint.args": ["--disable=C0111", "--max-line-length=120"]

In actual settings.json this caused incorrect syntax since that entire string was placed inside “pylint.args”: section. Correct way is to use just the settings without the enclosing pylint.args: .

    "pylint.args": [
        "--disable=R0903",
        "--max-line-length=120"
    ],

and in GUI:

image

Now works correctly.