affaan-m/ECC · error · FalError

the 'fal_client' package is required for live calls: pip…

Error message

the 'fal_client' package is required for live calls: pip install fal-client

What it means

FalError raised by the lazy _fal() importer when the 'fal_client' package is not installed. falapi.py imports fal_client only at call time so dry runs work without it, but any live submit() or upload() needs the real package. The error is chained from the original ImportError.

Solutions

  1. Run: pip install fal-client
  2. If using a project venv, activate it (or use `python -m pip install fal-client`) so the package lands in the running interpreter
  3. Add fal-client to the project's requirements/dependency file so future installs include it
  4. Use --dry-run / DRY_RUN_ENV=1 if you only need offline validation

Example fix

// before
ModuleNotFoundError: No module named 'fal_client'
// after
$ pip install fal-client
Defensive patterns

Strategy: fallback

Validate before calling

import importlib.util
if importlib.util.find_spec("fal_client") is None:
    raise SystemExit("fal_client missing: pip install fal-client")

Try / catch

try:
    url = falapi.submit(endpoint, payload)
except falapi.FalError as e:
    if "fal_client" in str(e):
        print("Install the live dependency: pip install fal-client")

Prevention

When it happens

Trigger: Any live call path that reaches _fal() — submit() or upload() with dry-run disabled — in an environment where `import fal_client` raises ImportError.

Common situations: Ran the project without its optional live dependencies; installed into a different venv/interpreter than the one running the pipeline; fresh machine after cloning.

Understand the failure class

Background: "not installed", "pip install", "required for": how missing-dependency errors surface across open-source libraries — this error's family across 34 libraries.

Related errors


AI-assisted analysis of affaan-m/ECC@8321021c54 (2026-09-16). Data as JSON: /api/errors/f5a45f046fcff464. Report an issue: GitHub.

Appendix: source

Thrown at skills/taste-distillation/scripts/taste/falapi.py:214

    require_live()
    key = os.environ.get("FAL_KEY", "").strip()
    if not key:
        raise MissingKeyError(
            "FAL_KEY is not set.\n"
            "  Get a key at https://fal.ai/dashboard/keys, then either:\n"
            "    export FAL_KEY='...'\n"
            "  or run the pipeline offline with no key and no spend:\n"
            f"    export {DRY_RUN_ENV}=1      (or pass --dry-run)"
        )
    return key


def _fal():
    """Import ``fal_client`` lazily so dry runs work even if it is absent."""
    try:
        import fal_client  # noqa: PLC0415 - deliberate lazy import
    except ImportError as exc:  # pragma: no cover - environment dependent
        raise FalError(
            "the 'fal_client' package is required for live calls: pip install fal-client"
        ) from exc
    return fal_client


# ---------------------------------------------------------------------------
# core: submit
# ---------------------------------------------------------------------------


def _is_transient(exc: BaseException) -> bool:
    status = getattr(exc, "status_code", None)
    if status is None:
        status = getattr(getattr(exc, "response", None), "status_code", None)
    if isinstance(status, int):
        return status in _TRANSIENT_STATUS
    name = type(exc).__name__.lower()
    if "timeout" in name or "connection" in name:

View on GitHub (pinned to 8321021c54)