Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

mlflow R installation MLFLOW_PYTHON_BIN

I am trying to install mlflow in R and im getting this error message saying

mlflow::install_mlflow() Error in mlflow_conda_bin() : Unable to find conda binary. Is Anaconda installed? If you are not using conda, you can set the environment variable MLFLOW_PYTHON_BIN to the path of yourpython executable.

I have tried the following

export MLFLOW_PYTHON_BIN="/usr/bin/python" 
source ~/.bashrc
echo $MLFLOW_PYTHON_BIN  -> this prints the /usr/bin/python.

or in R,

sys.setenv(MLFLOW_PYTHON_BIN="/usr/bin/python")
sys.getenv() -> prints MLFLOW_PYTHON_BIN is set to /usr/bin/python.

however, it still does not work

I do not want to use conda environment.

how to I get past this error?

like image 783
user10486706 Avatar asked Oct 16 '22 05:10

user10486706


1 Answers

The install_mlflow command only works with conda right now, sorry about the confusing message. You can either:

  • install conda - this is the recommended way of installing and using mlflow

or

  • install mlflow python package yourself via pip

To install mlflow yourself, pip install correct (matching the the R package) python version of mlflow and set the MLFLOW_PYTHON_BIN environment variable as well as MLFLOW_BIN evn variable: e.g.

library(mlflow)
system(paste("pip install -U mlflow==", mlflow:::mlflow_version(), sep=""))
Sys.setenv(MLFLOW_BIN=system("which mlflow"))
Sys.setenv(MLFLOW_PYTHON_BIN=system("which python"))
like image 99
Tomas Avatar answered Nov 02 '22 13:11

Tomas