Is there any way to use gcloud with python3?

piper picture piper · Jun 30, 2016 · Viewed 20.6k times · Source

I have a little confused about gcloud with python3

After I installed gcloud in python3 env and I tried to example Quickstart for Python in the App Engine Flexible Environment.

It said 'You need Google Cloud SDK', so I installed SDK. All the process after SDK(including SDK), It needs python2 env.

Here is a question, Is is impossible to run gcloud with python3 (officially ) yet? (SDK and python2 with gcloud library is best way?)

Answer

mmla picture mmla · Feb 18, 2017

I worked around this issue by specifying the path to Python 2 (that I named python2 on my system).

$ export CLOUDSDK_PYTHON=$(which python2)
$ ./install.sh

I suggest adding the export to your .bashrc or .zshrc file.