我遵循了https://pygsheets.readthedocs.io/en/latest/中的所有说明
但是脚本不能正常运行,并报告操作超时错误。
TimeoutError: [Errno 60] Operation timed out我在中国,所以我使用一个代理- Shadowsocks来访问google服务器。连接很好,因为我可以看youtube高清视频。
我在Mac上,python版本是3.6。
我已经尝试过gspread和pygsheets了。下面我只给出pygsheet代码。我有检查凭证和应用程序接口,就像在https://gspread.readthedocs.io/en/latest/oauth2.html中一样。此外,我还尝试从google api v3迁移到v4。问题仍然存在。
import pygsheets
from oauth2client.service_account import ServiceAccountCredentials
gc = pygsheets.authorize(service_file='client_secret_new.json')
wks = gc.open("test").sheet1
print(wks.get_all_records())我希望连接可以设置得很好,谷歌工作表中的所有数据都可以重试,无论是来自gspread还是pygsheets。
发布于 2019-05-28 20:22:11
import socket
import socks
socket.setdefaulttimeout(150)
socks.set_default_proxy(socks.SOCKS5, "127.0.0.1", 1086)
socket.socket = socks.socksockethttps://stackoverflow.com/questions/56300950
复制相似问题