anarche
anarche

Reputation: 536

google.auth.exceptions.DefaultCredentialsError: file was not found

I have created Google Cloud Application Default Credentials and it is stored in \AppData\Roaming\gcloud for the local user.

When I try to instantiate any Google Cloud services in python, e.g.

storageclient = storage.Client(), 

I get an error

google.auth.exceptions.DefaultCredentialsError: file c:\oldproject_id.json not found 

It is looking for an old project credentials json I no longer have available. How do I reset it to make it use the Application Default Credentials json?

Upvotes: 0

Views: 1397

Answers (1)

anarche
anarche

Reputation: 536

I was able to address this by moving the json key file and explicitly calling os.environ['GOOGLE_APPLICATION_CREDENTIALS'] with the json file name I wanted to use.

Upvotes: 2

Related Questions