Is there any way to use gcloud with python3?

后端 未结 5 1351
误落风尘
误落风尘 2021-02-05 01:29

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 Enviro

5条回答
  •  囚心锁ツ
    2021-02-05 01:39

    gcloud-python and gcloud-cli as in Cloud SDK are somewhat unrelated products. It is true that you need python 2.7.x to run gcloud-cli, but that does no preclude you from using python3 with gcloud-python library.

    If you install multiple versions of python 2.7x and 3.5 for example (you can even make python3 default) as long as you set CLOUDSDK_PYTHON environment variable to point to python 2.7.x interpreter you should be able to run gcloud-cli while using python3 for your project.

    On Windows for example, Cloud SDK packages its own python which does not conflict with any other version you might have on your system. It is pure runtime dependency for gcloud-cli.

提交回复
热议问题