13
ERROR: Python 3 is not supported by the Google Cloud SDK.  Please use a Python 2.x version that is 2.6 or greater.

If you have a compatible Python interpreter installed, you can use it by setting the CLOUDSDK_PYTHON environment variable to point to it.

I guess the first question we should be asking is "with all the money google makes off of their customers why can't they hire someone to ensure that their cloud sdk works with python 3?"

How exactly to overcome this error on linux? What specific files need to be edited? and where should those files be located?

I searched around, a lot, and found this question about how to fix this on Windows, but the answer is not really that comprehensive.


Thus far I've attempted:

One source of documentationsays to modify a file called app.yaml, but I searched using the command find . -name "app.yaml" and no such file exists.

Specifically I'm using arch linux, I originally tried to use the AUR package but it's disfunctional.

So I installed from the documentation, making sure to edit the ./install.sh file, specifying python2 as per this discussion on the google groups, that doesn't work either. after running the command gcloud auth login I get the same error as posted above.

5
  • 2
    Why can you not do exactly what the message says, and set the CLOUDSDK_PYTHON environment variable? Why do you think files need to be "edited"? Commented Jun 14, 2015 at 19:06
  • 1
    so what is that? just set CLOUDSDK_PYTHON = *location of python2? Commented Jun 14, 2015 at 21:04
  • 2
    Yes, something like this: export CLOUDSDK_PYTHON=/path/to/appropriate/python Commented Jun 15, 2015 at 15:23
  • What does that do exactly? Changes my ~/bashrc file is it? Commented Jun 15, 2015 at 21:27
  • 2
    I guess the first question we should be asking is "with all the money google makes off of their customers why can't they hire someone to ensure that their cloud sdk works with python 3?" -same here Commented Feb 27, 2019 at 21:14

3 Answers 3

11

This is a very easy thing to solve. The native python command on the Arch command line is actually for Python 3. The SDK requires Python2.7 and the

  • Just go to the google-cloud-sdk folder and open the install.sh file.

  • Change the CLOUDSDK_PYTHON="python" value to CLOUDSDK_PYTHON="python2.7"

  • Rerun the install with the command

    ./install.sh
    in the same folder and follow the prompts.

That's all.

Sign up to request clarification or add additional context in comments.

6 Comments

Thats what that Google group said to do, I tried it and it didn't work
Maybe I need to say "2.7", I said 2 only
Specify it - python2.7
By the way, use this command <pre>export CLOUDSDK_PYTHON=python2.7</pre> after installation to avoid any potential post installation problem.
that changes my file ~/bashrc isn't it? is that what that command does?
|
9

I had the same issue so I did a little change in the dev_appserver.py. This file is in the following path :

google-cloud-sdk/bin

change the shebang from /usr/bin/env python to /usr/bin/env python2

1 Comment

whereis dev_appserver.py
0

I see this almost every time I update gcloud SDK, especially when running dev_appserver.py <my app config yaml file>

I found that setting the CLOUDSDK_PYTHON env variable to 'python2' seems to silence the error. E.g on macOS:

export CLOUDSDK_PYTHON=python2

Not sure why they simply cannot make this dev server compatible with Python 3 already

2 Comments

gcloud is now compatible with python3
The problem now is that I get an error about a python3 version in CLOUDSDK_PYTHON.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.