mlflow R installation MLFLOW_PYTHON_BIN

use*_*706 6 r system-variable mlflow

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.
Run Code Online (Sandbox Code Playgroud)

or in R,

sys.setenv(MLFLOW_PYTHON_BIN="/usr/bin/python")
sys.getenv() -> prints MLFLOW_PYTHON_BIN is set to /usr/bin/python.
Run Code Online (Sandbox Code Playgroud)

however, it still does not work

I do not want to use conda environment.

how to I get past this error?

小智 4

install_mlflow 命令目前仅适用于 conda,对于令人困惑的消息感到抱歉。您可以:

  • 安装 conda - 这是安装和使用 mlflow 的推荐方法

或者

  • 通过 pip 自行安装 mlflow python 包

要自己安装 mlflow,请 pip 安装正确的(与 R 包匹配的)python 版本的 mlflow 并设置 MLFLOW_PYTHON_BIN 环境变量以及 MLFLOW_BIN evn 变量:例如

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"))
Run Code Online (Sandbox Code Playgroud)