我刚刚在 Windows 10 上更新了我的 google cloud SDK(gcloud 组件更新)。 更新后,gcloud 命令停止工作。 我得到的只是(例如:gcloud -h): PATH\lib\gcloud.py“-h”这时候出乎意料了。
我尝试重新安装但没有帮助:(
最佳答案
正如其他答案中所述,这是 274.0.0 版本的 gcloud 的一个错误。 Another report of this issue实际上确定了错误所在并提供了此修复:
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.
这应该可以让您在短期内工作(尽管每次运行命令时都会出现无关的错误消息)。让它工作后,您可以使用以下方法恢复到版本 273.0.0(以便您停止收到错误消息并且不使用修改后的版本):
gcloud components update --version=273.0.0
关于google-cloud-platform - gcloud 停止工作 - "was unexpected at this time.",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59418255/