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
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.
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 otherpylint
version was found. See also the extension docs for details.Check the following:
pylint
in the Python environment you have configured for your project, and are not accidentally using apylint
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. Runpip list | grep pylint
(macOS/Linux) orpip list | findstr pylint
(Windows) to check ifpylint
is installed.pylint.importStrategy
is maybe set touseBundled
in your VS Codesettings.json
, and remove it or set it tofromEnvironment
.