pylint-dev / pylint-django

Pylint plugin for improving code analysis for when using Django
Other
591 stars 117 forks source link

ModuleNotFound error with pylint-django plugin - pylint 3.0.2, pylint_django 2.5.5 #422

Open danryu opened 10 months ago

danryu commented 10 months ago

Bug description

Seems to be a regression/repeat of https://github.com/pylint-dev/pylint/issues/7938 with pylint 3.x

Works fine with 2.15.9, 2.17.7.

Fails with ModuleNotFound error with 3.0.2.

Configuration

No response

Command used

pylint --load-plugins pylint_django --django-settings-module=myapp.settings myapp/

Pylint output

ModuleNotFoundError: No module named 'somemodule'

Expected behavior

successful pylint test output

Pylint version

pylint 3.0.2

OS / Environment

ubuntu 22.04

Additional dependencies

No response

DanielNoord commented 9 months ago

Could you report this to pylint_django?

Pierre-Sassoulas commented 9 months ago

We can actually just transfer the issue to pylint-django if we want. transfer issue

jmhansen commented 7 months ago

I ran into this same issue, but it was happening sporadically. A coworker figured out that the ModuleNotFound error happened when we made changes to files within directories that were not Python modules. Adding a __init__py file to the directory fixed the issue for me.