headroomlabs-ai/headroom · error · ImportError

OpenAI package required. Install with: pip install openai

Error message

OpenAI package required. Install with: pip install openai

What it means

Error "OpenAI package required. Install with: pip install openai" thrown in headroomlabs-ai/headroom.

Source

Thrown at headroom/evals/html_extraction.py:280

                client = OpenAI()

                def judge(question: str, ground_truth: str, prediction: str) -> tuple[float, str]:
                    prompt = HTML_JUDGE_PROMPT.format(
                        question=question,
                        ground_truth=ground_truth,
                        prediction=prediction,
                    )
                    response = client.chat.completions.create(
                        model=self.judge_model,
                        messages=[{"role": "user", "content": prompt}],
                        temperature=0.0,
                        max_tokens=200,
                    )
                    return self._parse_judge_response(response.choices[0].message.content or "")

                return judge
            except ImportError:
                raise ImportError(
                    "OpenAI package required. Install with: pip install openai"
                ) from None

        elif self.provider == "anthropic":
            try:
                import anthropic

                anthropic_client = anthropic.Anthropic()

                def judge(question: str, ground_truth: str, prediction: str) -> tuple[float, str]:
                    prompt = HTML_JUDGE_PROMPT.format(
                        question=question,
                        ground_truth=ground_truth,
                        prediction=prediction,
                    )
                    anthropic_response = anthropic_client.messages.create(
                        model=self.judge_model,
                        max_tokens=200,

View on GitHub (pinned to 322425c43b)

Solutions

  1. Install the OpenAI package: pip install openai
  2. Or install the evals extra: pip install headroom-ai[evals]

When it happens

Trigger: Raised when the HTML extraction eval is configured to use an OpenAI model but the `openai` package is not installed.

Common situations: See trigger scenarios.


AI-assisted analysis of headroomlabs-ai/headroom@322425c43b (2026-08-15). Data as JSON: /api/errors/abcdbe1593d2e13e. Report an issue: GitHub.