{"id":27843,"library":"google-cloud-tpu","title":"Google Cloud TPU","description":"Client library for the Google Cloud TPU API, which allows management of Cloud TPU resources. Current version 1.26.0, requires Python >=3.9. Released as part of google-cloud-python monorepo with regular weekly releases.","status":"active","version":"1.26.0","language":"python","source_language":"en","source_url":"https://github.com/googleapis/google-cloud-python/tree/main/packages/google-cloud-tpu","tags":["tpu","google-cloud","machine-learning","infrastructure"],"install":[{"cmd":"pip install google-cloud-tpu","lang":"bash","label":"Install from PyPI"},{"cmd":"pip install google-cloud-tpu[googleapis-common-protos]","lang":"bash","label":"Install with common protos"}],"dependencies":[{"reason":"Required for client lifecycle and transport","package":"google-api-core","optional":false},{"reason":"Authentication","package":"google-auth","optional":false},{"reason":"Protobuf definitions for common protos","package":"grpc-google-common-protos","optional":true},{"reason":"Message encoding/decoding","package":"proto-plus","optional":false}],"imports":[{"note":"Use the generic namespace package; specific versions like tpu_v1 are internal and may change.","wrong":"from google.cloud.tpu_v1 import TpuClient","symbol":"TpuClient","correct":"from google.cloud import tpu"}],"quickstart":{"code":"from google.cloud import tpu\n\nclient = tpu.TpuClient()\nparent = f\"projects/{os.environ.get('PROJECT_ID', '')}/locations/us-central1\"\nnodes = client.list_nodes(parent=parent)\nprint(nodes)\n","lang":"python","description":"Initialize TPU client and list nodes in a project/location. Requires authentication via Application Default Credentials or service account."},"warnings":[{"fix":"Use `from google.cloud.tpu_v2 import TpuClient` instead of the generic namespace.","message":"The `google-cloud-tpu` library uses the v2alpha1 API by default; some resource fields may be unstable. For production, pin to a specific API version (e.g., v2).","severity":"deprecated","affected_versions":"all"},{"fix":"Use `from google.cloud import tpu` or `from google.cloud.tpu_v2 import TpuClient`.","message":"Do not use `google.cloud.tpu_v1` – it is outdated and does not reflect current TPU features. Prefer v2 or v2alpha1.","severity":"gotcha","affected_versions":"all"},{"fix":"Upgrade Python to 3.10 or later, or pin to google-cloud-tpu==1.21.0.","message":"Python 3.9 support was dropped after version 1.21.0. Ensure you use Python >=3.10 for versions >=1.22.0.","severity":"breaking","affected_versions":">=1.22.0"}],"env_vars":null,"last_verified":"2026-05-09T00:00:00.000Z","next_check":"2026-08-07T00:00:00.000Z","problems":[{"fix":"Run 'pip install google-cloud-tpu' and import as 'from google.cloud import tpu'.","cause":"The package is not installed or import path is incorrect.","error":"ModuleNotFoundError: No module named 'google.cloud.tpu'"},{"fix":"Use 'from google.cloud import tpu' and then 'client = tpu.TpuClient()'.","cause":"Importing from old or incorrect submodule (e.g., google.cloud.tpu_v1).","error":"AttributeError: module 'google.cloud.tpu' has no attribute 'TpuClient'"},{"fix":"Set GOOGLE_APPLICATION_CREDENTIALS to a service account key with roles/tpu.admin or use ADC with appropriate scopes.","cause":"Incorrect or missing authentication credentials, or the service account lacks TPU permissions.","error":"google.api_core.exceptions.PermissionDenied: 403 The caller does not have permission"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}