Skip to main content
OLS02xxx diagnostics report problems OdooLS encounters when resolving Python import statements. These diagnostics help you catch references to modules or packages that are not reachable in the configured Python environment or addon paths.
You can limit which missing-import diagnostics are shown using the diag_missing_imports configuration option. See Configuring diagnostics for details.
Default severity: WarningMessage: {0} not foundOdooLS could not find the module or symbol being imported. The import target is not present in the configured Python environment, sys.path, or addon paths.
from odoo.addons.missing_module import something  # OLS02001
import numpy  # OLS02001 if numpy is not in the Python environment
Common causes:
  • The module is in an addon directory that is not listed in the OdooLS addon paths
  • The Python package is not installed in the configured interpreter
  • A typo in the import path
Fix:
  1. Verify the module exists in one of your configured addon paths.
  2. Check that the Python interpreter configured for OdooLS has the package installed.
  3. Add the missing path to addons_paths or python_path in odools.toml.
To suppress this diagnostic globally, set diag_missing_imports = "none" in odools.toml. To suppress it only for non-Odoo imports, use diag_missing_imports = "only_odoo".
Default severity: WarningMessage: Failed to evaluate {0}OdooLS found the import target but could not fully evaluate its value or type. This most commonly occurs when:
  • A circular import is detected — module A imports from module B, which imports from module A
  • Too many import * (star imports) are used, causing OdooLS to lose track of which names are in scope
from odoo.addons.my_module import circular_dep  # OLS02002 if circular import
Fix:
  • Break circular imports by restructuring your module dependencies or using lazy imports.
  • Replace import * with explicit named imports wherever possible.
  • If your code works correctly at runtime and neither of the above applies, this may be a temporary OdooLS limitation.

Suppressing import diagnostics

If import warnings are noisy in your project, use diag_missing_imports to reduce them:
[[config]]
# Only warn about missing imports inside Odoo addon modules
diag_missing_imports = "only_odoo"
Or silence them entirely for a specific directory using a filter:
[[config.diagnostic_filters]]
paths = ["**/vendor/**", "**/external/**"]
codes = ["OLS02.*"]
path_type = "in"
See Configuring diagnostics for all available options.

Build docs developers (and LLMs) love