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

falapi._fal() imports the fal_client package lazily so that dry runs work even when the dependency is not installed. When a live call is attempted (submit/upload path) and fal_client cannot be imported, it raises FalError instructing the user to pip install fal-client. This keeps the optional provider dependency out of the offline path.

Solutions

  1. Install the package into the environment running the script: pip install fal-client.
  2. If you use a virtualenv, activate it first (source .venv/bin/activate) or use `python -m pip install fal-client` with the same interpreter that runs the pipeline.
  3. If you only need offline output, run with --dry-run (or export DRY_RUN_ENV=1); no fal_client install is required.
  4. Verify with `python -c "import fal_client"` that the import now succeeds before re-running.

Example fix

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

# after
pip install fal-client
python -c "import fal_client"  # verify
python -m taste.pipeline run
Defensive patterns

Strategy: fallback

Validate before calling

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

Type guard

def fal_client_available() -> bool:
    try:
        import fal_client  # noqa: F401
        return True
    except ImportError:
        return False

Try / catch

try:
    result = generate(...)
except FalError as e:
    if "fal_client" in str(e):
        raise SystemExit("Install live deps: pip install fal-client") from e
    raise

Prevention

When it happens

Trigger: Any live-mode call that reaches submit() or upload(), where _fal() executes `import fal_client` and the package is absent from the active Python environment (ImportError).

Common situations: Ran the project without installing its optional live dependencies; installed into a different interpreter/venv than the one running the script; using a minimal container image; deleted/failed dependency during environment rebuild; requirements changed and the local env is stale.

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/70384ead912bc1ac. Report an issue: GitHub.

Appendix: source

Thrown at skills/taste-application/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)