openai/codex · error · FileNotFoundError

{PACKAGE_NAME} is installed but missing its package metadata

Error message

{PACKAGE_NAME} is installed but missing its package metadata at {metadata_path}

What it means

Error "{PACKAGE_NAME} is installed but missing its package metadata at {metadata_path}" thrown in openai/codex.

Source

Thrown at sdk/python-runtime/src/codex_cli_bin/__init__.py:12

import os
from pathlib import Path

PACKAGE_NAME = "openai-codex-cli-bin"
PACKAGE_METADATA_FILENAME = "codex-package.json"


def bundled_package_dir() -> Path:
    path = Path(__file__).resolve().parent
    metadata_path = path / PACKAGE_METADATA_FILENAME
    if not metadata_path.is_file():
        raise FileNotFoundError(
            f"{PACKAGE_NAME} is installed but missing its package metadata at {metadata_path}"
        )
    return path


def bundled_codex_path() -> Path:
    exe = "codex.exe" if os.name == "nt" else "codex"
    path = bundled_package_dir() / "bin" / exe
    if not path.is_file():
        raise FileNotFoundError(
            f"{PACKAGE_NAME} is installed but missing its packaged codex binary at {path}"
        )
    return path


def bundled_path_dir() -> Path | None:
    path = bundled_package_dir() / "codex-path"
    return path if path.is_dir() else None

View on GitHub (pinned to 339751715c)

Solutions

  1. Reinstall the codex runtime package so its package metadata is restored.

When it happens

Trigger: Thrown at sdk/python-runtime/src/codex_cli_bin/__init__.py:12 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of openai/codex@339751715c (2026-08-25). Data as JSON: /api/errors/96b0189c21f41f36. Report an issue: GitHub.