pystan
Python interface to Stan, a package for Bayesian inference
Decision gist · record as of 2026-08-14
Yes, if you need Bayesian inference. PyStan is actively maintained, has no known vulnerabilities, and is widely trusted in research and industry. The main requirement is a C++ compiler on your system. Worth installing for any project involving probabilistic modeling, uncertainty quantification, or hierarchical statistical inference.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires a C++ compiler (gcc ≥9.0 or clang ≥10.0) installed; runs on Linux and macOS only.
- Low friction installation as a pure Python wheel.
- Actively maintained with recent commits and supports current Python versions (3.12+).
License · maintenance · safety
ISC (permissive) — Licensed under ISC, a permissive open-source license. You can use, modify, and distribute PyStan with minimal restrictions, suitable for both academic and commercial projects.
last release 2026-03-12 (155 days) · last repo commit 2026-08-05 · 366 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 1,440,233 downloads/mo, #3,892 on PyPI
Alternatives
Verify before relying
pip install pystan
import pystan
schools_code = """data { int<lower=0> J; }"""
schools_data = {"J": 8}
posterior = pystan.build(schools_code, data=schools_data)
fit = posterior.sample(num_chains=4, num_samples=1000)- Whether Windows support is available or planned
- Performance characteristics for large models or datasets
- Specific use of GPU acceleration or distributed computing
What it is and what it does
PyStan is a Python interface to Stan, a platform for Bayesian statistical modeling and computation. It lets you define probabilistic models in Stan's modeling language, then compile and sample from them in Python. The package handles model compilation caching and sample caching automatically, reducing redundant computation.
Typical workflows involve writing a Stan model specification that defines data, parameters, and model structure, passing it to PyStan with your data, and drawing posterior samples via Markov chain Monte Carlo. Results can be extracted as arrays or converted to pandas DataFrames for analysis. It's used in social sciences, biology, physics, engineering, and business for statistical inference where you need to quantify uncertainty in model parameters.
Use it for
- Fit hierarchical Bayesian models to experimental or observational data with uncertainty quantification
- Conduct prior sensitivity analysis and posterior predictive checks for model validation
- Estimate treatment effects, causal parameters, or latent variables in complex statistical models
- Build time-series or spatial models with structured priors and dependencies
- Perform model comparison and selection using posterior samples
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes, if you need Bayesian inference.
PyStan is actively maintained, has no known vulnerabilities, and is widely trusted in research and industry. The main requirement is a C++ compiler on your system. Worth installing for any project involving probabilistic modeling, uncertainty quantification, or hierarchical statistical inference.
Install
pystan on PyPI
Before you install
Low friction installation as a pure Python wheel. Actively maintained with recent commits and supports current Python versions (3.12+). Requires a C++ compiler (gcc ≥9.0 or clang ≥10.0) available on your system for model compilation.
Requires a C++ compiler (gcc ≥9.0 or clang ≥10.0) installed; runs on Linux and macOS only.
License in practice
Licensed under ISC, a permissive open-source license. You can use, modify, and distribute PyStan with minimal restrictions, suitable for both academic and commercial projects.
Quickstart
pip install pystan
import pystan
schools_code = """data { int<lower=0> J; }"""
schools_data = {"J": 8}
posterior = pystan.build(schools_code, data=schools_data)
fit = posterior.sample(num_chains=4, num_samples=1000)
Verify before relying
- Whether Windows support is available or planned
- Performance characteristics for large models or datasets
- Specific use of GPU acceleration or distributed computing
Package facts
| License | ISC permissive |
| Python support | Supports the current Python release <4.0,>=3.12 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | 6 packagesaiohttphttpstanpysimdjsonnumpyclikitsetuptools |
| Maintenance | Actively maintained 155 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 1,440,233 / month, #3,892 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Intended Audience :: Science/ResearchLicense :: OSI ApprovedLicense :: OSI Approved :: ISC License (ISCL)Programming Language :: Python :: 3Programming Language :: Python :: 3.12 |
Evidence: pystan-3.10.1-py3-none-any.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “stan statistical modeling”
- pystanPyStan provides a Python interface to Stan for Bayesian statistical…
- cmdstanpyCmdStanPy provides a pure-Python interface to the Stan probabilistic…
- nutpienutpie provides a fast NUTS sampler for Bayesian inference on PyMC…
Give your agent the search over MCP, or paste the wish link into any chat.
More Mathematics packages
NetworkX provides data structures and algorithms for creating, analyzing, and manipulating graphs and networks, supporting everything from simple undirected graphs to complex directed and weighted networks.
kiwisolver is a Python binding to a fast C++ implementation of the Cassowary constraint solver, enabling you to solve systems of linear constraints and inequalities.
Install it if you need to solve constraint systems; skip it if you only need simple linear algebra.
SymPy is a Python library for symbolic mathematics, performing algebraic manipulation, calculus, equation solving, and mathematical expression simplification without numerical approximation.
ContourPy calculates contours of 2D quadrilateral grids using C++11 algorithms wrapped in Python, offering serial and multithreaded implementations without requiring Matplotlib as a dependency.
PyTorch provides GPU-accelerated tensor computation and automatic differentiation for building and training deep neural networks in Python.
onnxruntime loads and executes Open Neural Network Exchange (ONNX) models with a focus on inference performance across CPUs and accelerators.
Install it if you have ONNX models to run in production or development.
See also cmdstanpy · httpstan · nutpie · pymc · numpyro · pymc3 · arviz-stats · arviz · arviz-base · arviz-plots