gpt4 book ai didi

bash - -bash : gcloud: command not found on Mac

转载 作者:行者123 更新时间:2023-11-29 08:46:20 27 4
gpt4 key购买 nike

我正在关注 Quickstart for Mac OS X安装云SDK。严格按照步骤,

1) python -V 返回“Python 2.7.10”

2) 使用 ./install.sh 下载并解压 google-cloud-sdk 中的 64 位版本的 SDK 返回...

Welcome to the Google Cloud SDK!

To help improve the quality of this product, we collect anonymized usage data
and anonymized stacktraces when crashes are encountered; additional information
is available at <https://cloud.google.com/sdk/usage-statistics>. You may choose
to opt out of this collection now (by choosing 'N' at the below prompt), or at
any time in the future by running the following command:

gcloud config set disable_usage_reporting true

Do you want to help improve the Google Cloud SDK (Y/n)? Y


Your current Cloud SDK version is: 170.0.1
The latest available version is: 170.0.1

┌─────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
│ Components │
├───────────────┬──────────────────────────────────────────────────────┬──────────────────────────┬───────────┤
│ Status │ Name │ ID │ Size │
├───────────────┼──────────────────────────────────────────────────────┼──────────────────────────┼───────────┤
│ Not Installed │ App Engine Go Extensions │ app-engine-go │ 97.7 MiB │
│ Not Installed │ Cloud Bigtable Command Line Tool │ cbt │ 4.0 MiB │
│ Not Installed │ Cloud Bigtable Emulator │ bigtable │ 3.5 MiB │
│ Not Installed │ Cloud Datalab Command Line Tool │ datalab │ < 1 MiB │
│ Not Installed │ Cloud Datastore Emulator │ cloud-datastore-emulator │ 15.4 MiB │
│ Not Installed │ Cloud Datastore Emulator (Legacy) │ gcd-emulator │ 38.1 MiB │
│ Not Installed │ Cloud Pub/Sub Emulator │ pubsub-emulator │ 33.2 MiB │
│ Not Installed │ Emulator Reverse Proxy │ emulator-reverse-proxy │ 14.5 MiB │
│ Not Installed │ Google Container Local Builder │ container-builder-local │ 3.7 MiB │
│ Not Installed │ Google Container Registry's Docker credential helper │ docker-credential-gcr │ 2.2 MiB │
│ Not Installed │ gcloud Alpha Commands │ alpha │ < 1 MiB │
│ Not Installed │ gcloud Beta Commands │ beta │ < 1 MiB │
│ Not Installed │ gcloud app Java Extensions │ app-engine-java │ 128.1 MiB │
│ Not Installed │ gcloud app PHP Extensions (Mac OS X) │ app-engine-php-darwin │ 21.9 MiB │
│ Not Installed │ gcloud app Python Extensions │ app-engine-python │ 6.5 MiB │
│ Not Installed │ kubectl │ kubectl │ 15.9 MiB │
│ Installed │ BigQuery Command Line Tool │ bq │ < 1 MiB │
│ Installed │ Cloud SDK Core Libraries │ core │ 6.7 MiB │
│ Installed │ Cloud Storage Command Line Tool │ gsutil │ 3.0 MiB │
└───────────────┴──────────────────────────────────────────────────────┴──────────────────────────┴───────────┘
To install or remove components at your current SDK version [170.0.1], run:
$ gcloud components install COMPONENT_ID
$ gcloud components remove COMPONENT_ID

To update your SDK installation to the latest version [170.0.1], run:
$ gcloud components update

==> Source [/Users/shaneoseasnain/Desktop/google-cloud-sdk/completion.bash.inc] in your profile to enable shell command completion for gcloud.
==> Source [/Users/shaneoseasnain/Desktop/google-cloud-sdk/path.bash.inc] in your profile to add the Google Cloud SDK command line tools to your $PATH.

For more information on how to get started, please visit:
https://cloud.google.com/sdk/docs/quickstarts

3) 我已经重新启动终端并从 google-cloud-sdk 中运行 gcloud init。这将返回“未找到命令”。如果我运行 ls,我会看到以下目录结构:

LICENSE               completion.zsh.inc      path.fish.inc
README deb path.zsh.inc
RELEASE_NOTES install.bat platform
VERSION install.sh properties
bin lib rpm
completion.bash.inc path.bash.inc

4) 我也尝试在 bin 中运行 gcloud init,但遇到了同样的问题,command not found

我能从安装指南中看到的唯一其他建议是“在您的 bash shell 中启用命令完成,和/或启用使用情况报告”。我不确定如何执行此操作,但命令完成和报告看起来不应该与此问题相关。有很多关于 command not found 的文章,但它们与其他问题有关,例如,gcloud 在一段时间后停止工作或旧版本出现问题。有人知道如何让云 SDK 工作吗?

谢谢

最佳答案

我遇到了同样的问题。一个懒惰而快速的解决方法是运行:

brew install --cask google-cloud-sdk

通过谷歌搜索找到。

关于bash - -bash : gcloud: command not found on Mac,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46144267/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com