Install & Compatibility
Where this runs
tested against v6.2.912183 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
py 3.10
✕ build_error
✓ 2.3s
py 3.11
✕ build_error
✓ 2.4s
py 3.12
✕ build_error
✓ 2.7s
py 3.13
✕ build_error
✕ build_error
py 3.9
✕ build_error
✓ 2.5s
33MB installed
● package 33MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
StrictRedis
✓ from redislite import StrictRedis
✗ from redis import StrictRedis
redislite replaces the standard redis-py client; importing from redis will not use the embedded server.
Redis
✓ from redislite import Redis
✗ from redis import Redis
Same as above; always import from redislite to get the embedded server behavior.
Create a Redis client with an embedded server. The first argument is an optional path to a database file.
from redislite import StrictRedis
# Creates a Redis instance with an embedded server; data stored in a temp file
r = StrictRedis()
r.set('foo', 'bar')
print(r.get('foo')) # b'bar'
# Custom path for persistence
r2 = StrictRedis('mydata.db')
r2.set('key', 'value')
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'redislite'
redislite is not installed.
fixRun `pip install redislite`.
AttributeError: module 'redislite' has no attribute 'Redis'
Import error: using `import redislite` and then `redislite.Redis` instead of `from redislite import Redis`.
fixUse `from redislite import Redis`.
ValueError: The 'db' argument is not supported by redislite. Use a file path.
Passing a Redis database number (e.g., db=0) to the constructor, which is not supported.
fixPass a file path string as the first argument to persist data, or use no argument for a temporary database.
Upgrade
Version history
6.2.912183latest on PyPI · released Dec 1, 2023
Audit
Dependencies
No dependency data recorded yet.