langflow-ai/langflow · error · ModuleNotFoundError
The '{provider}' components moved to the 'lfx-bundles' distr
Error message
The '{provider}' components moved to the 'lfx-bundles' distribution. Install it with: pip install lfx-bundles (or 'pip install langflow', which bundles it). What it means
This message is not raised by the migration script itself — consolidate_bundles.py embeds it inside a generated shim module. When a provider directory (e.g. lfx/components/<provider>) is consolidated into the lfx-bundles metapackage, the old package path is left as a shim whose __init__.py re-exports from lfx_bundles.<slug>. If lfx-bundles (or langflow, which bundles it) is not installed, importing the old path raises ModuleNotFoundError with exactly this instruction text. It is a deliberate, actionable replacement for a bare 'No module named lfx_bundles'.
Source
Thrown at scripts/migrate/consolidate_bundles.py:251
"\n"
"This module re-points to the installed bundle distribution. It contains\n"
"no component implementations and no third-party dependencies, and is\n"
"removed once the deprecation window closes (M4).\n"
'"""\n'
"\n"
"import importlib\n"
"import sys\n"
"\n"
"try:\n"
f' sys.modules[__name__] = importlib.import_module("lfx_bundles.{slug}")\n'
"except ModuleNotFoundError as exc:\n"
' if exc.name is not None and (exc.name == "lfx_bundles" or exc.name.startswith("lfx_bundles.")):\n'
" msg = (\n"
f" \"The '{provider}' components moved to the 'lfx-bundles' distribution. \"\n"
' "Install it with: pip install lfx-bundles "\n'
" \"(or 'pip install langflow', which bundles it).\"\n"
" )\n"
' raise ModuleNotFoundError(msg, name="lfx_bundles") from exc\n'
" raise\n"
)
def _rewrite_self_imports(text: str, provider: str, slug: str) -> str:
"""Rewrite absolute ``lfx.components.<provider>`` self-refs to ``lfx_bundles.<slug>``."""
return re.sub(rf"\blfx\.components\.{re.escape(provider)}\b", f"lfx_bundles.{slug}", text)
def bundle_slug(provider: str) -> str:
"""Bundle directory / ext-slug name for a provider.
Bundle names must satisfy ``BUNDLE_NAME_RE`` (lowercase), so the in-tree
source dir name is lowercased -- e.g. ``FAISS`` -> ``faiss``, ``Notion`` ->
``notion``. Already-lowercase providers are unchanged. The historical
``lfx.components.<provider>`` import paths (migration table) keep the
original casing; only the bundle dir + ``ext:<slug>`` id are lowercased.
"""View on GitHub (pinned to 976ec789d2)
Solutions
- Install the metapackage: `pip install lfx-bundles`.
- Or install the full distribution that depends on it: `pip install langflow`.
- Longer term, migrate imports to the canonical bundle paths (lfx_bundles.<slug>, or the ext:<slug>:<Class> component ids) so code no longer depends on the legacy shim.
- Verify with `python -c "import lfx_bundles; print(lfx_bundles.__version__)"` before re-running your app.
Example fix
# before pip install lfx python -c "import lfx.components.openai" # ModuleNotFoundError: The 'openai' components moved ... # after pip install lfx-bundles # or: pip install langflow python -c "import lfx.components.openai" # OK via shim
Defensive patterns
Strategy: validation
Validate before calling
import importlib.util
if importlib.util.find_spec("lfx_bundles") is None:
raise SystemExit(
"This flow needs consolidated components. Install first: pip install lfx-bundles (or pip install langflow)"
)
import lfx.components.openai # now safe Type guard
import importlib.util
def legacy_provider_available(provider: str) -> bool:
"""True when the shim target lfx_bundles (or langflow) is importable."""
return importlib.util.find_spec("lfx_bundles") is not None or importlib.util.find_spec("langflow") is not None Try / catch
try:
import lfx.components.openai as openai_components
except ModuleNotFoundError as exc:
if "lfx-bundles" in str(exc):
# actionable guidance, not a bare traceback
raise SystemExit(
"Consolidated provider imported without its bundle. "
"Fix: pip install lfx-bundles"
) from exc
raise Prevention
- Pin 'lfx-bundles' (or 'langflow') in requirements whenever code imports any lfx.components.<provider> legacy path.
- Prefer the canonical lfx_bundles.<slug> / ext:<slug> imports in new code so shims are irrelevant.
- Smoke-test `import lfx.components.<provider>` in CI for every provider your flows reference.
When it happens
Trigger: In an environment with only `lfx` installed (not `langflow` and not `lfx-bundles`), executing `import lfx.components.openai` (or any import of the legacy module path for a consolidated provider), or loading a saved flow that references the legacy import path while lfx_bundles is missing. The shim catches the inner ModuleNotFoundError for lfx_bundles[.] and re-raises with this message; any other missing module propagates unchanged.
Common situations: Partial environments: installing bare `lfx` to get the executor CLI but old code/flows still import `lfx.components.<provider>`; CI images trimmed to lfx-only; a venv created before the bundles split, after which a `pip install -U lfx` no longer pulls the components.
Related errors
- {provider}: source has subdirectory/ies {subdirs} that move_
- Could not read lfx version from src/lfx/pyproject.toml
- Could not import {attr_name!r} from {__name__!r}: {e}
- {nested} imports from ``langflow`` -- the bundle is installe
- {src} imports from ``langflow`` -- the bundle is installed a
AI-assisted analysis of langflow-ai/langflow@976ec789d2 (2026-08-14).
Data as JSON: /api/errors/45e85e23a5111c57.
Report an issue: GitHub.