vscode pylance type checking does not recognize re imports

Viewed 713

When turning on "python.analysis.typeCheckingMode": "strict" or "python.analysis.typeCheckingMode": "basic", .py files containing imports of other modules do not recognize reimports and highlight them with errors:

"Flow" is not exported from module "prefect"
  Import from "prefect.core" insteadPylancereportPrivateImportUsage

where the original module has __init__.py but does not contain __all__ export but does import all the individual objects(in the case above Flow). Is there any way of turning that particular setting off in settings.json or dealing with muting the error noise?

1 Answers

You can turn this setting off by setting an override in settings.json:

  "python.analysis.diagnosticSeverityOverrides": {
    "reportPrivateImportUsage":"none" 
  }

You can also set it to "warning" or "information" for less intrusive notifications.

Related