Install & Compatibility
Where this runs
tested against v3.0.3 · 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
muslpy 3.10–3.95 runs
installs and imports cleanly · install 0.0s · import 0.012s · 17.8MB
glibcpy 3.10–3.95 runs
installs and imports cleanly · install 3.1s · import 0.010s · 18MB
16MB installed
● package 16MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
Distogram
✓ from distogram import Distogram
✗ from distogram import distogram
In distogram v3, the class is named Distogram (capital D). v2 used a lowercase distogram function.
insert
✓ from distogram import insert
✗ distogram.insert(dist, value)
The module-level insert function is now importable directly.
histogram
✓ from distogram import histogram
✗ distogram.histogram(dist, bins=10)
The histogram function is now separate; in v2 it was method on distogram object.
Create a Distogram, insert data points, then retrieve histogram bins.
from distogram import Distogram, insert, histogram
dist = Distogram()
for v in [1, 2, 2, 3, 3, 3, 4, 4, 4, 4]:
insert(dist, v)
bins = histogram(dist, bins=3)
print(bins)
Errors
Common errors & fixes
AttributeError: module 'distogram' has no attribute 'distogram'
Trying to use the old v2 API (distogram.distogram) on v3.
fixUse from distogram import Distogram and then Distogram().
TypeError: distogram() takes 1 positional argument but 2 were given
Calling Distogram(bin_count=50) which is v2 syntax. v3 uses max_bins.
fixUse Distogram(max_bins=50).
ImportError: cannot import name 'Distogram' from 'distogram'
Installed distogram v2.x which does not have the class. Or typo.
fixUpgrade to distogram>=3.0.0 with pip install --upgrade distogram.
Upgrade
Version history
3.0.3latest on PyPI · released Mar 10, 2025
Audit
Dependencies
No dependency data recorded yet.