langchain-ai/langgraph · error · ValueError

Module ' ' not found in 'dependencies' list. Add its…

Error message

Module '{import_str}' not found in 'dependencies' list. Add its containing package to 'dependencies' list.

What it means

The graph module is an installed package (no slashes) but its containing package is not listed in the 'dependencies' array of langgraph.json, so the runtime container will not have it installed. The ValueError tells the user to add the package.

Solutions

  1. Add the package containing the module to the 'dependencies' list in langgraph.json, e.g. "dependencies": [".", "some-package"].
  2. If it is local code, use a relative file path ('./pkg/agent.py:graph') covered by a '.' dependency.
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at libs/cli/langgraph_cli/config.py:916 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of langchain-ai/langgraph@38031739e5 (2026-08-26). Data as JSON: /api/errors/dd8d852a7bb50765. Report an issue: GitHub.

Appendix: source

Thrown at libs/cli/langgraph_cli/config.py:916

            else:
                for path in local_deps.real_pkgs:
                    if resolved.is_relative_to(path):
                        container_path = (
                            pathlib.Path("/deps")
                            / path.name
                            / resolved.relative_to(path)
                        )
                        module_str = container_path.as_posix()
                        break
                else:
                    for faux_pkg, (_, destpath) in local_deps.faux_pkgs.items():
                        if resolved.is_relative_to(faux_pkg):
                            container_subpath = resolved.relative_to(faux_pkg)
                            # Construct the final path, ensuring POSIX style
                            module_str = f"{destpath}/{container_subpath.as_posix()}"
                            break
                    else:
                        raise ValueError(
                            f"Module '{import_str}' not found in 'dependencies' list. "
                            "Add its containing package to 'dependencies' list."
                        )
            # update the config
            if isinstance(data, dict):
                config["graphs"][graph_id]["path"] = f"{module_str}:{attr_str}"
            else:
                config["graphs"][graph_id] = f"{module_str}:{attr_str}"


def _update_auth_path(
    config_path: pathlib.Path, config: Config, local_deps: LocalDeps
) -> None:
    """Update auth.path to use Docker container paths."""
    auth_conf = config.get("auth")
    if not auth_conf or not (path_str := auth_conf.get("path")):
        return

View on GitHub (pinned to 38031739e5)