nautechsystems/nautilus_trader · error · ImportError

plotly is required for visualization. Install it with: pip i

Error message

plotly is required for visualization. Install it with: pip install nautilus_trader[visualization]

What it means

BetfairExecutionClientConfig::validate() rejects order_request_rate_per_second == 0. This field throttles order-placement requests specifically and is separate from the general request_rate_per_second; only the execution client config carries it. Zero would make order submission impossible, so validation aborts the connect before any live trading can start.

Source

Thrown at python/nautilus_trader/analysis/tearsheet.py:413

    str or None
        HTML string if output_path is None, otherwise None.

    Raises
    ------
    ImportError
        If plotly is not installed.
    ValueError
        If ``bars_with_fills`` is configured without a node, a supplied node has no
        run configuration ID, or the matching run configuration sets
        ``dispose_on_completion=True``.

    """
    if not PLOTLY_AVAILABLE:
        msg = (
            "plotly is required for visualization. "
            "Install it with: pip install nautilus_trader[visualization]"
        )
        raise ImportError(msg)

    _require_not_none(engine, "engine")

    if not hasattr(engine, "get_result"):
        return _create_tearsheet_from_result(
            result=engine,
            node=node,
            run_config_id=run_config_id,
            currency=currency,
            output_path=output_path,
            title=title,
            config=config,
            benchmark_returns=benchmark_returns,
            benchmark_name=benchmark_name,
        )

    result = engine.get_result()
    stats_returns = dict(result.stats_returns)

View on GitHub (pinned to a4b06ed870)

Solutions

  1. Set a positive order request rate matching your app key's order transaction limits
  2. Omit the field so the default applies
  3. Add a deployment gate that runs validate() on the exec config before the node starts

Example fix

// before
.order_request_rate_per_second(0)

// after
.order_request_rate_per_second(5)
Defensive patterns

Strategy: validation

Validate before calling

let config = BetfairExecutionClientConfig::builder()
    .order_request_rate_per_second(5)
    .build()?;
config.validate()?;

Type guard

fn is_positive_rate(v: u32) -> bool {
    v > 0
}

Prevention

When it happens

Trigger: Setting order_request_rate_per_second: 0 in a live execution config; deserializing an exec config from a template that zero-initializes numeric fields; calling validate() during deployment checks.

Common situations: Placeholder zeros left in configs promoted from test to live; misunderstanding the two rate fields and zeroing both; schema migration adding the field with a zero default.

Related errors


AI-assisted analysis of nautechsystems/nautilus_trader@a4b06ed870 (2026-08-16). Data as JSON: /api/errors/03b9a29223f3c63a. Report an issue: GitHub.