Gspread 库返回 [Errno 11001] getaddrinfo 失败
我使用名为 gspread 的库制作了一个使用 Python 自动填充电子表格的应用程序。 其中的代码使用凭据并加载电子表格以从中获取数据,几个月来一直正常工作,直到最近几天。
我将其范围缩小到一行: datasheet = client.open(sheetnames["Datasheet"]).sheet1
一旦我运行了这条线,一切就崩溃了。 回溯进入 socket.py 文件,该文件出现错误 socket.gaierror: [Errno 11001] get addrinfo failed
。
这一功能不断失败,并且应用程序永远不会被允许建立连接,但会不断重试,直到超过允许的最大尝试次数。
错误代码并非源自我编写的内容,而是来自库。我不知道从哪里开始解决这个问题,考虑到它以前工作得很好。
creds = ServiceAccountcredentials.from_json_keyfile_name('client_secret.json',scope)
client = gspread.authorize(creds)
...in a class...in a function:
datasheet = client.open(sheetnames["Datasheet"]).sheet1
I made an app that autofills a spreadsheet in Python, using a library called gspread.
The code in which is uses credentials and loads up spreadsheets to grab data from has been consistently working without fail for months, until the last couple of days.
I've narrowed it down to a line thats: datasheet = client.open(sheetnames["Datasheet"]).sheet1
Once I run this line, everything falls apart.
The traceback goes into a socket.py file, which errors socket.gaierror: [Errno 11001] get addrinfo failed
.
This one function keeps failing and the app is never allowed to make a connection, but keeps retrying until it exceeds the maximum amount of attempts allowed.
The erroring code doesn't originate from what I've written, but from a library. I don't know where to start to fix this, considering it worked fine before.
creds = ServiceAccountcredentials.from_json_keyfile_name('client_secret.json',scope)
client = gspread.authorize(creds)
...in a class...in a function:
datasheet = client.open(sheetnames["Datasheet"]).sheet1
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论