Panniantong/Agent-Reach · error · MissingDependency

{binary} not found in PATH

Error message

{binary} not found in PATH

What it means

Raised by _require() in agent_reach/transcribe.py (as MissingDependency, a TranscribeError subclass) when shutil.which() cannot find the named external binary — in practice 'ffmpeg' or 'ffprobe' — in PATH. The transcription pipeline shells out to ffmpeg/ffprobe, so they must be installed on the host, not pip-installed.

Source

Thrown at agent_reach/transcribe.py:80


class MissingDependency(TranscribeError):
    """Raised when a required external binary is missing."""


class NoProviderConfigured(TranscribeError):
    """Raised when no provider has an API key configured."""


_BLOCKED_HOSTS = {
    "localhost",
    "metadata.google.internal",
}


def _require(binary: str) -> None:
    if not shutil.which(binary):
        raise MissingDependency(f"{binary} not found in PATH")


def _require_size_at_most(path: Path, limit: int, label: str) -> int:
    """Return file size or fail before expensive downstream processing."""
    size = path.stat().st_size
    if size > limit:
        limit_mib = limit / (1024 * 1024)
        raise TranscribeError(f"{label} exceeds safety limit of {limit_mib:g} MiB")
    return size


def _probe_audio_duration(path: Path) -> float:
    """Return duration in seconds or fail closed before media generation."""
    _require("ffprobe")
    cmd = [
        "ffprobe",
        "-v",
        "error",

View on GitHub (pinned to 93ae1d18c3)

Solutions

  1. Install the binaries: apt-get install ffmpeg / brew install ffmpeg / winget install ffmpeg
  2. Verify with `ffprobe -version` in the exact environment that runs the code
  3. For service managers, set PATH explicitly (e.g. Environment= in systemd units) or pass an absolute path by symlinking into /usr/local/bin

Example fix

# before: MissingDependency: ffprobe not found in PATH
transcribe_audio(path)

# after (debian/ubuntu)
sudo apt-get install -y ffmpeg
transcribe_audio(path)
Defensive patterns

Strategy: validation

Validate before calling

import shutil
missing = [b for b in ('ffmpeg', 'ffprobe') if not shutil.which(b)]
if missing:
    raise RuntimeError(f'install required binaries: {missing}')

Type guard

def transcribe_ready() -> bool:
    import shutil
    return all(shutil.which(b) for b in ('ffmpeg', 'ffprobe'))

Try / catch

from agent_reach.transcribe import MissingDependency
try:
    transcribe_audio(path)
except MissingDependency as e:
    raise SystemExit(f'prerequisite missing: {e}; install ffmpeg') from e

Prevention

When it happens

Trigger: Any transcribe call on a host without ffmpeg/ffprobe installed, or where they are installed but the directory is not on PATH (common in cron, systemd, or IDE-spawned shells).

Common situations: Fresh container/CI image without the ffmpeg package; macOS using a python.org interpreter that drops Homebrew /opt/homebrew/bin from PATH; Windows without ffmpeg on PATH.

Related errors


AI-assisted analysis of Panniantong/Agent-Reach@93ae1d18c3 (2026-08-14). Data as JSON: /api/errors/37214923af7440f0. Report an issue: GitHub.