Skip to content

ModuleNotFoundError: No module named 'httpx' on fresh 0.13.0 install — httpx imported but not declared #122

Description

@klasnyi

Summary

A fresh install of 0.13.0 fails on every CLI invocation with ModuleNotFoundError: No module named 'httpx'. httpx is imported at module top level in five modules but is not declared in the project dependencies.

Reproduce

uv tool install "reverse-api-engineer[manual]"
reverse-api-engineer --version
Traceback (most recent call last):
  File "~/.local/bin/reverse-api-engineer", line 4, in <module>
    from reverse_api.cli import main
  File ".../reverse_api/cli.py", line 24, in <module>
    from .engineer import run_reverse_engineering
  File ".../reverse_api/engineer.py", line 23, in <module>
    from .base_engineer import REPORT_CLIENT_VERIFIED_INSTRUCTION, BaseEngineer
  File ".../reverse_api/base_engineer.py", line 14, in <module>
    from .messages import MessageStore
  File ".../reverse_api/messages.py", line 7, in <module>
    from .utils import get_messages_path
  File ".../reverse_api/utils.py", line 11, in <module>
    import httpx
ModuleNotFoundError: No module named 'httpx'

Because the chain starts in cli.py, no entry point survives — not even --version.

Root cause

This is not simply a forgotten dependency: a transitive one disappeared.

httpx used to arrive through mcp. mcp 2.0.0 switched to httpx2>=2.5.0, so httpx is no longer pulled into the environment, and the undeclared import surfaces.

Installed metadata in a fresh environment:

mcp                2.0.0     requires httpx2>=2.5.0   (no httpx)
claude-agent-sdk   0.2.143   does not require httpx

Declared dependencies of reverse-api-engineer 0.13.0 — httpx is absent:

aiohttp, claude-agent-sdk, click, cryptography, pygments,
questionary, requests, rich, setproctitle, watchdog

That is why the bug is invisible in older environments that still resolve mcp 1.x.

Affected modules

Top-level imports:

  • reverse_api/utils.py:11
  • reverse_api/auto_engineer.py:11
  • reverse_api/ollama_runtime.py:17
  • reverse_api/opencode_runtime.py:22
  • reverse_api/opencode_engineer.py:14

Plus a local import at reverse_api/cli.py:125.

Suggested fix

Add the dependency explicitly in pyproject.toml:

dependencies = [
    ...
    "httpx>=0.27",
]

Pinning mcp<2 would also restore the transitive path, but declaring the direct import is the more robust fix — the code imports httpx directly, so it should own the requirement.

Workaround

uv tool install --with httpx "reverse-api-engineer[manual]"

Environment

macOS (darwin 25.6.0) · Python 3.13 in the uv tool environment · reverse-api-engineer 0.13.0 · mcp 2.0.0 · claude-agent-sdk 0.2.143 · uv 0.11.6

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions