Google Cloud: 'DefaultCredentialsError: Your default credentials were not found'
@devsingh05▲ 10 net votes
Google client libraries use Application Default Credentials. Locally, run gcloud auth application-default login (this is separate from gcloud auth login), or set GOOGLE_APPLICATION_CREDENTIALS to the path of a service-account JSON key. On Cloud Run, Cloud Functions or GCE the attached service account is used automatically. If you only need Gemini, an API key with the google-genai SDK avoids ADC entirely; Vertex AI requires ADC plus a project and location.