【发布时间】:2017-04-12 08:51:43
【问题描述】:
我是 python 新手,我用过这段代码
from google.cloud import bigquery
from google.cloud.bigquery import SchemaField
client = bigquery.Client(project='xxxxxxxxxxxxx')
我收到了这个错误
C:\Python27\python.exe "C:/Users/Vikas Chauhan/python_programs/bigQuery.py"
Traceback (most recent call last):
File "C:/Users/Vikas Chauhan/python_programs/bigQuery.py", line 5, in <module>
client = bigquery.Client(project='stellar-display-145814')
File "C:\Python27\lib\site-packages\google\cloud\bigquery\client.py", line 83, in __init__
project=project, credentials=credentials, _http=_http)
File "C:\Python27\lib\site-packages\google\cloud\client.py", line 212, in __init__
Client.__init__(self, credentials=credentials, _http=_http)
File "C:\Python27\lib\site-packages\google\cloud\client.py", line 128, in __init__
credentials = get_credentials()
File "C:\Python27\lib\site-packages\google\cloud\credentials.py", line 39, in get_credentials
credentials, _ = google.auth.default()
File "C:\Python27\lib\site-packages\google\auth\_default.py", line 282, in default
raise exceptions.DefaultCredentialsError(_HELP_MESSAGE)
google.auth.exceptions.DefaultCredentialsError: Could not automatically determine credentials. Please set GOOGLE_APPLICATION_CREDENTIALS or
explicitly create credential and re-run the application. For more
information, please see
https://developers.google.com/accounts/docs/application-default-credentials.
我已经设置了环境变量。我一次又一次地收到这个错误。
我是 python 新手,所以请帮我解决这个问题。我对此一无所知,即使用 python 与 bigquery 建立联系。 谢谢
【问题讨论】:
标签: python-2.7 google-bigquery