0

I have a project structure of:

common (folder)
  |- __init__.py
  |- model.py
  |- monitoring.py
     |- class MyLogger

on the model.py file i have this line and the following error: from common.monitoring import MyLogger

errors:

No name 'monitoring ' in module 'common'    pylint (no-name-in-module).
Unable to import 'common.monitoring'    pylint(import-error).

import monitoring hits the same errors.

in practice:

  1. the code runs smoothly
  2. F12 (go to definition) works and goes the MyLogger.

I searched across the web and couldn't find how to configure VS code well to eliminate those errors.

Gama11
  • 31,714
  • 9
  • 78
  • 100
Orco
  • 3
  • 2
  • "Go to definition" has nothing to do with the linter, btw. Do you have pylint installed into the python environment associated with this project? – Paul H Sep 28 '20 at 18:41
  • I have pylint installed and running. I took this direction and installed Bandit (the first linting tool in the list) - seems to clear all those import errors.. do you know why? can i configure pylint to be working better or just continue with Bandit? – Orco Sep 29 '20 at 04:34

1 Answers1

0

So i found eventually the answer: How do I disable pylint unused import error messages in vs code

Bottom line: add to the settings.json:

"python.linting.pylintArgs": [
        "--max-line-length=100",
        "--disable=W0142,W0403,W0613,W0232,R0903,R0913,C0103,R0914,C0304,F0401,W0402,E1101,W0614,C0111,C0301"
    ],
Orco
  • 3
  • 2