skip to Main Content

Versions:

  • Python: 3.10.4
  • Pylint: 2.15.3
  • Visual Studio Code: 1.72.2

The .pylintrc file was generated using

pylint --generate-rcfile

command.

It has the following option configured:

[METHOD_ARGS]

# List of qualified names (i.e., library.method) which require a timeout
# parameter e.g. 'requests.api.get,requests.api.post'
timeout-methods=requests.api.delete,requests.api.get,requests.api.head,requests.api.options,requests.api.patch,requests.api.post,requests.api.put,requests.api.request

However I see an error which sounds:

Unrecognized option found: timeout-methods Pylint(E0015:unrecognized-option)

The documentation states that option timeout-methods is supported: https://pylint.pycqa.org/en/latest/user_guide/configuration/all-options.html#timeout-methods.

So I am lost why do I have that error displayed by pylint in visual studio code.

2

Answers


  1. pylint 2.15 take this option into account correctly. But it was released only 2 month ago. Your error must come from the pylint version included in visual studio code that might lag a little behind and do not handle it yet.

    Login or Signup to reply.
  2. As the comments under the original code showed, the pylint version bundled in the VS Code extension and the one that was used to generate the .pylintrc file differ.

    Normally, the VS Code Pylint extension should use the pylint version installed in the Python environment that you configured to use for your project, and only falls back to the bundled version if no other pylint version was found. See also the extension docs for details.

    Check the following:

    1. Make sure that you configured the correct Python environment for your project. See Select a Python interpreter in the docs.
    2. Make sure that you have installed pylint in the Python environment you have configured for your project, and are not accidentally using a pylint installation from your global Python environment. After configuring the Python interpreter (see step 1), once you open a new terminal in VS Code this environment should be activated by default. Run pip list | grep pylint (macOS/Linux) or pip list | findstr pylint (Windows) to check if pylint is installed.
    3. If both 1 & 2 are fulfilled and you still have problems, check if pylint.importStrategy is maybe set to useBundled in your VS Code settings.json, and remove it or set it to fromEnvironment.
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search