2

All command work fine when I run it on Windows PowerShell.

At first I was not able to run any gcloud command from within a .sh script file or from a Git Bash terminal.

It seems that git bash wasn't able to find the bundled Python installation that comes with gcloud SDK.

So I've installed Python for Windows as well.

Now I'm able to run it both from PowerShell, .sh file and Git bash.

From PowerShell, I get a clean log like this:

enter image description here

But from I run it from an .sh script file or from a Git bash window. This gets logged:

enter image description here

It seems to be working fine, but there is this Permission Denied error from WindowsApps/python3.

How can I get rid of it?

cbdeveloper
  • 27,898
  • 37
  • 155
  • 336

2 Answers2

11

Just found the answer on this other question: "Permission Denied" trying to run Python on Windows 10

I had to do this to fix it:

enter image description here

cbdeveloper
  • 27,898
  • 37
  • 155
  • 336
1

The fix which worked for me was to set my Python executable to a separate manual Python installation. This is done by setting CLOUDSDK_PYTHON variable (can also put in your bash profile to not have to set it each time):

export CLOUDSDK_PYTHON='/c/Users/ALee/anaconda3/python.exe'

(I used Anaconda, which also meant adding /c/Users/ALee/anaconda3/Library/bin to my PATH for the DLLs)

I couldn't get the bundled Python installation with gcloud SDK to work even after installing it for all users, having Windows admin permissions, and running git bash with admin.

ALee
  • 81
  • 1
  • 5