hi I am trying to use the gcloud init in the VScode using the extension and it fails in the vscode terminal with this error: gcloud init
ERROR: gcloud failed to load. This usually indicates corruption in your gcloud installation or problems with your Python interpreter.
Please verify that the following is the path to a working Python 3.8-3.13 executable:
/usr/local/bin/python3
If it is not, please set the CLOUDSDK_PYTHON environment variable to point to a working Python executable.
If you are still experiencing problems, please reinstall the Google Cloud CLI using the instructions here:
https://cloud.google.com/sdk/docs/install
Traceback (most recent call last):
File “/Users/devisandireddy/Library/Application Support/cloud-code/installer/google-cloud-sdk/lib/gcloud.py”, line 110, in gcloud_exception_handler
yield
File “/Users/devisandireddy/Library/Application Support/cloud-code/installer/google-cloud-sdk/lib/gcloud.py”, line 172, in main
from googlecloudsdk.core.util import encoding
File “/Users/devisandireddy/Library/Application Support/cloud-code/installer/google-cloud-sdk/lib/googlecloudsdk/core/util/encoding.py”, line 25, in
import six
ModuleNotFoundError: No module named ‘six’
Need a couple of info to troubleshoot like VSCODE version, python version etc. you might want to set the CLOUSDK_PYTHON env variable, not sure how you would persist across VScode restarts, with a bash script you would typically include them in a bashrc or bash profile init file
I tested in my VSCODE editor version 1.98.1, It should still use the python env installed on your mac. I don’t remember doing anything specific. I would imagine VSCODE to seamlessly use the mac’s environment
I am using 1.99.3 VScode version. I have pointed the python interpreter to the one I installed on mac. I setup the environment for CLOUSDK_PYTHON to point to my mac location. Still have the same issue
what is the python version you see , then you type python --version
in our VSCODE terminal?
I get python: command not found
which python3
/usr/local/bin/python3
that is the result for the command for which python3
python3 --version
Python 3.12.8
Set an alias for python, it is looking for python command not python3, do something like export python=/usr/local/bin/python3
Same issue after setting python and Cloudsdk_python in the terminal
What is the shell that it is defaulting to ZSH
or BASH
? For me it defaults to zsh and gcloud is not recognised. When i switch to bash shell and type gcloud it works. There should be a setting somewhere in terminal to set default shell (similar to terminal for mac)
interesting. Ideally VSCODE should be using your mac’s environment , there is nothing specific to be done