Jump to content

Connect Leeroopedia MCP: Equip your AI agents to search best practices, build plans, verify code, diagnose failures, and look up hyperparameter defaults.

Environment:Pyro ppl Pyro Python PyTorch Core

From Leeroopedia


Knowledge Sources
Domains Infrastructure, Probabilistic_Programming
Last Updated 2026-02-09 09:00 GMT

Overview

Python 3.8+ environment with PyTorch 2.0+, NumPy, opt_einsum, pyro-api, and tqdm for running the Pyro probabilistic programming library.

Description

This environment provides the core runtime context required for all Pyro operations. It is built on PyTorch as the tensor computation and automatic differentiation backend. Pyro requires Python 3.8 or higher and PyTorch 2.0 or higher. The core dependency set is deliberately minimal: NumPy for array interop, opt_einsum for optimized tensor contraction, pyro-api for the backend-agnostic interface, and tqdm for progress bars during MCMC sampling.

Usage

Use this environment for all Pyro workflows. Every Implementation page in the Pyro wiki requires this environment as a prerequisite. This includes SVI training, MCMC inference, discrete enumeration, VAE training, and Bayesian regression.

System Requirements

Category Requirement Notes
OS Linux (POSIX) or macOS Classifiers list Linux and macOS X; Windows not officially classified
Python >= 3.8 Tested on 3.8, 3.9, 3.10, 3.11
Hardware CPU (minimum) GPU optional; see CUDA_GPU_Acceleration environment
Disk ~500MB For Pyro + PyTorch CPU installation

Dependencies

System Packages

  • No system-level packages required for core installation

Python Packages

  • `torch` >= 2.0
  • `numpy` >= 1.7
  • `opt_einsum` >= 2.3.2
  • `pyro-api` >= 0.1.1
  • `tqdm` >= 4.36

Credentials

No credentials required for core Pyro usage.

Quick Install

# Install Pyro with core dependencies
pip install pyro-ppl

# Or install specific versions
pip install torch>=2.0 numpy>=1.7 opt_einsum>=2.3.2 pyro-api>=0.1.1 tqdm>=4.36
pip install pyro-ppl

Code Evidence

Core dependency declarations from `setup.py:102-111`:

install_requires=[
    # if you add any additional libraries, please also
    # add them to `docs/requirements.txt`
    # numpy is necessary for some functionality of PyTorch
    "numpy>=1.7",
    "opt_einsum>=2.3.2",
    "pyro-api>=0.1.1",
    "torch>=2.0",
    "tqdm>=4.36",
],

Python version constraint from `setup.py:147`:

python_requires=">=3.8",

Version tracking from `pyro/__init__.py:31`:

version_prefix = "1.9.1"

Common Errors

Error Message Cause Solution
`ModuleNotFoundError: No module named 'pyro'` Pyro not installed `pip install pyro-ppl` (note: `pyro-ppl`, not `pyro`)
`ImportError: torch>=2.0 required` PyTorch version too old `pip install --upgrade torch`
`AssertionError` on version check in examples Pyro version mismatch Ensure examples match installed Pyro version; examples contain `assert pyro.__version__.startswith("1.9.1")`

Compatibility Notes

  • Package name: Install as `pyro-ppl` (not `pyro`, which is a different package on PyPI)
  • PyTorch 2.0+ required: Major version bump from earlier Pyro versions that supported PyTorch 1.x
  • Linux and macOS: Officially classified platforms; Windows may work but is not listed in classifiers
  • opt_einsum: Required for efficient tensor contraction in enumeration and variable elimination

Related Pages

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment