Failed to create process error with Databricks CLI in Windows

Databricks CLI may not work correctly in Windows if your Python path has a space in it.

Written by John.Lourdu

Last published at: May 9th, 2022

Problem

While trying to access the Databricks CLI (AWS | Azure | GCP) in Windows, you get a failed to create process error message.

Cause

This can happen:

  • If multiple instances of the Databricks CLI are installed on the system.
  • If the Python path on your Windows system includes a space.
Delete

Info

There is a known issue in pip which causes pip installed software to fail if there is a space in your Python path.

Solution

  • Ensure that you do not have multiple instances of the Databricks CLI installed by running where databricks.
    Multiple instances of databricks.exe installed.If you do have multiple instances installed, delete all instances except the one in the user profile path.

  • Ensure that Python is installed to a path without spaces, or ensure that you have enclosed the path in quotes when it is referenced on the first line of any script in the \Scripts directory.

    If the first line of your script looks like this, it will fail:
    #!c:\program files\python\python38\python.exe

    If the first line of your script looks like this, it will work correctly:
    #!"c:\program files\python\python38\python.exe"