{"record":{"id":"c394e8d76739387e","repo":"openai/codex","slug":"codex-binary-not-found-at-codex-bin-set-codexco","errorCode":null,"errorMessage":"Codex binary not found at {codex_bin}. Set CodexConfig.codex_bin to a valid binary path.","messagePattern":"Codex binary not found at (.+?)\\. Set CodexConfig\\.codex_bin to a valid binary path\\.","errorType":"exception","errorClass":"FileNotFoundError","httpStatus":null,"severity":"error","filePath":"sdk/python/src/openai_codex/client.py","lineNumber":180,"sourceCode":"\n@dataclass(frozen=True)\nclass CodexBinResolverOps:\n    installed_codex_path: Callable[[], Path]\n    path_exists: Callable[[Path], bool]\n\n\ndef _default_codex_bin_resolver_ops() -> CodexBinResolverOps:\n    return CodexBinResolverOps(\n        installed_codex_path=_installed_codex_path,\n        path_exists=lambda path: path.exists(),\n    )\n\n\ndef resolve_codex_bin(config: \"CodexConfig\", ops: CodexBinResolverOps) -> Path:\n    if config.codex_bin is not None:\n        codex_bin = Path(config.codex_bin)\n        if not ops.path_exists(codex_bin):\n            raise FileNotFoundError(\n                f\"Codex binary not found at {codex_bin}. Set CodexConfig.codex_bin \"\n                \"to a valid binary path.\"\n            )\n        return codex_bin\n\n    return ops.installed_codex_path()\n\n\ndef _resolve_codex_bin(config: \"CodexConfig\") -> Path:\n    return resolve_codex_bin(config, _default_codex_bin_resolver_ops())\n\n\n@dataclass(slots=True)\nclass CodexConfig:\n    \"\"\"Configuration for launching and identifying the local Codex runtime.\n\n    Most callers can use ``Codex()`` without configuration. Set ``codex_bin``\n    only when intentionally using a specific local Codex executable.","sourceCodeStart":162,"sourceCodeEnd":198,"githubUrl":"https://github.com/openai/codex/blob/339751715c64496cb86246bfb3935f40e309dd3d/sdk/python/src/openai_codex/client.py#L162-L198","documentation":"Error \"Codex binary not found at {codex_bin}. Set CodexConfig.codex_bin to a valid binary path.\" thrown in openai/codex.","triggerScenarios":"Thrown at sdk/python/src/openai_codex/client.py:180 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Set CodexConfig.codex_bin to a valid existing codex binary path."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"339751715c64496cb86246bfb3935f40e309dd3d","analyzedAt":"2026-08-25T05:35:09.876Z","schemaVersion":2},"datasetVersion":"2026-08-25T06:17:31.827Z"}