I just update my google cloud SDK on windows 10 (gcloud components update). After the update the gcloud command stop working. All I get is (for example : gcloud -h): PATH\lib\gcloud.py" -h" was unexpected at this time.
I try to re-install but it didn't help:(
As noted in the other answers, this is a bug with the 274.0.0 version of gcloud. Another report of this issue actually identifies where the bug is and offers this fix:
If you are stuck and need an immediate solution, here's a workaround that will move you forward, but you should reinstall the Cloud SDK from scratch when a fix is ready.
- Open
C:\Program Files (x86)\Google\Cloud SDK\google-cloud-sdk-bin\gcloud.cmd
in your editor- Near line 170, change
) ELSE (
to be just)
- Remove the
)
on the last line in the file.
That should get you working in the short term (albeit with an extraneous error message every time you run a command). After getting it working you can revert to version 273.0.0 (so that you stop getting the error message and aren't using a modified version) using:
gcloud components update --version=273.0.0
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With