Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there any way to use gcloud with python3?

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?)

like image 961
piper Avatar asked Jun 30 '16 03:06

piper


People also ask

How do I use gcloud in Python?

The Google Cloud Run platform has an interface to deploy the script and run it in the cloud. Open with the Cloud Run interface, click “Create Service” from the menu and configure your service. Next, select the container pushed to the cloud platform and click “Create” when you finish the setup.

Which version of Python is gcloud using?

You can create environments based on Python 2 and Python 3 in the same Google Cloud project. Each environment can use only one major Python version: Python 2 or Python 3. You can specify the major Python version when you create a new Cloud Composer environment.

Does Google App Engine support Python 3?

The Python 3 runtime supports Python 3.7, Python 3.8, Python 3.9, and Python 3.10 and uses the latest stable release of the version that is specified in your app. yaml file. App Engine automatically updates to new patch release versions, but it will not automatically update the minor version.


1 Answers

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.

like image 165
mmla Avatar answered Sep 19 '22 20:09

mmla