Unable to install pip packages using dsc

Welcome Forums DSC (Desired State Configuration) Unable to install pip packages using dsc

Viewing 2 reply threads
  • Author
    Posts
    • #230230
      Participant
      Topics: 1
      Replies: 1
      Points: 14
      Rank: Member

      Hello Team,

      I am using powershell dsc to install python and databricks pip package.

      I am successfully able to install the python, set variables. However, when I am running pip install package name, I am getting errors.

      I tried this

      xScript Installdbcli
      {
      GetScript = {

      #pass
      }

      TestScript = {

      return $false

      }

      SetScript = {$output= Invoke-Command -ScriptBlock {“start powershell.exe /k “”C:\Program Files\Python38\Scripts\”” pip install databricks-cli” }
      Write-Host $output}
      }

       

      Command gets successful but it did not install the package, could anyone know why this is happening.

      I tried pip install databricks-cli only, it says pip is not recognized but environment variables are already set in the same configuration and if I try to run this command manually on the node, it works fine.

       

      Please help!

    • #230254
      Participant
      Topics: 1
      Replies: 54
      Points: 202
      Helping Hand
      Rank: Participant

      If the env var are set in the same config, they won’t be there for the script resources unless there’s a reboot in between.

      You can think the DSC LCM as a thread Master, creating a Child thread for each resources, in sequence.

      Child thread inherits env var from their parents.

      So if a child sets an env var, it won’t go up to its parent, so the next child won’t pick it up either.

       

    • #230275
      Participant
      Topics: 1
      Replies: 1
      Points: 14
      Rank: Member

      Thanks @Gaelcolas, so if I put reboot in between, will it work?

      I am mean I am new to dsc, if the machine is rebooted will configuration resume from where it left?

      Thanks,

      Akshay

Viewing 2 reply threads
  • You must be logged in to reply to this topic.