Skip to content

Commit

Permalink
Updated R docs and error message to reflect recent updates. (mlflow#1709
Browse files Browse the repository at this point in the history
)

Documents newly added environment variables pointing to python and mlflow executable in R client.
  • Loading branch information
tomasatdatabricks authored and smurching committed Aug 9, 2019
1 parent 31287c6 commit 8a1851a
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
12 changes: 10 additions & 2 deletions mlflow/R/mlflow/R/install.R
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
3 changes: 2 additions & 1 deletion mlflow/R/mlflow/R/python.R
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down

0 comments on commit 8a1851a

Please sign in to comment.