The Fix
pip install redis==7.1.0
Based on closed redis/redis-py issue #3461 · 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%.
@@ -16,4 +16,4 @@ uvloop
wheel>=0.30.0
numpy>=1.24.0
-redispy-entraid-credentials @ git+https://github.com/redis-developer/redispy-entra-credentials.git/@main
+redis-entraid==0.1.0b1
diff --git a/setup.py b/setup.py
import redis
/usr/local/lib/python3.12/site-packages/redis/__init__.py:3: in <module>
from redis import asyncio # noqa
/usr/local/lib/python3.12/site-packages/redis/asyncio/__init__.py:1: in <module>
from redis.asyncio.client import Redis, StrictRedis
/usr/local/lib/python3.12/site-packages/redis/asyncio/client.py:35: in <module>
from redis.asyncio.connection import (
/usr/local/lib/python3.12/site-packages/redis/asyncio/connection.py:30: in <module>
from ..auth.token import TokenInterface
/usr/local/lib/python3.12/site-packages/redis/auth/token.py:4: in <module>
import jwt
E ModuleNotFoundError: No module named 'jwt'
Re-run the minimal reproduction on your broken version, then apply the fix and re-run.
Option A — Upgrade to fixed release\npip install redis==7.1.0\nWhen NOT to use: Do not apply this fix if the application does not require the 'jwt' module.\n\n
Why This Fix Works in Production
- Trigger: import redis
- Mechanism: The missing dependency 'PyJWT' caused a ModuleNotFoundError for the 'jwt' module
- Why the fix works: Adds the missing dependency 'PyJWT' to resolve the ModuleNotFoundError for the 'jwt' module. (first fixed release: 7.1.0).
- 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.12 in real deployments (not just unit tests).
- The missing dependency 'PyJWT' caused a ModuleNotFoundError for the 'jwt' module
- Surfaces as: import redis
Proof / Evidence
- GitHub issue: #3461
- Fix PR: https://github.com/redis/redis-py/pull/3462
- First fixed release: 7.1.0
- 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.40
Discussion
High-signal excerpts from the issue thread (symptoms, repros, edge-cases).
“It is probably best to remove requirements.txt and dev_requirements.txt and handle dependencies in setup.py.”
“@vladvildanov I proposed a fix in https://github.com/redis/redis-py/pull/3462”
“@woutdenolf Hey, thanks for pointing out missing dependency”
Failure Signature (Search String)
- import redis
Error Message
Stack trace
Error Message
-------------
import redis
/usr/local/lib/python3.12/site-packages/redis/__init__.py:3: in <module>
from redis import asyncio # noqa
/usr/local/lib/python3.12/site-packages/redis/asyncio/__init__.py:1: in <module>
from redis.asyncio.client import Redis, StrictRedis
/usr/local/lib/python3.12/site-packages/redis/asyncio/client.py:35: in <module>
from redis.asyncio.connection import (
/usr/local/lib/python3.12/site-packages/redis/asyncio/connection.py:30: in <module>
from ..auth.token import TokenInterface
/usr/local/lib/python3.12/site-packages/redis/auth/token.py:4: in <module>
import jwt
E ModuleNotFoundError: No module named 'jwt'
Minimal Reproduction
import redis
/usr/local/lib/python3.12/site-packages/redis/__init__.py:3: in <module>
from redis import asyncio # noqa
/usr/local/lib/python3.12/site-packages/redis/asyncio/__init__.py:1: in <module>
from redis.asyncio.client import Redis, StrictRedis
/usr/local/lib/python3.12/site-packages/redis/asyncio/client.py:35: in <module>
from redis.asyncio.connection import (
/usr/local/lib/python3.12/site-packages/redis/asyncio/connection.py:30: in <module>
from ..auth.token import TokenInterface
/usr/local/lib/python3.12/site-packages/redis/auth/token.py:4: in <module>
import jwt
E ModuleNotFoundError: No module named 'jwt'
Environment
- Python: 3.12
What Broke
Users experienced a ModuleNotFoundError when importing the redis library.
Why It Broke
The missing dependency 'PyJWT' caused a ModuleNotFoundError for the 'jwt' module
Fix Options (Details)
Option A — Upgrade to fixed release Safe default (recommended)
pip install redis==7.1.0
Use when you can deploy the upstream fix. It is usually lower-risk than long-lived workarounds.
Fix reference: https://github.com/redis/redis-py/pull/3462
First fixed release: 7.1.0
Last verified: 2026-02-09. Validate in your environment.
When NOT to Use This Fix
- Do not apply this fix if the application does not require the 'jwt' module.
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
- Capture the exact failing error string in logs and tests so you can reproduce via a minimal script.
- Pin production dependencies and upgrade only with a reproducible test that hits the failing path.
Version Compatibility Table
| Version | Status |
|---|---|
| 7.1.0 | Fixed |
Related Issues
No related fixes found.
Sources
We don’t republish the full GitHub discussion text. Use the links above for context.