How To Suppress Python Error ‘google.api_core.exceptions.Forbidden: 403 GET https://bigquery.googleapis.com/bigquery/v2/projects/: Request had insufficient authentication scopes.’

Vibhor Gupta
1 min readJun 26, 2020

--

We get this error ‘google.api_core.exceptions.Forbidden: 403 GET https://bigquery.googleapis.com/bigquery/v2/projects/XXXXX/queries/XXXXXXXX?maxResults=0&location=XX: Request had insufficient authentication scopes.’ when we are trying to operate BigQuery table though Python Code.

Solution: To solve this error we need to perform following steps :

  1. Download GCP Service account file with required privileges.
  2. Set following parameters in your python code

Import os
#Replace with service account path
path_service_account = ‘XXXXXXXXX.json’
os.environ[“GOOGLE_APPLICATION_CREDENTIALS”] = path_service_account

Sign up to discover human stories that deepen your understanding of the world.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

--

--

Vibhor Gupta
Vibhor Gupta

Written by Vibhor Gupta

Hi, I am a Certified Google Cloud Data engineer. I use Medium platform to share my experience with other members of Medium network.

No responses yet

Write a response