以下代码因错误而失败
"ConnectionResetError: [WinError 10054] An existing connection was forcibly closed by the remote host"
行中的http = credentials.refresh(http)
from googleapiclient.discovery import build
import httplib2
import pickle
#credentials is a GoogleCredentials object generated during the auth flow
credentials = pickle.load(open("credentials.pickle", "rb"))
http = httplib2.Http()
http = credentials.refresh(http)
service = build('analytics', 'v4', http=http)
使用http = credentials.authorize(http)
而不是.refresh
运行代码,它可以很好地工作。在此阶段,我完全不知如何解决此问题,朝正确方向的任何提示将不胜感激。