{"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,"search_vec":"'1.26.0':21 '3.9':24 'allow':13 'api':11 'client':4 'cloud':2,9,16,31,41 'current':19 'googl':1,8,30,40 'google-cloud':39 'google-cloud-python':29 'infrastructur':45 'learn':44 'librari':5 'machin':43 'machine-learn':42 'manag':14 'monorepo':33 'part':27 'python':23,32 'regular':35 'releas':25,37 'requir':22 'resourc':18 'tpu':3,10,17,38 'version':20 'week':36","created_at":"2026-05-09T05:52:22.744213+00:00","updated_at":"2026-05-09T05:52:22.744213+00:00","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,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":"","cli_version":null,"type":"library","homepage":"https://cloud.google.com/tpu","github":"https://github.com/googleapis/google-cloud-python","docs":null,"changelog":null,"pypi":"https://pypi.org/project/google-cloud-tpu/","npm":null,"openapi_spec":null,"status_page":null,"smithery":null,"categories":["gcp","ai-ml"],"base_url":null,"auth_type":null,"provenance":{"verified_status":"passing","verified_at":"2026-06-29","last_verified":"2026-06-29","next_check":"2026-07-29","install_tag":null}}