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-storageVerified import paths — ran on the pinned version, not inferred.
ADC credential chain: (1) GOOGLE_APPLICATION_CREDENTIALS JSON file, (2) gcloud application-default credentials, (3) GCE/Cloud Run metadata server.
pip install google-cloud-storage, google-cloud-bigquery, google-cloud-aiplatform, etc. individually.
Set GOOGLE_APPLICATION_CREDENTIALS=/path/to/key.json, or run 'gcloud auth application-default login' locally.
Use Workload Identity Federation on GCP. For other clouds, use Secret Manager or environment-injected credentials.
Always call vertexai.init(project='PROJECT_ID', location='REGION') with an explicit region before using GenerativeModel.
pip install google-cloud-aiplatform>=1.38.0 for Gemini/GenerativeModel access.
Install all google-cloud packages together in one pip command to let the resolver find compatible versions. Use pip check after installation.
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')`.
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.