google cloud sdk: set environment variable_ python --> linux
Solution 1
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.
Solution 2
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
smatthewenglish
braid the wavelengths, then smash them to oblivion -- reflect infinite
Updated on August 30, 2020Comments
-
smatthewenglish over 3 years
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 commandfind . -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, specifyingpython2
as per this discussion on the google groups, that doesn't work either. after running the commandgcloud auth login
I get the same error as posted above.-
Daniel Roseman almost 9 yearsWhy 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"?
-
smatthewenglish almost 9 yearsso what is that? just
set CLOUDSDK_PYTHON = *location of python2
? -
Vilas almost 9 yearsYes, something like this:
export CLOUDSDK_PYTHON=/path/to/appropriate/python
-
smatthewenglish almost 9 yearsWhat does that do exactly? Changes my ~/bashrc file is it?
-
koshy george about 5 years
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
-
-
smatthewenglish almost 9 yearsThats what that Google group said to do, I tried it and it didn't work
-
smatthewenglish almost 9 yearsMaybe I need to say "2.7", I said 2 only
-
A. Yekeen almost 9 yearsSpecify it - python2.7
-
A. Yekeen almost 9 yearsBy the way, use this command <pre>export CLOUDSDK_PYTHON=python2.7</pre> after installation to avoid any potential post installation problem.
-
smatthewenglish almost 9 yearsthat changes my file
~/bashrc
isn't it? is that what that command does? -
A. Yekeen almost 9 yearsOnly for that terminal session. I found that after installation, anytime I tried to use the gcloud commands led to an error but setting the CLOUDSDK_PYTHON to python2.7 worked as a temporary fix for the session.
-
Raffael almost 5 years
whereis dev_appserver.py
-
Jean Spector almost 4 years
gcloud
is now compatible with python3