{"record":{"id":"f0be7d47b08ef581","repo":"nautechsystems/nautilus_trader","slug":"pandas-is-required-for-visualization-install-it-w","errorCode":null,"errorMessage":"pandas is required for visualization; install it with `pip install nautilus_trader[visualization]`","messagePattern":"pandas is required for visualization; install it with `pip install nautilus_trader\\[visualization\\]`","errorType":"exception","errorClass":"ImportError","httpStatus":null,"severity":"error","filePath":"python/nautilus_trader/analysis/tearsheet.py","lineNumber":53,"sourceCode":"from nautilus_trader.core import NAUTILUS_VERSION\nfrom nautilus_trader.core import unix_nanos_to_iso8601\nfrom nautilus_trader.model import AggregationSource\nfrom nautilus_trader.model import BarType\n\n\nif TYPE_CHECKING:\n    import pandas as pd\n\n    from nautilus_trader.backtest import BacktestEngine\n    from nautilus_trader.backtest import BacktestNode\n    from nautilus_trader.backtest import BacktestResult\n\n\ndef _require_pandas():\n    try:\n        import pandas as pd\n    except ImportError as e:\n        raise ImportError(\n            \"pandas is required for visualization; install it with \"\n            \"`pip install nautilus_trader[visualization]`\",\n        ) from e\n\n    return pd\n\n\nif not TYPE_CHECKING:\n\n    class _PandasProxy:\n        def __getattr__(self, name: str) -> Any:\n            return getattr(_require_pandas(), name)\n\n    pd = _PandasProxy()\n\n\ntry:\n    import plotly.graph_objects as go","sourceCodeStart":35,"sourceCodeEnd":71,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/a4b06ed870971b5671d12754ea138a3ab99b1dec/python/nautilus_trader/analysis/tearsheet.py#L35-L71","documentation":"BetfairCredential::resolve found no username, password, or app key anywhere: nothing was supplied in the config and the environment variables BETFAIR_USERNAME, BETFAIR_PASSWORD, BETFAIR_APP_KEY could not produce a complete triple. The adapter needs all three to log in to the Betfair Identity API and obtain a session token, so building the credential fails before any connection attempt.","triggerScenarios":"Creating BetfairDataClientConfig/BetfairExecutionClientConfig with no credential fields while none of the three BETFAIR_* variables are set in the process environment; running under systemd, Docker, or CI where the variables were never exported into that process.","commonSituations":"Env vars set in an interactive shell but missing in CI, Docker, or cron; .env file not loaded by the runner; variable-name typos such as BETFAIR_API_KEY; fresh machine or new deployment without credential setup.","solutions":["Export BETFAIR_USERNAME, BETFAIR_PASSWORD and BETFAIR_APP_KEY in the environment the node runs in","Or pass username, password and app_key explicitly when building the config","Add a preflight check that all three variables resolve before constructing the client"],"exampleFix":"# before: env empty, config fields unset\nexport BETFAIR_USERNAME=better\nexport BETFAIR_PASSWORD=secret\nexport BETFAIR_APP_KEY=xxxxxxx\n\n# or entirely in config:\nlet config = BetfairDataClientConfig::builder()\n    .username(\"better\".into())\n    .password(\"secret\".into())\n    .app_key(\"xxxxxxx\".into())\n    .build()?;","handlingStrategy":"validation","validationCode":"let missing: Vec<&str> = [\n    (\"BETFAIR_USERNAME\", username.is_none() && std::env::var(\"BETFAIR_USERNAME\").is_err()),\n    (\"BETFAIR_PASSWORD\", password.is_none() && std::env::var(\"BETFAIR_PASSWORD\").is_err()),\n    (\"BETFAIR_APP_KEY\", app_key.is_none() && std::env::var(\"BETFAIR_APP_KEY\").is_err()),\n]\n.iter().filter(|(_, missing)| *missing).map(|(k, _)| *k).collect();\nanyhow::ensure!(missing.is_empty(), \"missing Betfair credentials: {missing:?}\");","typeGuard":"fn betfair_credentials_resolvable() -> bool {\n    std::env::var(\"BETFAIR_USERNAME\").is_ok()\n        && std::env::var(\"BETFAIR_PASSWORD\").is_ok()\n        && std::env::var(\"BETFAIR_APP_KEY\").is_ok()\n}","tryCatchPattern":null,"preventionTips":["Source all three credentials from one place - all env or all config","Add a startup preflight asserting the three variables exist","In Docker/systemd, verify with `env | grep BETFAIR` inside the actual runtime"],"tags":["betfair","credentials","environment","config","rust","nautilustrader"],"backgroundTag":"missing-credentials","analyzedSha":"a4b06ed870971b5671d12754ea138a3ab99b1dec","analyzedAt":"2026-08-16T22:54:50.089Z","schemaVersion":2},"datasetVersion":"2026-08-16T23:17:17.608Z"}