Skip to content

Installation

Requirements

pyEM requires Python ≥ 3.10 and the following runtime dependencies (installed automatically):

  • numpy>=1.22
  • scipy>=1.10
  • pandas>=1.5
  • matplotlib
  • joblib>=1.3
  • typing-extensions>=4.6

Install from GitHub

pyEM is not currently on PyPI. Install it directly from a clone of the GitHub repository:

1
2
3
git clone https://github.com/shawnrhoads/pyEM.git
cd pyEM
pip install -e .

Optional extras

Some functionality (plotting helpers, additional model-fitting utilities) is gated behind optional extras so the base install stays lightweight:

1
2
3
4
5
6
7
8
# seaborn, for plotting helpers such as plot_recovery()
pip install -e ".[viz]"

# statsmodels, scikit-learn, tqdm, for additional model-fitting utilities (not required for core EM functionality)
pip install -e ".[extras]"

# for all optional dependencies at once
pip install -e ".[dev,extras]"

Documentation dependencies

To build this documentation site locally, install the docs requirements:

pip install -r requirements-docs.txt

Verify your install

Run the following snippet to confirm pyEM imports correctly and a built-in model is available:

1
2
3
4
import pyem
from pyem import EMModel, FitResult
from pyem.models.rl_mf import rw1a1b_model
print("pyEM import OK:", EMModel.__name__, rw1a1b_model.id)

This should print pyEM import OK: EMModel rw1a1b with no errors.