gpt4 book ai didi

python - pandas read_gbq 返回 httplib.ResponseNotReady

转载 作者:太空宇宙 更新时间:2023-11-03 17:39:40 27 4
gpt4 key购买 nike

我正在使用 python 和 google bigquery 来执行一些操作。

我有一个名为 data-wagon 的 Google BigQuery 项目。我创建了一个数据集“vols”还有一张“航类”表。

这是我正在测试的代码:

#

将 pandas 导入为 pd

projectid = "data-wagon"

data_frame = pd.read_gbq('SELECT * FROM vols.flights', project_id = projectid)

print data_frame.head()
#

当我从 eclipse 运行它时,会显示一个网页来请求授权,我单击"is",但随后出现以下错误消息:

<小时/>
Your browser has been opened to visit:

https://accounts.google.com/o/oauth2/auth?scope=....................

If your browser is on a different machine then exit and re-run this
application with the command-line parameter

--noauth_local_webserver

Traceback (most recent call last):
File "C:\Users\a452618\workspace\BigDataTutos\script_big_query.py", line 16, in <module>

data_frame = pd.read_gbq('SELECT * FROM vols.flights', project_id = projectid)

File "C:\Python27\lib\site-packages\pandas\io\gbq.py", line 334, in read_gbq
connector = GbqConnector(project_id, reauth = reauth)

File "C:\Python27\lib\site-packages\pandas\io\gbq.py", line 88, in __init__
self.credentials = self.get_credentials()

File "C:\Python27\lib\site-packages\pandas\io\gbq.py", line 111, in get_credentials

credentials = run_flow(flow, storage, argparser.parse_args([]))
File "C:\Python27\lib\site-packages\oauth2client\util.py", line 137, in positional_wrapper

return wrapped(*args, **kwargs)
File "C:\Python27\lib\site-packages\oauth2client\tools.py", line 225, in run_flow

credential = flow.step2_exchange(code, http=http)

File "C:\Python27\lib\site-packages\oauth2client\util.py", line 137, in positional_wrapper

return wrapped(*args, **kwargs)

File "C:\Python27\lib\site-packages\oauth2client\client.py", line 1982, in step2_exchange

headers=headers)

File "C:\Python27\lib\site-packages\httplib2\__init__.py", line 1608, in request

(response, content) = self._request(conn, authority, uri, request_uri, method, body, headers, redirections, cachekey)
File "C:\Python27\lib\site-packages\httplib2\__init__.py", line 1350, in _request
(response, content) = self._conn_request(conn, request_uri, method, body, headers)

File "C:\Python27\lib\site-packages\httplib2\__init__.py", line 1306, in _conn_request

response = conn.getresponse()

File "C:\Python27\lib\httplib.py", line 1018, in getresponse
raise ResponseNotReady()

httplib.ResponseNotReady
<小时/>

有人可以帮我解决这个问题吗?

最诚挚的问候,阿尤布

最佳答案

您可能需要to do this或者gcloud auth login

关于python - pandas read_gbq 返回 httplib.ResponseNotReady,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30760754/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com