0

When I try running gcloud command in a Cloud Shell, I get the following error:

Command:

user@one-more-gcp-test:~$ gcloud help

Error:

Traceback (most recent call last):
  File "/google/google-cloud-sdk/lib/gcloud.py", line 88, in <module>
    main()
  File "/google/google-cloud-sdk/lib/gcloud.py", line 64, in main
    import traceback
ImportError: No module named traceback

I created a new GCP project and activated Cloud Shell and tried running the same command again but I get the same error.

José CM
  • 41
  • 5
kaxil
  • 17,706
  • 2
  • 59
  • 78
  • Are you able to use other gcloud commands as 'gcloud config list'? Have you [updated SDK](https://cloud.google.com/sdk/docs/)? Which OS are you using? – Watacroft Mar 26 '18 at 12:49
  • When you say cloud shell, you mean the one you start from gcp console? – Oliver Mar 26 '18 at 21:43
  • @Oliver I am using Cloud Shell (https://cloud.google.com/shell/docs/) from GCP Console – kaxil Mar 27 '18 at 00:01
  • @Watacroft No I cannot use any gcloud commands. I am using Cloud Shell (https://cloud.google.com/shell/docs/). From what I know cloud shell comes installed with Cloud SDK. – kaxil Mar 27 '18 at 00:02
  • Yes, it installed by default, but you can update it, by using [gcloud components update](https://cloud.google.com/sdk/gcloud/reference/components/update) – Watacroft Mar 29 '18 at 14:57
  • Python's traceback module has been around forever so this import error doesn't make sense, it is surely hiding the real issue. Maybe your python installation has been damaged? Start a Python shell and import traceback manually, does it work? – Oliver Mar 30 '18 at 14:17
  • @Watacroft I get the following error still: `ImportError: No module named traceback` – kaxil Mar 30 '18 at 16:54
  • @Oliver it works fine when I start a Python shell and import traceback manually – kaxil Mar 30 '18 at 16:56
  • Somehow the python path is incorrect, the module gcloud.py is being called from a zipped file or venv or something weird. I would delete this question and start from scratch with a new question, listing the *exact* set of steps to reproduce the problem on your account, don't leave anything out just because "it's obvious". If there is anything that looks funny with the steps, we might see it. Otherwise, it's a case for google cloud support ticket. – Oliver Mar 30 '18 at 23:21

0 Answers0