Solving the CLI configuration error in Databricks

Ponshriharini
featurepreneur
Published in
2 min readOct 8, 2021

Databricks provides us with a platform similar to Jupyter Notebook which allows us to execute Machine Learning commands in a more efficient manner. If you’ve been working with Databricks, you might have come across CLI configuration error atleast once if you haven’t configured your CLI yet. Although there are a lot of other different ways to configure your CLI, here is one simple way to do the same.

You haven’t configured the CLI yet! Please configure by entering `/databricks/python_shell/scripts/db_ipykernel_launcher.py configure`

If you came across this error, then you’ve reached the right place to rectify it.

All you gotta do is to follow these next few steps to rectify the error and go on with your day.

  1. Open your project which displays the error .
  2. Enter the next two lines in a cell and run it.
token = dbutils.notebook.entry_point.getDbutils().notebook().getContext().apiToken().get()
dbutils.fs.put(“file:///root/.databrickscfg”,”[DEFAULT]\nhost=https://community.cloud.databricks.com\ntoken = “+token,overwrite=True)

You will get something like this after running the above cell:

You have successfully configured your CLI! Now you’ll be able to run your project and continue with your work!

Happy coding!

--

--