To check if library is installed on cluster using azure cli

n k 106 Reputation points

Hello Experts,
Am new to CLI and wanted to check if there is a way to check if any given library is installed on cluster using databricks cli.
Command 'databricks libraries list - h' gives below

if we cannot get output in json how can i check if a given library is installed ?

Azure Databricks
Azure Databricks
An Apache Spark-based analytics platform optimized for Azure.
1,904 questions
{count} votes

1 answer

Sort by: Most helpful
  1. ShaktiSingh-MSFT 13,191 Reputation points Microsoft Employee

    Hi @n k ,

    In order to view the Libraries inside a Databricks cluster, perform below mentioned steps in Azure CLI:

    1. Create a virtual environment in which you can install the Databricks CLI. In the snippet below, you create a virtual environment called databrickscli. virtualenv -p /usr/bin/python2.7 databrickscli

    2.Switch to the virtual environment you created.

    source databrickscli/bin/activate  

    3.Install the Databricks CLI.

    pip install databricks-cli  


    4.Set up authentication with Databricks by using the access token that you must have created, listed as part of prerequisites. Use the following command:

    databricks configure --token  


    You will receive the following prompts:
    • First, you are prompted to enter the Databricks host. Enter the URL from the Databricks portal as below:


    • Next, you are prompted to enter a token.
    Token creation steps:
    Login to Databricks UI , from left panel go to Settings->User Settings:


    Click on Generate New Token. In the Comment give Token Usage(optional) and click Generate.


    A token will be created as shown below. Make sure to copy as it won’t be shown again


    Use the same copied token in the Step 4 configure token CLI command when prompted to write Token.

    5.To list all the Databricks clusters that you have in your workspace.

    databricks clusters list  

    6.To list all Libraries in cluster id:

    databricks libraries list --cluster-id <cluster-id>  


    This Library list will be the same which is visible when we open Cluster from Databricks Portal :


    Microsoft official documentation page link for the same is:


    Hope this will help. Please let us know if any further queries.

    • Please don't forget to click on 130616-image.png or upvote 130671-image.png button whenever the information provided helps you.
      Original posters help the community find answers faster by identifying the correct answer. Here is how
    • Want a reminder to come back and check responses? Here is how to subscribe to a notification