{"record":{"id":"70384ead912bc1ac","repo":"affaan-m/ECC","slug":"the-fal-client-package-is-required-for-live-calls-pip-falapi","errorCode":null,"errorMessage":"the 'fal_client' package is required for live calls: pip install fal-client","messagePattern":"the 'fal_client' package is required for live calls: pip install fal-client","errorType":"exception","errorClass":"FalError","httpStatus":null,"severity":"error","filePath":"skills/taste-application/scripts/taste/falapi.py","lineNumber":214,"sourceCode":"    require_live()\n    key = os.environ.get(\"FAL_KEY\", \"\").strip()\n    if not key:\n        raise MissingKeyError(\n            \"FAL_KEY is not set.\\n\"\n            \"  Get a key at https://fal.ai/dashboard/keys, then either:\\n\"\n            \"    export FAL_KEY='...'\\n\"\n            \"  or run the pipeline offline with no key and no spend:\\n\"\n            f\"    export {DRY_RUN_ENV}=1      (or pass --dry-run)\"\n        )\n    return key\n\n\ndef _fal():\n    \"\"\"Import ``fal_client`` lazily so dry runs work even if it is absent.\"\"\"\n    try:\n        import fal_client  # noqa: PLC0415 - deliberate lazy import\n    except ImportError as exc:  # pragma: no cover - environment dependent\n        raise FalError(\n            \"the 'fal_client' package is required for live calls: pip install fal-client\"\n        ) from exc\n    return fal_client\n\n\n# ---------------------------------------------------------------------------\n# core: submit\n# ---------------------------------------------------------------------------\n\n\ndef _is_transient(exc: BaseException) -> bool:\n    status = getattr(exc, \"status_code\", None)\n    if status is None:\n        status = getattr(getattr(exc, \"response\", None), \"status_code\", None)\n    if isinstance(status, int):\n        return status in _TRANSIENT_STATUS\n    name = type(exc).__name__.lower()\n    if \"timeout\" in name or \"connection\" in name:","sourceCodeStart":196,"sourceCodeEnd":232,"githubUrl":"https://github.com/affaan-m/ECC/blob/8321021c54d670126ce3b2969d5deb880b4b0c2a/skills/taste-application/scripts/taste/falapi.py#L196-L232","documentation":"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.","triggerScenarios":"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).","commonSituations":"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.","solutions":["Install the package into the environment running the script: pip install fal-client.","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.","If you only need offline output, run with --dry-run (or export DRY_RUN_ENV=1); no fal_client install is required.","Verify with `python -c \"import fal_client\"` that the import now succeeds before re-running."],"exampleFix":"# before\nFalError: the 'fal_client' package is required for live calls: pip install fal-client\n\n# after\npip install fal-client\npython -c \"import fal_client\"  # verify\npython -m taste.pipeline run","handlingStrategy":"fallback","validationCode":"import importlib.util\nif importlib.util.find_spec(\"fal_client\") is None:\n    raise SystemExit(\"fal-client not installed: pip install fal-client\")","typeGuard":"def fal_client_available() -> bool:\n    try:\n        import fal_client  # noqa: F401\n        return True\n    except ImportError:\n        return False","tryCatchPattern":"try:\n    result = generate(...)\nexcept FalError as e:\n    if \"fal_client\" in str(e):\n        raise SystemExit(\"Install live deps: pip install fal-client\") from e\n    raise","preventionTips":["Install optional/live extras (e.g. pip install -e '.[live]') when setting up the project","Pin fal-client in requirements or extras so environments are reproducible","Verify the interpreter/venv you install into is the one that runs the pipeline","Use dry-run mode when the dependency is intentionally absent"],"tags":["python","missing-dependency","import-error"],"backgroundTag":"missing-dependency","analyzedSha":"8321021c54d670126ce3b2969d5deb880b4b0c2a","analyzedAt":"2026-09-16T10:08:13.343Z","contentChangedAt":"2026-09-16T10:08:13.343Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}