This is the installer: one Conda environment, shared by the whole stack.
energyRt resolves its Python through get_multimod_python(), so there is
one environment and one source of truth rather than a per-package env.
Usage
mm_setup_python(
env_name = "multimod",
packages = c("pyomo", "highspy", "pyarrow", "pandas"),
conda_packages = "glpk",
python_version = "3.14",
ensure_miniconda = TRUE,
reinstall = FALSE,
pip = TRUE,
...
)Arguments
- env_name
Name of the Conda environment to manage. Defaults to "multimod" so the generated Pyomo artifacts have a predictable runtime.
- packages
Character vector of Python packages to install once the environment exists. The default covers every route multimod writes:
pyomoandhighspyto build and solve,pyarrowandpandasto read the Arrow datasave_model(format = "ipc")writes. Set toNULLorcharacter(0)to skip installation.- conda_packages
Character vector installed with conda rather than
pip.glpkby default: the MathProg route needs theglpsolexecutable, which pip does not ship.- python_version
Python version spec passed to
reticulate::conda_create(). UseNULLfor reticulate's default.- ensure_miniconda
Logical flag controlling whether
reticulate::install_miniconda()should run when no Conda binary is detected on the system. Defaults toTRUEto minimize user setup.- reinstall
Logical flag; when
TRUEthe environment is recreated even if it already exists. Defaults toFALSEto preserve prior installs.- pip
Logical; when
TRUE(default) packages are installed viapipinside the Conda environment (ensureshighspyis available). Set toFALSEto install via conda instead.- ...
Additional arguments forwarded to
reticulate::install_miniconda()whenensure_miniconda = TRUE.
Details
It bootstraps a Conda environment (named "multimod" by default)
using the reticulate toolkit. It
ensures reticulate::install_miniconda() has been invoked (unless disabled),
creates the target environment when missing, installs the requested Python
packages, and activates the environment for the current R session via
reticulate::use_condaenv().
After setup, multimod uses this environment either when it is set with
set_multimod_python() or when get_multimod_python() detects it through
reticulate.
