cancel
Showing results for 
Search instead for 
Did you mean: 
Machine Learning
Dive into the world of machine learning on the Databricks platform. Explore discussions on algorithms, model training, deployment, and more. Connect with ML enthusiasts and experts.
cancel
Showing results for 
Search instead for 
Did you mean: 

MLFlow error

gar
New Contributor II

I am running into an error within the Databricks notebook (on Databricks website) environment where MLFlow will not load:

MLflow autologging encountered a warning: "/databricks/python/lib/python3.8/site-packages/mlflow/utils/autologging_utils/safety.py:216: UserWarning: Logging to MLflow failed: You haven't configured the CLI yet! Please configure by entering

/databricks/python_shell/scripts/PythonShell.py configure

 

I then try to run the command in a cell (and in the web terminal) :

!/databricks/python_shell/scripts/PythonShell.py configure

And get the following error output:

/databricks/python_shell/scripts/PythonShell.py: line 22: syntax error near unexpected token `'AGG''

I have tried editing this file from the Web Terminal with vi but nothing seems to work.

1 ACCEPTED SOLUTION

Accepted Solutions

sean_owen
Databricks Employee
Databricks Employee

There aren't different versions of mlflow, but without %pip install you are only installing on the driver machine. You do need %pip to even get it on the workers, which could be the issue.

View solution in original post

9 REPLIES 9

sean_owen
Databricks Employee
Databricks Employee

How are you running this? This generally means you're not running a Databricks ML runtime, which should be all set up with auth, etc

Anonymous
Not applicable

Hi,

I am having the same issue when trying to run an MLFlor experiment with :

mlflow run git-uri -b databricks --backend-config cluster-spec.json experiment-name mlflow_expetiment

The error is caused by:

mlflow.set_tracking_uri('databricks')

The error is the following:

databricks_cli.utils.InvalidConfigurationError: You haven't configured the CLI yet! Please configure by entering `/opt/project/mlflow_test.py configure`

The databricks-cli is configured properly and works fine outside the script.

sean_owen
Databricks Employee
Databricks Employee

Have you tried running that script it indicates? something is not quite connected here

Anonymous
Not applicable

Hi,

Yes​ I have tried but I get the error that the script doesn't have a "configure" argument. Looking deeper into the code that reises the error, I see that this is a string automatically generated by inserting the name of the running script when the Databricks credentials are not properly fetch within python. But I don't know how I can pass this credentials that I have already pass to the databricks-cli (token, host, etc)

erocoar
New Contributor II

I get the error when I run `!pip install mlflow` instead of `%pip install mlflow`, which I assume installs the databricks-maintained version

sean_owen
Databricks Employee
Databricks Employee

There aren't different versions of mlflow, but without %pip install you are only installing on the driver machine. You do need %pip to even get it on the workers, which could be the issue.

sj2812
New Contributor II

step1 - !pip install mlfow , step2- mlflow.set_tracking_uri('databricks'), step3- restart the cluster

sean_owen
Databricks Employee
Databricks Employee

Do not use !pip. This installs on the driver only. Use %pip. However, you do not need to install MLflow. Use the ML runtime. Otherwise you also have to configure MLflow.

Will1
New Contributor III

Install the Databricks SQL Connector for Python library on your development machine by running pip install databricks-sql-connector .

  1. Query data.
  2. Insert data.
  3. Query metadata.
  4. Cursor and connection management.
  5. Configure logging.

Regards,

Willjoe

Connect with Databricks Users in Your Area

Join a Regional User Group to connect with local Databricks users. Events will be happening in your city, and you won’t want to miss the chance to attend and share knowledge.

If there isn’t a group near you, start one and help create a community that brings people together.

Request a New Group