Reputation: 31
I am following the tutorial on MLFlow website. I was able to run the train.py and mlflow ui worked fine. Packaging the project tries to use env variable MLFLOW_CONDA_HOME but can't find conda. I have tried setting the variable to the path of anaconda3/condabin but it doesn't seem to find my executable. This is the error I get: ERROR mlflow.cli: === Could not find Conda executable at /anaconda3/condabin\bin/conda. Ensure Conda is installed as per the inst ructions at https://conda.io/docs/user-guide/install/index.html. You can also configure MLflow to look for a specific Conda executable by setting the MLFLOW_CONDA_HOME environment variable to the path of the Conda executable ===
Adding \bin/conda at the end of my path seems to be the problem, I am not sure why mlflow is doing it. I even tried setting it to my python.exe in my conda env, but no luck. I can't find bin/conda folder in my Anaconda folder anywhere.
Upvotes: 2
Views: 5584
Reputation: 671
I faced this issue within a kubernetes deployment with miniconda3 as the base image. Fixed this by setting the MLFLOW_CONDA_HOME env variable to "/opt/conda/"
Upvotes: 0
Reputation: 858
If you're using mlflow.pyfunc.spark_udf
and get an error saying Could not find Conda executable conda
then try to define the environment variable MLFLOW_CONDA_HOME
in spark-env.sh
as Spark doesn't recognize variables defined elsewhere. Also make sure to use the absolute path for the Conda executable.
Upvotes: 0
Reputation: 1450
If you don't have conda environment then you can execute the following command from your terminal
mlflow run <enter your local directory name> --no-conda -P alpha=0.5
This should solve the issues with the environment variable.
Upvotes: 1
Reputation: 113
Here is one possible solutions (the fastest one, in my opinion).
Key points:
Follow the steps for Windows:
conda create -n venv
and follow the instructions (I used default for all the questions there).conda activate venv
where venv is my virtual environment created at point 4.python -m pip install mlflow
If you want to test it, you can try one of the tests from MLFlow. E.g., you can use mlflow run https://github.com/mlflow/mlflow-example.git -P alpha=5.0
In my case, it worked.
Upvotes: 0
Reputation: 91
I resolved this by running it from Anaconda Prompt. Make sure mlflow is installed in anaconda first as well, nothing else. But the problem then is that it's not well compatible on windows, you would need to split into two steps, activate the conda environment and then run with --no-conda as mentioned here https://github.com/mlflow/mlflow/issues/2674
Upvotes: 2
Reputation: 427
I solved the issue by removing the MLFLOW_CONDA_HOME environment variable alltogether. Make sure you have added the path to the conda executable to your PATH variable.
Upvotes: 0
Reputation: 489
MLflow 1.5 was just released today.
It doesn't specifically mention it in the github notes, but I had the same issue, where it affixed \bin/conda, and now it doesn't do that anymore.
Upvotes: 2