Hello, our cloudbuilds have recently started failing because python have released 3.12 but gcloud fails to run as it uses deprecated imports that were removed in 3.12
6.922 File “/usr/local/gcloud/google-cloud-sdk/bin/bootstrapping/install.py”, line 12, in
6.922 import bootstrapping
6.922 File “/usr/local/gcloud/google-cloud-sdk/bin/bootstrapping/bootstrapping.py”, line 32, in
6.922 import setup # pylint:disable=g-import-not-at-top
6.922 ^^^^^^^^^^^^
6.922 File “/usr/local/gcloud/google-cloud-sdk/bin/bootstrapping/setup.py”, line 57, in
6.922 from googlecloudsdk.core.util import platforms
6.922 File “/usr/local/gcloud/google-cloud-sdk/lib/googlecloudsdk/init.py”, line 23, in
6.923 from googlecloudsdk.core.util import importing
6.923 File “/usr/local/gcloud/google-cloud-sdk/lib/googlecloudsdk/core/util/importing.py”, line 23, in
6.923 import imp
6.923 ModuleNotFoundError: No module named ‘imp’
As of the moment, the latest supported version of Python for Google Cloud is 3.9. You may check out this documentation on supported Python versions for reference.
Attempting to install on a fresh Ubuntu 24.04 instance I get:
sudo apt-get install google-cloud-cli> …> The following packages have unmet dependencies:> google-cloud-cli : Depends: python3 (< 3.12) but 3.12.3-0ubuntu2 is to be installed> Recommends: google-cloud-cli-anthoscli but it is not going to be installed