Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pylint 2.15 Raise pylint_plugin_utils.NoSuchChecker on Windows #378

Open
obi-081 opened this issue Oct 25, 2022 · 2 comments
Open

Pylint 2.15 Raise pylint_plugin_utils.NoSuchChecker on Windows #378

obi-081 opened this issue Oct 25, 2022 · 2 comments
Labels

Comments

@obi-081
Copy link

obi-081 commented Oct 25, 2022

Hi,
If I upgrade PyLint to 2.15.x, I can't load the pylint_django plugin anymore.
It raise pylint_plugin_utils.NoSuchChecker: <class 'pylint.checkers.typecheck.TypeChecker'>

Can you reproduce this problem too ?

I'm on Windows 11 (sorry ^_^)
Python 3.10.8
astroid==2.12.12
Django==4.0.8
pylint==2.15.5
pylint-django==2.5.3
pylint-plugin-utils==0.7

Here's an example of what I get:

D:\Work\django>django-admin startproject mysite
D:\Work\django>cd mysite
D:\Work\django\mysite>pylint mysite --django-settings-module=mysite.settings --load-plugins=pylint_django
Traceback (most recent call last):
  File "C:\Python3\lib\site-packages\pylint_plugin_utils\__init__.py", line 44, in augment_visit
    checker = get_checker(linter, checker_method.__self__.__class__)
AttributeError: 'function' object has no attribute '__self__'. Did you mean: '__call__'?

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Python3\lib\runpy.py", line 196, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "C:\Python3\lib\runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "C:\Python3\Scripts\pylint.exe\__main__.py", line 7, in <module>
  File "C:\Python3\lib\site-packages\pylint\__init__.py", line 35, in run_pylint
    PylintRun(argv or sys.argv[1:])
  File "C:\Python3\lib\site-packages\pylint\lint\run.py", line 151, in __init__
    linter.load_plugin_modules(self._plugins)
  File "C:\Python3\lib\site-packages\pylint\lint\pylinter.py", line 376, in load_plugin_modules
    module.register(self)
  File "C:\Python3\lib\site-packages\pylint_django\plugin.py", line 44, in register
    apply_augmentations(linter)
  File "C:\Python3\lib\site-packages\pylint_django\augmentations\__init__.py", line 840, in apply_augmentations
    augment_visit(linter, TypeChecker.visit_attribute, foreign_key_sets)
  File "C:\Python3\lib\site-packages\pylint_plugin_utils\__init__.py", line 46, in augment_visit
    checker = get_checker(
  File "C:\Python3\lib\site-packages\pylint_plugin_utils\__init__.py", line 28, in get_checker
    raise NoSuchChecker(checker_class)
pylint_plugin_utils.NoSuchChecker: <class 'pylint.checkers.typecheck.TypeChecker'>

After a pip install "pylint<2.15", it works well.

Here's my full pip freeze : https://www.dropbox.com/s/e0i9enof9r71rzi/pip-freeze.txt?dl=0

Thanks !

Jerome

@obi-081 obi-081 changed the title Pylint 2.15 Raise pylint_plugin_utils.NoSuchChecker Pylint 2.15 Raise pylint_plugin_utils.NoSuchChecker on Windows Oct 26, 2022
@obi-081
Copy link
Author

obi-081 commented Oct 26, 2022

I tested the Same configuration on Linux and got the Issue #370 instead so this one is Windows Only

@millsks
Copy link

millsks commented Jan 16, 2024

I came across this issue on Linux recently. I had to downgrade pylint from 2.17.7 to <2.15 and that error went away.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants