The Fix
pip install urllib3==1.26.7
Based on closed urllib3/urllib3 issue #2269 · PR/commit linked
Production note: Most teams hit this during upgrades or environment changes. Roll out with a canary and smoke critical endpoints (health, OpenAPI/docs) before 100%.
@@ -0,0 +1,4 @@
@@ -0,0 +1,4 @@
+Removed the ``urllib3.request`` module. ``urllib3.request.RequestMethods`` has been made a private API.
+
+This change was made to ensure that ``from urllib3 import request`` imported the top-level ``request()``
>> import urllib3
>> resp = urllib3.request("GET", "https://httpbin.org/robots.txt")
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: 'module' object is not callable
Re-run the minimal reproduction on your broken version, then apply the fix and re-run.
Option A — Upgrade to fixed release\npip install urllib3==1.26.7\nWhen NOT to use: This fix should not be applied if backward compatibility with the `request` module is required.\n\n
Why This Fix Works in Production
- Trigger: >> import urllib3
- Mechanism: The presence of both a `request` module and a `request` function caused import conflicts
- Why the fix works: Removed the `urllib3.request` module and made `urllib3.request.RequestMethods` a private API to improve import behavior. (first fixed release: 1.26.7).
- If left unfixed, the same config can fail only in production (env differences), causing startup failures or partial feature outages.
Why This Breaks in Prod
- The presence of both a `request` module and a `request` function caused import conflicts
- Surfaces as: >> import urllib3
Proof / Evidence
- GitHub issue: #2269
- Fix PR: https://github.com/urllib3/urllib3/pull/2398
- First fixed release: 1.26.7
- Reproduced locally: No (not executed)
- Last verified: 2026-02-09
- Confidence: 0.95
- Did this fix it?: Yes (upstream fix exists)
- Own content ratio: 0.62
Discussion
High-signal excerpts from the issue thread (symptoms, repros, edge-cases).
“Probably it's the same issue but following the instructions from the website: Not a good first-user experience. At least update the documentation.”
“@atodorov Sorry that happened! Where did you find the link to those docs btw? We just recently fixed URLs on the 1.26.x Github branch to…”
“@atodorov As mentioned by @sethmlarson above, we know that latest points to the unreleased v2, while https://urllib3.readthedocs.io/en/stable/ and https://urllib3.readthedocs.io/en/1.26.x/ will show you the docs of…”
“This is all very true, unfortunately urllib3 painted itself into a corner by documenting its internals as public APIs.”
Failure Signature (Search String)
- >> import urllib3
Error Message
Stack trace
Error Message
-------------
>> import urllib3
>> resp = urllib3.request("GET", "https://httpbin.org/robots.txt")
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: 'module' object is not callable
Minimal Reproduction
>> import urllib3
>> resp = urllib3.request("GET", "https://httpbin.org/robots.txt")
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: 'module' object is not callable
What Broke
Users experienced TypeErrors when attempting to call the `request` function due to import issues.
Why It Broke
The presence of both a `request` module and a `request` function caused import conflicts
Fix Options (Details)
Option A — Upgrade to fixed release Safe default (recommended)
pip install urllib3==1.26.7
Use when you can deploy the upstream fix. It is usually lower-risk than long-lived workarounds.
Fix reference: https://github.com/urllib3/urllib3/pull/2398
First fixed release: 1.26.7
Last verified: 2026-02-09. Validate in your environment.
When NOT to Use This Fix
- This fix should not be applied if backward compatibility with the `request` module is required.
Verify Fix
Re-run the minimal reproduction on your broken version, then apply the fix and re-run.
Did This Fix Work in Your Case?
Quick signal helps us prioritize which fixes to verify and improve.
Prevention
- Add a CI check that diffs key outputs after upgrades (OpenAPI schema snapshots, JSON payload shapes, CLI output).
- Upgrade behind a canary and run integration tests against the canary before 100% rollout.
Version Compatibility Table
| Version | Status |
|---|---|
| 1.26.7 | Fixed |
Related Issues
No related fixes found.
Sources
We don’t republish the full GitHub discussion text. Use the links above for context.