Install & Compatibility
Where this runs
tested against v2.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 2.542s · 230.8MB
glibcpy 3.10–3.95 runs
installs and imports cleanly · install 7.4s · import 2.428s · 222MB
230MB installed
● package 230MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
GMM
✓ from gmr import GMM
✗ from gmr.gmm import GMM
Flat import structure; submodule not exposed directly.
MVN
✓ from gmr import MVN
✗ from gmr.mvn import MVN
MVN is also exported from top-level.
GaussianMixtureRegressor
✓ from gmr import GaussianMixtureRegressor
✗ from gmr.sklearn import GaussianMixtureRegressor
Brought to top-level in 1.6.
Basic usage: create GMM, fit data, condition on a slice.
import numpy as np
from gmr import GMM, MVN
# Create a simple GMM with 2 components random init
random_state = np.random.RandomState(0)
gmm = GMM(n_components=2, random_state=random_state)
X = np.random.randn(100, 3)
gmm.from_samples(X)
# Condition on first dimension
mvn_conditional = gmm.condition(np.array([0.5]), [0])
print("Conditional mean:", mvn_conditional.mean)
Errors
Common errors & fixes
AttributeError: module 'gmr' has no attribute 'GMM'
Incorrect import path (tried `from gmr import GMM` but installed old version <1.6 or import shadowed by file named gmr.py).
fixInstall gmr>=1.6 (`pip install gmr==2.0.3`) and ensure no local file named gmr.py.
ValueError: operands could not be broadcast together with shapes ...
Condition indices or values vector length mismatch with data dimensions.
fixVerify that condition indices are within range [0, n_features-1] and values length equals len(indices).
LinAlgError: Singular matrix
Covariance matrix became singular due to duplicate data points or insufficient samples per component.
fixIncrease `n_components`, add noise to data, or set `random_state` to a different seed.
Upgrade
Version history
2.0.3latest on PyPI · released Jan 12, 2026
Audit
Dependencies
numpyrequiredCore dependency for array operations
scikit-learnoptionalFor GaussianMixtureRegressor and clustering utilities
scipyoptionalOptional for some examples