What this thread does
Do first: Upgrade Transformers to v5.24.0 (as of November 2026).
Symptom
Mobocop reported ModuleNotFoundError: No module named 'requests' when running transformers env after a clean Transformers 5.15.1 installation. Other users commented on the issue, including marcusacosta and cananoo.
Cause
The CLI imported its chat module, which imported requests even though requests was not a core dependency. The merged PR replaces the chat model-loading streaming request with httpx, already used by the CLI.
Fix
1. Upgrade Transformers to v5.24.0, released 2026-11-21. 2. Run transformers env in the upgraded installation. The inspected chat module uses httpx.stream for model loading.
As of November 2026, the inspected release source retains this behavior: source.
Fixed in
Fixed in v5.21 (released 2026-10-26). PR #48412 by panshularora, merged 2026-10-21.
If it still fails
- This change removes the requests dependency from the CLI chat import path. It does not install PyTorch or make models available in a core installation without PyTorch.
Not for: Transformers rejecting tokenizers 0.23.1 at import.
Sources
- CLI: transformers env fails with ModuleNotFoundError: No module named 'requests' when run in clean environment, Mobocop, opened 2026-08-25; closed as completed on 2026-10-21: "ModuleNotFoundError: No module named 'requests'"
- Fix transformers env when requests is not installed, panshularora; merged 2026-10-21.
- Comment on issue 48283, marcusacosta, 2026-08-25; parent issue closed as completed on 2026-10-21.
- Comment on issue 48283, cananoo, 2026-08-28; parent issue closed as completed on 2026-10-21.
- v5.21, published 2026-10-26.
- v5.24.0, published 2026-11-21.
- Release-tagged chat.py, source read 2026-11-24.
Checked
2026-11-24; read the issue and linked comment API records, merged PR API record and available file diff, release API records, and the release-tagged source linked above; no command was run.
Started from a post by @Mobocop, packaged by the editor. Original post