langchain-ai/deepagents · error · ImportError

Missing dependencies for '{provider}' sandbox. {install_hint

Error message

Missing dependencies for '{provider}' sandbox. {install_hint}

What it means

`verify_sandbox_deps` checks that the Python package(s) implementing a sandbox provider are importable. If a required dependency is absent, it raises ImportError with the provider name plus an install hint derived from the provider's metadata (in-app and CLI install commands).

Source

Thrown at libs/code/deepagents_code/integrations/sandbox_factory.py:1117

            provider,
        )
        return

    try:
        found = importlib.util.find_spec(metadata.backend_module) is not None
    except (ImportError, ValueError):
        found = False

    if not found:
        if metadata.install is not None:
            install_hint = (
                f"Install with: {metadata.install.command(in_app=True)} (in-app) "
                f"or {metadata.install.command(in_app=False)} (CLI)"
            )
        else:
            install_hint = "Install the provider's package."
        msg = f"Missing dependencies for '{provider}' sandbox. {install_hint}"
        raise ImportError(msg)


__all__ = [
    "create_sandbox",
    "get_default_working_dir",
    "verify_sandbox_deps",
]

View on GitHub (pinned to a1af029e6e)

Solutions

  1. Run the printed install hint, e.g. `pip install <provider-package>` or add the matching extra (`pip install deepagents-code[sandbox-<provider>]).`
  2. Check the configured sandbox provider name for typos against the installed providers list.
  3. Call `verify_sandbox_deps(name)` early at startup to fail fast with a clear message.

Example fix

# before
get_or_create('modal')  # ImportError: Missing dependencies for 'modal' sandbox
# after
$ pip install modal   # or: pip install 'deepagents-code[sandbox-modal]'
Defensive patterns

Strategy: validation

Validate before calling

import importlib.util

def provider_deps_installed(pkg: str) -> bool:
    return importlib.util.find_spec(pkg) is not None

verify_sandbox_deps('modal')  # fail fast at startup

Try / catch

try:
    verify_sandbox_deps(provider)
except ImportError as exc:
    print(f'{exc}\nInstall the missing package and retry.')
    sys.exit(1)

Prevention

When it happens

Trigger: Calling `verify_sandbox_deps('local')` (or any provider name) or going through `cli_main` when the provider's backing package is not installed in the current environment — e.g. `verify_sandbox_deps('daytona')` without `daytona` installed.

Common situations: Fresh venv or CI runner missing optional extras, selecting a provider in config that was never installed, using the CLI with a `--sandbox` flag whose package is an optional dependency.

Related errors


AI-assisted analysis of langchain-ai/deepagents@a1af029e6e (2026-08-29). Data as JSON: /api/errors/bab8137ba809a6c0. Report an issue: GitHub.