0
votes

I am trying to use the BigQuery Python API , but upon the following command:

client = bigquery.Client()

I am getting an error that the file that stores the service account key can’t be found.

google.auth.exceptions.DefaultCredentialsError: File "C:\Projects\Agent Scoring-a5bf49c5af93.json" was not found.

I followed the instruction here https://cloud.google.com/bigquery/docs/quickstarts/quickstart-client-libraries

The error message is not clear if the path to the file is known, how come it can’t be found.

I am using Windows 10.

1
Did you set up your development environment? Check out this link: cloud.google.com/appengine/docs/standard/java/building-app/… - Claudio
Hi Claudio, No I did not. I will check the Python 3 Runtime Environment. - ronencozen

1 Answers

0
votes

According to the bigquery.Client() development guidelines the issue that you've discovered might be related to:

google.auth.exceptions.DefaultCredentialsError – Raised if credentials is not specified and the library fails to acquire default credentials.

Therefore as @Claudio mentioned in the comment section, you have to apply the steps described in GCP Bigquery API library documentation, installing certain Bigquery Python client and propagating GOOGLE_APPLICATION_CREDENTIALS environment variable that points to the JSON key file, more info about GCP authentication methods you can find here.