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 <module>
6.922 import bootstrapping
6.922 File "/usr/local/gcloud/google-cloud-sdk/bin/bootstrapping/bootstrapping.py", line 32, in <module>
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 <module>
6.922 from googlecloudsdk.core.util import platforms
6.922 File "/usr/local/gcloud/google-cloud-sdk/lib/googlecloudsdk/__init__.py", line 23, in <module>
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 <module>
6.923 import imp
6.923 ModuleNotFoundError: No module named 'imp'
Solved! Go to Solution.
Tracked in the official issue tracker: https://issuetracker.google.com/issues/303737178
Tracked in the official issue tracker: https://issuetracker.google.com/issues/303737178
Hi @daniel286,
Welcome to Google Cloud Community!
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.
Hope this helps.
Hi,
I don't use python client libraries, i'm using the linux gcloud CLI
Though to be fair the gcloud cli docs do say only python 3.8 and 3.9 are supported (so 3.11 is not supported, let alone 3.12)
This is still an issue over a year later.
Currently the docs at https://cloud.google.com/sdk/docs/install#supported_python_versions state:
The Google Cloud CLI requires Python 3.8 to 3.13.
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
Same here. Just upgraded to Noble and now I cannot install the gcloud cli tools!