{"record":{"id":"bab8137ba809a6c0","repo":"langchain-ai/deepagents","slug":"missing-dependencies-for-provider-sandbox-in","errorCode":null,"errorMessage":"Missing dependencies for '{provider}' sandbox. {install_hint}","messagePattern":"Missing dependencies for '(.+?)' sandbox\\. (.+?)","errorType":"exception","errorClass":"ImportError","httpStatus":null,"severity":"error","filePath":"libs/code/deepagents_code/integrations/sandbox_factory.py","lineNumber":1117,"sourceCode":"            provider,\n        )\n        return\n\n    try:\n        found = importlib.util.find_spec(metadata.backend_module) is not None\n    except (ImportError, ValueError):\n        found = False\n\n    if not found:\n        if metadata.install is not None:\n            install_hint = (\n                f\"Install with: {metadata.install.command(in_app=True)} (in-app) \"\n                f\"or {metadata.install.command(in_app=False)} (CLI)\"\n            )\n        else:\n            install_hint = \"Install the provider's package.\"\n        msg = f\"Missing dependencies for '{provider}' sandbox. {install_hint}\"\n        raise ImportError(msg)\n\n\n__all__ = [\n    \"create_sandbox\",\n    \"get_default_working_dir\",\n    \"verify_sandbox_deps\",\n]\n","sourceCodeStart":1099,"sourceCodeEnd":1125,"githubUrl":"https://github.com/langchain-ai/deepagents/blob/a1af029e6e73cb17c36bff823d227747b28e91e1/libs/code/deepagents_code/integrations/sandbox_factory.py#L1099-L1125","documentation":"`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).","triggerScenarios":"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.","commonSituations":"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.","solutions":["Run the printed install hint, e.g. `pip install <provider-package>` or add the matching extra (`pip install deepagents-code[sandbox-<provider>]).`","Check the configured sandbox provider name for typos against the installed providers list.","Call `verify_sandbox_deps(name)` early at startup to fail fast with a clear message."],"exampleFix":"# before\nget_or_create('modal')  # ImportError: Missing dependencies for 'modal' sandbox\n# after\n$ pip install modal   # or: pip install 'deepagents-code[sandbox-modal]'","handlingStrategy":"validation","validationCode":"import importlib.util\n\ndef provider_deps_installed(pkg: str) -> bool:\n    return importlib.util.find_spec(pkg) is not None\n\nverify_sandbox_deps('modal')  # fail fast at startup","typeGuard":null,"tryCatchPattern":"try:\n    verify_sandbox_deps(provider)\nexcept ImportError as exc:\n    print(f'{exc}\\nInstall the missing package and retry.')\n    sys.exit(1)","preventionTips":["Call verify_sandbox_deps at CLI/app startup for the configured provider","Install the matching extra (deepagents-code[sandbox-<provider>]) in CI and dev envs","Document required optional dependencies per provider"],"tags":["python","sandbox","dependency","import","installation"],"backgroundTag":"missing-dependency","analyzedSha":"a1af029e6e73cb17c36bff823d227747b28e91e1","analyzedAt":"2026-08-29T11:43:24.718Z","schemaVersion":2},"datasetVersion":"2026-08-29T12:17:43.993Z"}