HKUDS/Vibe-Trading · error · RuntimeError

WhatsApp dependencies not installed. Run: pip install "vibe-

Error message

WhatsApp dependencies not installed. Run: pip install "vibe-trading-ai[whatsapp]"

What it means

Raised by _load_neonize when importing neonize (NewAClient, events, build_jid) fails with ImportError. The WhatsApp channel is implemented via the optional neonize package, which is not installed with the base distribution. The error tells you to install the whatsapp extra.

Source

Thrown at agent/src/channels/whatsapp.py:74

def _default_database_path() -> Path:
    return get_runtime_subdir("whatsapp-auth") / "neonize.db"


def _legacy_bridge_config_fields(config: dict[str, Any]) -> list[str]:
    return [field for field in _LEGACY_BRIDGE_CONFIG_FIELDS if field in config]


def _load_neonize() -> _NeonizeAPI:
    global _NEONIZE_API
    if _NEONIZE_API is not None:
        return _NEONIZE_API

    try:
        from neonize.aioze.client import NewAClient
        from neonize.aioze.events import ConnectedEv, DisconnectedEv, MessageEv, PairStatusEv
        from neonize.utils.jid import build_jid
    except ImportError as exc:
        raise RuntimeError(
            'WhatsApp dependencies not installed. Run: pip install "vibe-trading-ai[whatsapp]"'
        ) from exc

    _NEONIZE_API = _NeonizeAPI(
        NewAClient=NewAClient,
        ConnectedEv=ConnectedEv,
        DisconnectedEv=DisconnectedEv,
        MessageEv=MessageEv,
        PairStatusEv=PairStatusEv,
        build_jid=build_jid,
    )
    return _NEONIZE_API


def _has_field(message: Any, name: str) -> bool:
    if message is None:
        return False

View on GitHub (pinned to 80ffdda44c)

Solutions

  1. Run: pip install "vibe-trading-ai[whatsapp]"
  2. Confirm you are installing into the same Python environment the app runs in (check `which python` / `pip -V`).
  3. In Dockerfiles, add the whatsapp extra to the pip install line.

Example fix

# before
pip install vibe-trading-ai

# after
pip install "vibe-trading-ai[whatsapp]"
Defensive patterns

Strategy: validation

Validate before calling

def whatsapp_deps_available() -> bool:
    try:
        import importlib.util
        return importlib.util.find_spec('neonize') is not None
    except Exception:
        return False

Try / catch

try:
    channel = WhatsAppChannel(...)
except RuntimeError as e:
    if 'WhatsApp dependencies not installed' in str(e):
        raise SystemExit('Install with: pip install "vibe-trading-ai[whatsapp]"')
    raise

Prevention

When it happens

Trigger: Instantiating or connecting the WhatsApp channel (via _new_client, _build_jid, or _register_handlers) when neonize is not installed in the current environment.

Common situations: Installed the package without the [whatsapp] extra; running in a slim Docker image; virtualenv mismatch where the app runs in a different interpreter than the one with neonize 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/a771c471f0f8d4f7. Report an issue: GitHub.