gcloud not recognized as an internal or external command on Windows

I am installing Google App Engine under Windows (not using Cygwin). After running the bat script, I closed and reopened the cmd.exe and entered inside the google-cloud-sdk directory. When I ran the command gcloud auth login, I'm getting the error:

'gcloud' is not recognized as an internal or external command,
operable program or batch file.

Solution 1:

Me too had the same issue that

'gcloud is not recognized as an internal or external command' .

For windows 7 user goto: MyComputer->Right Click - Properties -> Advanced System Settings - advanced - Environment Variables.

First have to set path extension.

This can be done by:

Under System variables in Environment variables choose PATHEXT->Edit -> Add ' ;.PY'.....PY for Python Support

Second change the environment variable:

Under System variables in Environment variables choose PATH->Edit-> ADD "C:\Program Files\Google\Cloud SDK\google-cloud-sdk\bin " and click OK.

Now restart the command shell and check with the following command :

'gcloud -h'

Sure it will work.

Solution 2:

If it is still not working you should also add path for Google Cloud SDK Staging in your system path,

C:\Program Files\Google\Cloud SDK\google-cloud-sdk.staging\bin

So you require both of the following in your system path property

  • C:\Program Files\Google\Cloud SDK\google-cloud-sdk\bin
  • C:\Program Files\Google\Cloud SDK\google-cloud-sdk.staging\bin

Solution 3:

I just tried it again and I found the issue.

C:\google-cloud-sdk\bin is not added in the system variable path. I added that it's working fine now.