{"record":{"id":"d7c7a862e0c7e079","repo":"HKUDS/Vibe-Trading","slug":"tigeropen-is-not-installed-run-pip-install-tiger","errorCode":null,"errorMessage":"tigeropen is not installed; run `pip install tigeropen`.","messagePattern":"tigeropen is not installed; run `pip install tigeropen`\\.","errorType":"exception","errorClass":"TigerDependencyError","httpStatus":null,"severity":"error","filePath":"agent/src/trading/connectors/tiger/sdk.py","lineNumber":553,"sourceCode":"        \"order_id\": str(order_id),\n        \"profile\": config.profile,\n        \"account\": config.account,\n    }\n    if symbol:\n        result[\"symbol\"] = str(symbol).strip().upper()\n    return result\n\n\n# ---------------------------------------------------------------------------\n# SDK plumbing\n# ---------------------------------------------------------------------------\n\n\ndef _require_tigeropen() -> ModuleType:\n    try:\n        import tigeropen  # type: ignore\n    except ModuleNotFoundError as exc:\n        raise TigerDependencyError(\"tigeropen is not installed; run `pip install tigeropen`.\") from exc\n    return tigeropen\n\n\ndef _client_config(cfg: TigerConfig):\n    \"\"\"Build a ``TigerOpenClientConfig`` from connector settings.\"\"\"\n    _require_tigeropen()\n    from tigeropen.common.util.signature_utils import read_private_key  # type: ignore\n    from tigeropen.tiger_open_config import TigerOpenClientConfig  # type: ignore\n\n    key_path = Path(cfg.private_key_path).expanduser()\n    if not key_path.exists():\n        raise TigerConfigError(f\"Tiger private key not found at {key_path}\")\n    client_config = TigerOpenClientConfig()\n    client_config.private_key = read_private_key(str(key_path))\n    client_config.tiger_id = cfg.tiger_id\n    client_config.account = cfg.account\n    try:\n        client_config.timeout = cfg.timeout","sourceCodeStart":535,"sourceCodeEnd":571,"githubUrl":"https://github.com/HKUDS/Vibe-Trading/blob/80ffdda44c5c4db0dd84d70e051cca591cea67df/agent/src/trading/connectors/tiger/sdk.py#L535-L571","documentation":"_require_tigeropen attempts to import the tigeropen package and raises TigerDependencyError when ModuleNotFoundError occurs. Every client-building path (_client_config, _trade_client, _quote_client) and the availability probe tigeropen_available funnel through it, so any Tiger operation fails fast with an actionable install hint when the SDK is absent.","triggerScenarios":"Calling check_status or any Tiger data function in an environment where the tigeropen package is not installed — e.g. a fresh virtualenv, a deployment image that omitted the optional dependency, or the package being shadowed by a same-named local module.","commonSituations":"Optional broker dependencies excluded from production requirements; running tests in CI without broker extras; using a different interpreter than the one where tigeropen was pip-installed.","solutions":["pip install tigeropen in the active environment","Verify with python -c 'import tigeropen' using the same interpreter the app runs under","If in a container, add tigeropen to the image/requirements and rebuild","Alternatively call tigeropen_available() first and disable the Tiger connector when it returns falsy"],"exampleFix":"# before\n# ModuleNotFoundError -> TigerDependencyError raised on first Tiger call\n\n# after\npip install tigeropen\npython -c \"import tigeropen; print('ok')\"","handlingStrategy":"type-guard","validationCode":"from agent.src.trading.connectors.tiger import sdk as tiger_sdk\n\ndef tiger_ready() -> bool:\n    return bool(tiger_sdk.tigeropen_available())","typeGuard":"def tigeropen_available() -> bool:\n    try:\n        import tigeropen  # noqa: F401\n        return True\n    except ModuleNotFoundError:\n        return False","tryCatchPattern":"if not tigeropen_available():\n    disable_tiger_connector()\nelse:\n    try:\n        data = tiger_sdk.get_positions(cfg)\n    except TigerDependencyError:\n        disable_tiger_connector()","preventionTips":["Pin tigeropen in requirements for any deployment that uses Tiger","Gate connector registration behind an availability probe at startup","Use a lockfile so optional deps resolve reproducibly in CI and prod"],"tags":["tiger","dependency","import","pip"],"backgroundTag":"missing-optional-dependency","analyzedSha":"80ffdda44c5c4db0dd84d70e051cca591cea67df","analyzedAt":"2026-08-28T12:46:38.989Z","schemaVersion":2},"datasetVersion":"2026-08-28T16:17:29.566Z"}