Pylint has some quirks. In this case it doesn’t know where to find your module because it’s in subdirectory of your venv path. To solve this:
-
Put this setting in your workspace or folder settings:
"python.linting.pylintArgs": [ "--init-hook", "import sys; sys.path.append('<path to folder your module is in>')" ]
or, maybe better
-
Generate .pylintrc file. From integrated terminal with venv activated run:
pylint --generate-rcfile > .pylintrc
then open the generated file and uncomment the init-hook= part to be:
init-hook='import sys; sys.path.append("<path to folder you module is in>")'
Read the .pylintrc and tweak settings if you wish. In both cases path should point to your ‘database’ folder.
-
After learning about pylint settings, do it the right way:
from database.database_dispatcher import ...
See this answer by Anthony Sottile.