langchain-ai/deepagents · error · ToolRequirementIntrospectionError
uv tool receipt not found at {receipt_path}
Error message
uv tool receipt not found at {receipt_path} What it means
deepagents-code is normally installed as a uv tool, and its update/dependency code reconstructs the install by reading the uv receipt file (uv-receipt.toml) under the tool root. This error means that receipt file does not exist at the expected path, so the library cannot introspect the tool's requirements. It wraps FileNotFoundError in ToolRequirementIntrospectionError.
Source
Thrown at libs/code/deepagents_code/update_check.py:2931
def _uv_tool_receipt_data(tool_root: Path | None = None) -> dict[str, Any]:
"""Return parsed uv tool receipt data for the current tool environment.
Args:
tool_root: Optional uv tool environment root. Defaults to `sys.prefix`.
Returns:
Parsed TOML data from `uv-receipt.toml`.
Raises:
ToolRequirementIntrospectionError: If the receipt cannot be read or
parsed.
"""
receipt_path = _uv_tool_receipt_path(tool_root)
try:
return tomllib.loads(receipt_path.read_text(encoding="utf-8"))
except FileNotFoundError as exc:
msg = f"uv tool receipt not found at {receipt_path}"
raise ToolRequirementIntrospectionError(msg) from exc
except (OSError, tomllib.TOMLDecodeError) as exc:
msg = f"Could not read uv tool receipt at {receipt_path}: {exc}"
raise ToolRequirementIntrospectionError(msg) from exc
def _iter_uv_tool_requirements(
data: dict[str, Any],
) -> Iterator[tuple[str, dict[str, Any]]]:
"""Yield validated `(name, entry)` pairs from a uv tool receipt.
Shared by the selected-extras and `--with`-package readers so the receipt's
`[tool].requirements` shape is validated — and its failure messages worded —
in exactly one place. Callers apply their own per-entry key allowlist, which
is the only part that legitimately differs between them.
Args:
data: Parsed `uv-receipt.toml` contents.
View on GitHub (pinned to a1af029e6e)
Solutions
- Reinstall the tool with uv: `uv tool install deepagents-code --force` to regenerate the receipt.
- Verify the receipt exists at `$(uv tool dir)/deepagents-code/uv-receipt.toml` and that UV_TOOL_DIR matches the tool_root being inspected.
- If you are not running as a uv tool, skip the uv-specific introspection path or pass the correct tool_root explicitly.
Example fix
// before: inspecting a tool installed outside uv
cmd = _uv_tool_install_command(tool_root=Path('/some/pip/venv'))
// after: reinstall under uv or guard first
if not (Path(os.environ.get('UV_TOOL_DIR', '~/.local/share/uv/tools')).expanduser() / 'deepagents-code' / 'uv-receipt.toml').exists():
raise RuntimeError('deepagents-code is not installed as a uv tool; run: uv tool install deepagents-code')
cmd = _uv_tool_install_command() Defensive patterns
Strategy: try-catch
Validate before calling
import tomllib
from pathlib import Path
def receipt_exists(tool_root: Path) -> bool:
p = tool_root / 'uv-receipt.toml' if tool_root else None
return bool(p and p.is_file()) Type guard
def has_receipt(data: object) -> bool:
return isinstance(data, dict) and isinstance(data.get('tool'), dict) Try / catch
try:
cmd = _uv_tool_install_command(tool_root=tool_root)
except ToolRequirementIntrospectionError:
# not installed as a uv tool (or receipt missing): fall back
cmd = ['uv', 'tool', 'install', 'deepagents-code'] Prevention
- Install the package with `uv tool install deepagents-code`, not pip, before using uv-specific helpers.
- Keep UV_TOOL_DIR stable; do not move or prune the uv tools directory.
- Check for uv-receipt.toml before running dependency-refresh or extras commands.
- Regenerate the receipt with `uv tool install --force` after any manual manipulation of the tool dir.
When it happens
Trigger: Calling any of _uv_tool_python, _uv_tool_selected_extras, _uv_tool_with_packages, or _uv_tool_install_command (directly or via dependency-refresh / extras-management helpers) when _uv_tool_receipt_path(tool_root) points to a non-existent uv-receipt.toml.
Common situations: The package was installed with pip/venv instead of `uv tool install`; the UV_TOOL_DIR was moved, cleaned, or points elsewhere; the tool directory was partially deleted; a broken `uv tool upgrade` left no receipt behind.
Related errors
- debug log directory is not a real directory: {path}
- debug log directory is not owned by the current user: {path}
- Cannot determine whether {str(left)!r} is {str(right)!r}: {e
- Invalid DEEPAGENTS_HOME {str(root)!r}: exists but cannot be
- Invalid DEEPAGENTS_HOME {str(root)!r}: exists but is not a d
AI-assisted analysis of langchain-ai/deepagents@a1af029e6e (2026-08-29).
Data as JSON: /api/errors/5a22d661acbd30f1.
Report an issue: GitHub.