The Fix
Upgrade to version 0.7.3 or later.
Based on closed encode/httpx issue #193 · 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%.
@@ -1,3 +1,4 @@
include CHANGELOG.md
include LICENSE.md
+include httpx/py.typed
Option A — Upgrade to fixed release\nUpgrade to version 0.7.3 or later.\nWhen NOT to use: This fix should not be applied if the library does not require type hinting.\n\n
Why This Fix Works in Production
- Trigger: Missing py.typed declaration?
- Mechanism: Adds the `py.typed` marker file and a `package_data` entry to enable type hint discovery by mypy, addressing issue #193.
- Why the fix works: Adds the `py.typed` marker file and a `package_data` entry to enable type hint discovery by mypy, addressing issue #193. (first fixed release: 0.7.3).
- 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
- Shows up under Python 3.7 in real deployments (not just unit tests).
- Production symptom (often without a traceback): Missing py.typed declaration?
Proof / Evidence
- GitHub issue: #193
- Fix PR: https://github.com/encode/httpx/pull/441
- First fixed release: 0.7.3
- Reproduced locally: No (not executed)
- Last verified: 2026-02-09
- Confidence: 0.75
- Did this fix it?: Yes (upstream fix exists)
- Own content ratio: 0.85
Discussion
High-signal excerpts from the issue thread (symptoms, repros, edge-cases).
“Thanks for reporting this @kylebebak, it'll be fixed in 0.7.3! :)”
“@andrewmwhite @sethmlarson Hey all, I just did pip install httpx to install httpx v0.7.2”
“Did you properly install the module via pip? I had an issue occurring where I installed a module via pip but my Python wasn't in…”
“Hmmm, we definitely want our type annotations to be discoverable by mypy. Do you think that this is something you'd be able to tackle? :)”
Failure Signature (Search String)
- Missing py.typed declaration?
- `error: Cannot find module named 'httpx'`
Copy-friendly signature
Failure Signature
-----------------
Missing py.typed declaration?
`error: Cannot find module named 'httpx'`
Error Message
Signature-only (no traceback captured)
Error Message
-------------
Missing py.typed declaration?
`error: Cannot find module named 'httpx'`
Environment
- Python: 3.7
- httpx: 0.7.2
What Broke
Users experience type checking issues with mypy due to missing type annotations.
Fix Options (Details)
Option A — Upgrade to fixed release Safe default (recommended)
Upgrade to version 0.7.3 or later.
Use when you can deploy the upstream fix. It is usually lower-risk than long-lived workarounds.
Fix reference: https://github.com/encode/httpx/pull/441
First fixed release: 0.7.3
Last verified: 2026-02-09. Validate in your environment.
When NOT to Use This Fix
- This fix should not be applied if the library does not require type hinting.
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 |
|---|---|
| 0.7.3 | Fixed |
Related Issues
No related fixes found.
Sources
We don’t republish the full GitHub discussion text. Use the links above for context.