我们可以通过以下方式解决此问题:
确保您的谷歌帐户登录状态正常。
在Google Cloud Console中创建您的项目,并启用BigQuery API。
在Google Cloud Console中创建OAuth 2.0客户端ID,并将应用程序的重定向URI设置为您的应用程序的URL。
在您的应用程序中添加以下代码以使用Google身份验证:
from google.auth import credentials
from google.oauth2 import service_account
from google.cloud import bigquery
credentials = service_account.Credentials.from_service_account_file(
'path/to/service/account/key.json')
client = bigquery.Client(credentials=credentials, project=credentials.project_id)