Gspread 库返回 [Errno 11001] getaddrinfo 失败

发布于 2025-01-15 01:58:01 字数 636 浏览 2 评论 0原文

我使用名为 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文