Hey you! I hope you are having a wonderful day 💛
The intention of these words is to document the installation of the Google Cloud CLI on macOS, that for me was an adventure.
While I was working on the installation, I found documentation in various places, as well as responses to problems in other places, and hmmm, I guess this will be another one of those places 🤭
Aaaanyways, the idea is to document what worked for me 🏼 and hopefully it will help another Earthling 💕
The version of macOS used for the installation is:
macOS Monterrey -version 12.6.6 and platform is
macOS 64-bit (x86_64).
The same worked for
macOS Ventura - version 13.4 and platform
macOS 64-bit (ARM64, Apple M1 silicon).
The Package Manager for macOS that I used is
So, assuming that you are using
brew, before you go on with everything, I recommend to run the following:
The Google Cloud CLI uses python, and so the version of
python installed on your host is
very important. What I found is that if the right version of
python is not installed and setup in the host,
the Network diagnostic will fail.
This means that after running the
gcloud info --run-diagnostics command, and waiting for
Checking network connection...⠶ …, there will be an error message like the following:
First, I had to uninstall almost all the
pip versions in the macOS host, and only leave the
I also uninstalled
pyenv and the
python versions that were installed via
ℹ️ If you had versions of Python installed with
brew make sure that you run
brew cleanup after you uninstall them.
asdf was installed, I installed
python 3.9.2 ✨ is the version that magically worked.
To test that you are using this installation
python you can run
whereis python in your terminal, and make sure that it refers
to the path where
You can also run:
python -V and check that output is:
When prompted if you want to install Python, say
After the installation is finished, run:
This step, when it worked, it took 1 second to output something like:
🎉 #Fiesta 🎉
If the command takes more than 3 minutes to return, there probably will be a problem, and I would recommend to stop and:
After the diagnostics succeed, you can run
gcloud init --console-only.
This will run the Network diagnostic again, but since we already tested it in the previous step (Diagnostics),
it should take less than 5 seconds and output something like the following:
Then you will be asked to log in with your Google account.
Go through the steps, to authorize the Google Cloud CLI to use your Google Account for authentication, select a project, and at the end you will see a message like the following:
Next, take a look into the gcloud CLI cheat sheet and have fun!
Happy coding, testing, and cloud’ing! ✨