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.OLS02001 — Import not found
OLS02001 — Import not found
Default severity: WarningMessage: Common causes:
{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.- 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
- Verify the module exists in one of your configured addon paths.
- Check that the Python interpreter configured for OdooLS has the package installed.
- Add the missing path to
addons_pathsorpython_pathinodools.toml.
diag_missing_imports = "none" in odools.toml. To suppress it only for non-Odoo imports, use diag_missing_imports = "only_odoo".OLS02002 — Failed to evaluate symbol
OLS02002 — Failed to evaluate symbol
Default severity: WarningMessage: Fix:
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
- 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, usediag_missing_imports to reduce them: