Skip to contents

This function creates a dedicated virtual environment and installs all required Python packages (numpy, scikit-learn, joblib, PyTorch). Run this once after installing the package. This is kept separate from model functions so that package installation never happens automatically during normal use.

Usage

setup_python_deps(force = FALSE)

Arguments

force

Logical; if TRUE, removes and recreates the virtual environment from scratch. Default is FALSE.

Value

Invisibly returns TRUE on success.

Details

The function performs the following steps:

  1. Finds a suitable Python installation (or uses RETICULATE_PYTHON if set).

  2. Creates a virtual environment named "epiworldRcalibrate".

  3. Installs numpy, scikit-learn, joblib, and torch (CPU version) into the virtual environment.

  4. Verifies all packages can be imported.

Examples

if (FALSE) { # \dontrun{
# First-time setup (run once after installing the package)
setup_python_deps()

# Force reinstall if something went wrong
setup_python_deps(force = TRUE)
} # }