HKUDS/Vibe-Trading · error · TigerDependencyError

tigeropen is not installed; run `pip install tigeropen`.

Error message

tigeropen is not installed; run `pip install tigeropen`.

What it means

_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.

Solutions

  1. pip install tigeropen in the active environment
  2. Verify with python -c 'import tigeropen' using the same interpreter the app runs under
  3. If in a container, add tigeropen to the image/requirements and rebuild
  4. Alternatively call tigeropen_available() first and disable the Tiger connector when it returns falsy

Example fix

# before
# ModuleNotFoundError -> TigerDependencyError raised on first Tiger call

# after
pip install tigeropen
python -c "import tigeropen; print('ok')"
Defensive patterns

Strategy: type-guard

Validate before calling

from agent.src.trading.connectors.tiger import sdk as tiger_sdk

def tiger_ready() -> bool:
    return bool(tiger_sdk.tigeropen_available())

Type guard

def tigeropen_available() -> bool:
    try:
        import tigeropen  # noqa: F401
        return True
    except ModuleNotFoundError:
        return False

Try / catch

if not tigeropen_available():
    disable_tiger_connector()
else:
    try:
        data = tiger_sdk.get_positions(cfg)
    except TigerDependencyError:
        disable_tiger_connector()

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Understand the failure class

Background: "X is not installed. Please install it with pip install Y": missing optional dependency errors — ImportError/ValueError raised when a library's optional extra was never installed — this error's family across 22 libraries.

Related errors


AI-assisted analysis of HKUDS/Vibe-Trading@80ffdda44c (2026-08-28). Data as JSON: /api/errors/d7c7a862e0c7e079. Report an issue: GitHub.

Appendix: source

Thrown at agent/src/trading/connectors/tiger/sdk.py:553

        "order_id": str(order_id),
        "profile": config.profile,
        "account": config.account,
    }
    if symbol:
        result["symbol"] = str(symbol).strip().upper()
    return result


# ---------------------------------------------------------------------------
# SDK plumbing
# ---------------------------------------------------------------------------


def _require_tigeropen() -> ModuleType:
    try:
        import tigeropen  # type: ignore
    except ModuleNotFoundError as exc:
        raise TigerDependencyError("tigeropen is not installed; run `pip install tigeropen`.") from exc
    return tigeropen


def _client_config(cfg: TigerConfig):
    """Build a ``TigerOpenClientConfig`` from connector settings."""
    _require_tigeropen()
    from tigeropen.common.util.signature_utils import read_private_key  # type: ignore
    from tigeropen.tiger_open_config import TigerOpenClientConfig  # type: ignore

    key_path = Path(cfg.private_key_path).expanduser()
    if not key_path.exists():
        raise TigerConfigError(f"Tiger private key not found at {key_path}")
    client_config = TigerOpenClientConfig()
    client_config.private_key = read_private_key(str(key_path))
    client_config.tiger_id = cfg.tiger_id
    client_config.account = cfg.account
    try:
        client_config.timeout = cfg.timeout

View on GitHub (pinned to 80ffdda44c)