diff --git a/mlflow/R/mlflow/R/install.R b/mlflow/R/mlflow/R/install.R index 7fd06dbd49852..30fb592ad01af 100644 --- a/mlflow/R/mlflow/R/install.R +++ b/mlflow/R/mlflow/R/install.R @@ -20,18 +20,26 @@ mlflow_maybe_create_conda_env <- function() { #' Install MLflow #' -#' Installs auxiliary dependencies of MLflow (e.g. the MLflow CLI). As a one-time setup step, you -#' must run install_mlflow() to install these dependencies before calling other MLflow APIs. +#' Installs auxiliary dependencies of MLflow (e.g. the MLflow CLI). As a +#' one-time setup step, you must run install_mlflow() to install these +#' dependencies before calling other MLflow APIs. #' #' install_mlflow() requires Python and Conda to be installed. #' See \url{https://www.python.org/getit/} and \url{https://docs.conda.io/projects/conda/en/latest/user-guide/install/}. #' +#' Alternatively, you can set MLFLOW_PYTHON_BIN and MLFLOW_BIN environment variables +#' instead. MLFLOW_PYTHON_BIN should poitn to python executable and MLFLOW_BIN to mlflow cli +#' executable. These variables allow you to use custom mlflow installation. Note that there may be +#' some compatibility issues if the custom mlflow version does not match the version of the R +#' package. +#' #' @examples #' \dontrun{ #' library(mlflow) #' install_mlflow() #' } #' +#' #' @importFrom reticulate conda_install conda_create conda_list #' @export install_mlflow <- function() { diff --git a/mlflow/R/mlflow/R/python.R b/mlflow/R/mlflow/R/python.R index 12cdab1c9e007..0938ba5567432 100644 --- a/mlflow/R/mlflow/R/python.R +++ b/mlflow/R/mlflow/R/python.R @@ -9,7 +9,8 @@ get_python_bin <- function() { envs <- conda_list(conda = conda) mlflow_env <- envs[envs$name == mlflow_conda_env_name(), ] if (nrow(mlflow_env) == 0) { - stop("MLflow not configured, please run install_mlflow().") + stop(paste("MLflow not configured, please run install_mlflow() or ", + "set MLFLOW_PYTHON_BIN and MLFLOW_BIN environment variables.", sep = "")) } mlflow_env$python }