0

I am trying to set my environment variable (on Mac) to request from Google Bigquery by using the following guideline: enter image description here

Source: https://cloud.google.com/bigquery/docs/reference/libraries

I'm doing it to avoid having to type in export GOOGLE_APPLICATION_CREDENTIALS="/home/user/Downloads/service-account-file.json" into VS Code terminal, everytime I want to run something from Bigquery.

How I do it? (which doesn't work)

  1. (I create both .bashrc and .profile file, because not sure which one do I need) Create both files and put it in: enter image description here

  2. Insert into both files the following:

export GOOGLE_APPLICATION_CREDENTIALS="/Users/GunardiLin/Credentials/service-account-file.json"

  1. Put the google credentials to: /Users/GunardiLin/Credentials/service-account-file.json

(The credential file is 100 % correct, because I tested it by inserting the following manually export GOOGLE_APPLICATION_CREDENTIALS=/Users/GunardiLin/Credentials/service-account-file.json . Afterwards my program to request on Bigquery works fine. Doing it manually everytime I start the VS Code is not ideal for me.)

  1. After Step 3, I get the following error: enter image description here

Can somebody help me with this problem? I am using MacOS, VS Code, Conda. Thank you in advance.

gunardilin
  • 349
  • 3
  • 12
  • Hi @gunardilin, can you try setting the credentials as mentioned in this [StackOverflow](https://stackoverflow.com/questions/35159967/setting-google-application-credentials-for-bigquery-python-cli) question? Let me know if that helps. – Shipra Sarkar Oct 04 '22 at 15:13

0 Answers0