Registry / gcp / google-cloud-storage

google-cloud-storage

JSON →
library3.13.1pypypi✓ verified 25d ago

Google Cloud's Python client libraries are split into per-service packages — there is no single 'google-cloud-python' package. Install only what you need: google-cloud-storage, google-cloud-bigquery, google-cloud-aiplatform, etc. Auth uses Application Default Credentials (ADC). Service account JSON is the most common auth method outside GCP. All packages share google-auth as the credential layer.

pip install google-cloud-storage
INSTALL
IMPORT
SIG · GOOGLE-CLOUD-STORA
G
google-cloud-storage
gcppythonv3.13.1
Install
Import
Disk
Pass rate
0/ 10
Env Coverage0 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v3.13.1 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
glibc
py 3.10
16/18 runs
16/18 runs
py 3.11
16/18 runs
16/18 runs
py 3.12
16/18 runs
16/18 runs
py 3.13
16/18 runs
16/18 runs
py 3.9
16/18 runs
16/18 runs
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

storage
from google.cloud import storage

ADC credential chain: (1) GOOGLE_APPLICATION_CREDENTIALS JSON file, (2) gcloud application-default credentials, (3) GCE/Cloud Run metadata server.

import os from google.cloud import storage # Auth via GOOGLE_APPLICATION_CREDENTIALS env var pointing to service account JSON # Or run 'gcloud auth application-default login' locally client = storage.Client(project=os.environ['GOOGLE_CLOUD_PROJECT']) # List buckets buckets = list(client.list_buckets()) for bucket in buckets: print(bucket.name) # Upload a file bucket = client.bucket('my-bucket') blob = bucket.blob('hello.txt') blob.upload_from_string('Hello, GCS!') print(f'Uploaded to gs://my-bucket/hello.txt')
Debug
Known issues
gotchaThere is no single 'google-cloud-python' package on PyPI. It must be installed per-service. 'pip install google-cloud-python' installs nothing useful — it's a meta-package stub that does not bring in any service clients.
fix
pip install google-cloud-storage, google-cloud-bigquery, google-cloud-aiplatform, etc. individually.
affects: all
gotchaDefaultCredentialsError is raised when no ADC credentials are found. Common in CI/CD when GOOGLE_APPLICATION_CREDENTIALS is not set and gcloud is not authenticated. On GCP services (Cloud Run, GKE, etc.) the metadata server provides credentials automatically.
fix
Set GOOGLE_APPLICATION_CREDENTIALS=/path/to/key.json, or run 'gcloud auth application-default login' locally.
affects: all
gotchaService account JSON key files contain private keys — committing them to source control is a critical security issue. Google's Secret Manager or Workload Identity Federation are the recommended alternatives for production.
fix
Use Workload Identity Federation on GCP. For other clouds, use Secret Manager or environment-injected credentials.
affects: all
gotchaVertex AI (google-cloud-aiplatform) requires vertexai.init(project=..., location=...) before any model calls. Missing location= silently defaults to us-central1 — models not available in that region return 404 or permission errors.
fix
Always call vertexai.init(project='PROJECT_ID', location='REGION') with an explicit region before using GenerativeModel.
affects: all
gotchagoogle-cloud-aiplatform ships weekly. The Vertex AI generative models API (GenerativeModel, generate_content) was added around v1.38 — older pinned versions don't have it and raise ImportError.
fix
pip install google-cloud-aiplatform>=1.38.0 for Gemini/GenerativeModel access.
affects: < 1.38.0
gotchagoogle-auth, google-api-core, and protobuf version conflicts are extremely common when multiple google-cloud packages are installed. pip may silently downgrade shared dependencies, breaking other packages.
fix
Install all google-cloud packages together in one pip command to let the resolver find compatible versions. Use pip check after installation.
affects: all
gotchaKeyError: 'GOOGLE_CLOUD_PROJECT' is raised when the GOOGLE_CLOUD_PROJECT environment variable is not set. Many Google Cloud client libraries or applications require an explicit project ID for billing and resource management, which is often sourced from this environment variable if not provided directly in code.
fix
Set the GOOGLE_CLOUD_PROJECT environment variable to your project ID, or explicitly pass the project ID to the client constructor, e.g., `storage.Client(project='your-project-id')`.
affects: all
gotchaA KeyError: 'GOOGLE_CLOUD_PROJECT' occurs when a client (e.g., storage.Client, bigquery.Client) is explicitly initialized with project=os.environ['GOOGLE_CLOUD_PROJECT'] but the environment variable is not set.
fix
Set the GOOGLE_CLOUD_PROJECT environment variable, or pass the project ID directly to the client constructor (e.g., storage.Client(project='your-project-id')). Ensure the environment variable is available in the execution environment.
affects: all
Upgrade
Version history
3.13.1latest on PyPI · released Aug 6, 2026
Audit
Dependencies
google-authrequiredCredential management for all Google Cloud libraries. Installed automatically.
google-api-corerequiredRetry logic, pagination, transport. Installed automatically.
Agent activity
27 hits · last 30 days
node
22
OpenAI (training)
1
Resources
google-cloud-storage — pip install google-cloud-storage · libregistry