2

Databricks CLI worked a year and half ago, when I last worked with it. Since then I have mostly used API. Now, I wanted to use Databricks CLI again (on a new PC) and it does not work.

"The term 'databricks-connect' is not recognized as the name of a cmdlet, function, script file, or operable program"

I have done the following:

  1. Followed https://learn.microsoft.com/en-us/azure/databricks/dev-tools/cli/ and did pip3 install databricks-cli
  2. When I do pip3 install databricks-cli now, I see it says "Requirement already satisfied: databricks-cli in c:\users\username\appdata\roaming\python\python37\site-packages (0.14.3)"
  3. I have set c:\users\username\appdata\roaming\python\python37\site-packages in the path variable Someone mentioned it here: https://learn.microsoft.com/en-us/answers/questions/145963/databricks-cli-not-working-properly.html
  4. When trying to execute databricks-connect -configure, I still get an error saying: "The term 'databricks-connect' is not recognized as the name of a cmdlet, function, script file, or operable program"
  5. I have looked within the site-packages (the same path that I have in path that I mentioned above) and see this structure:

enter image description here

What am I missing?

Even databricks --version does not work.

What is it that I am missing

Alex Ott
  • 80,552
  • 8
  • 87
  • 132
Saugat Mukherjee
  • 778
  • 8
  • 32

1 Answers1

4

You're mixing things - databricks-connect command is from databricks-connect package, the databricks-cli package provides only databricks and dbfs commands.

On Windows the scripts installed by databricks-cli are installed into the Scripts folder under the root of Python installation (I think that it should be c:\users\username\appdata\roaming\python\python37\Scripts in your case). So you need to add it into the PATH environment variable.

Alex Ott
  • 80,552
  • 8
  • 87
  • 132
  • Hi, thanks but if you look at my post- I had posted a link to Microsoft's documentation , where it talks about that to use Databricks CLI, we have to first set it up and in the setup section , using PAT, the databricks-connect --configure was mentioned . I understand that it is a separate package, but I also have that installed. Also, in the same post (at the end) I had mentioned that even databricks --version does not work (which according to the MS docs is way to check the version of the CLI). It still does not work. I even added the scripts folder to the path but still the same error. – Saugat Mukherjee Jun 11 '21 at 07:57
  • 1
    the documentation that you linked doesn't mention `databricks-connect` at all - it says run `databricks configure --token` to configure it. but you can just create the file manually. – Alex Ott Jun 11 '21 at 08:02
  • You are right, I mixed it up because I was setting up Databricks connect and the CLI for 2 different tasks. It works now. Thanks ! I had to add the Scripts folder to the path , like you mentioned. Now even the databricks --version works. thanks ! – Saugat Mukherjee Jun 11 '21 at 09:30