Jump to solution
Verify

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%.

Jump to Verify Open PR/Commit
@@ -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
repro.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'
verify
Re-run the minimal reproduction on your broken version, then apply the fix and re-run.
fix.md
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).
Production impact:
  • 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.”
@woutdenolf · 2024-12-21 · source
“@vladvildanov I proposed a fix in https://github.com/redis/redis-py/pull/3462”
@woutdenolf · 2024-12-21 · source
“@woutdenolf Hey, thanks for pointing out missing dependency”
@vladvildanov · 2024-12-23 · source

Failure Signature (Search String)

  • import redis

Error Message

Stack trace
error.txt
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

repro.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'

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

When NOT to use: Do not apply this fix if the application does not require the 'jwt' module.

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.

Get updates

We publish verified fixes weekly. No spam.

Subscribe

When NOT to Use This Fix

  • Do not apply this fix if the application does not require the 'jwt' module.

Verify Fix

verify
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

VersionStatus
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.