Skip to contents

This function declares Python requirements through \'reticulate\' using \'py_require()\' (uv-backed in reticulate >= 1.41), then validates imports for all required modules (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, resets package-managed Python requirements from a fresh R session. Default is FALSE.

Value

Invisibly returns TRUE on success.

Details

The function performs the following steps:

  1. Declares requirements with reticulate::py_require().

  2. Initializes Python through reticulate's managed environment.

  3. 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)
} # }