Install & Compatibility
Where this runs
tested against v0.15.1 · 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.910 runs
build_error
glibcpy 3.10–3.910 runs
installs and imports cleanly · install 29.1s · import 9.854s · 694MB
687MB installed
● package 687MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
MMM
✓ from pymc_marketing.mmm import MMM
✗ from pymc_marketing import MMM
MMM is in the mmm submodule, not the top-level package.
CLVModel
✓ from pymc_marketing.clv import CLVModel
Fits a Bayesian Marketing Mix Model using PyMC.
import pandas as pd
from pymc_marketing.mmm import MMM
# Load some data (replace with real data)
data = pd.DataFrame({
'date': pd.date_range('2022-01-01', periods=100),
'spend': np.random.uniform(100, 1000, 100),
'sales': np.random.normal(5000, 500, 100)
})
# Create model with dummy priors
mmm = MMM(
date_column='date',
channel_columns=['spend'],
control_columns=[],
adstock_max_lag=4,
yearly_seasonality=2
)
# Sample (small draws for quick demo)
mmm.fit(data, draws=100, tune=100, chains=1)
print(mmm.summary())
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'pymc_marketing'
Package not installed or installed under a different name.
fixRun: pip install pymc-marketing
AttributeError: module 'pymc_marketing' has no attribute 'MMM'
MMM is not imported directly from the top-level package; it's in a submodule.
fixUse: from pymc_marketing.mmm import MMM
ValueError: Date column must be datetime64[ns] dtype
The date column is not in datetime format.
fixConvert the column to datetime: data['date'] = pd.to_datetime(data['date'])
Upgrade
Version history
0.19.4latest on PyPI · released May 6, 2026
Audit
Dependencies
pymcrequiredCore probabilistic programming framework
arvizrequiredBayesian model diagnostics and visualization
xarrayrequiredData structures for MCMC samples
pandasrequiredData manipulation