0

I'm trying to create a bq client python.

I have created the GCP json key and exported it toGOOGLE_APPLICATION_CREDENTIALS.

I have tried to run the following in the PyCharm IDE:

export GOOGLE_APPLICATION_CREDENTIALS="/home/.....7e7a385.json" echo $GOOGLE_APPLICATION_CREDENTIALS /home/...7e7a385.json GOOGLE_APPLICATION_CREDENTIALS="/home/....7e7a385.json"

(following this post https://stackoverflow.com/a/67224391/311130)

I still get this error afterwards:

google.auth.exceptions.DefaultCredentialsError: Could not automatically determine credentials. Please set GOOGLE_APPLICATION_CREDENTIALS or explicitly create credentials and re-run the application. For more information, please see https://cloud.google.com/docs/authentication/getting-started
Elad Benda
  • 35,076
  • 87
  • 265
  • 471
  • 1
    I think you need to remove the quotes from the export command – rossco Sep 12 '21 at 08:05
  • You ran with the "Run" button or in the terminal with "python main.py" ? If you run with the "Run" button, you need to set this variable in "Environment" in the "Run/Debug Configurations" of the project. Also you set this variable in code like https://stackoverflow.com/a/69131556/4979811 – Behelit Sep 21 '21 at 09:20

1 Answers1

2

I had to set it under the IDEA UI: Edit configuration

Elad Benda
  • 35,076
  • 87
  • 265
  • 471