Problem entry · machine-readable · 编码代理与终端

ChatGPT Windows 客户端打不开:Unable to locate the Codex CLI binary / 找不到 Codex CLI

本页嵌入 #trove-entity JSON(本条目全量结构化数据);全库数据见 /agent/trove.json。

元数据

idcodex-cli-chatgpt-not-found收录2026-08-30
问题域编码代理与终端主题分组安装与依赖
适用工具codex · 外部工具

症状

ChatGPT Windows 客户端打不开:`ChatGPT failed to start. Unable to locate the Codex CLI binary. Set CODEX_CLI_PATH or ensure the client resources include bin/codex.`;`codex --version` 可能报「不是内部或外部命令」。

原因

新版 ChatGPT 客户端启动依赖 Codex CLI 二进制:PATH 里没有 codex,且 `CODEX_CLI_PATH` 未设置或指向错误 → 客户端拒绝启动。

解法

1. `codex --version` 确认是否已装;

2. 未装 → 官方脚本安装:`powershell -ExecutionPolicy ByPass -c "irm https://chatgpt.com/codex/install.ps1 | iex"`;

3. `where codex` 拿真实路径,`setx CODEX_CLI_PATH "<真实路径>"`(变量名别写错、路径别照抄);

4. 完全退出客户端(非最小化)再重开。

验证证据

- 本机验证(2026-08-30,Windows 11):codex-cli 0.151.0-alpha.7.1 在 PATH(`where codex` → `%LOCALAPPDATA%\OpenAI\Codex\bin\<hash>\codex.exe`),CODEX_CLI_PATH 未设但客户端正常启动 → PATH 满足即可、CODEX_CLI_PATH 是显式兜底;实际安装布局与文章默认路径不同(以 where codex 为准)。证据:实测复现日志(2026-08-30)。

- 未实测:安装脚本(chatgpt.com 校园网直连超时 http=000,需网络窗口);「客户端打不开」完整场景(本机未复现,步骤来自原文)。

来源与证据

素材来源:https://blog.51cto.com/kaigejava/14886935

验证证据:Evidence details kept locally (2026-08-30)