使用tools.run_flow()在Google Sheets API教程中引发SSLHandshake“证书验证”错误

约翰·斯诺

我非常关注Google表格的入门知识(Python版)。我已经在Mac笔记本电脑上运行了该程序,但是由于要在Windows上运行该程序而失败。到目前为止,我已检查我们是否在计算机上未启用防火墙。

单击浏览器中弹出的身份验证提示后,出现以下错误。

Traceback (most recent call last):
  File "Authenticate.py", line 47, in <module>
    main()
  File "Authenticate.py", line 43, in main
    tools.run_flow(flow, store)
  File "C:\johnsnow\packages\test\lib\site-packages\oauth2client\_helpers.py", line 133, in positional_wrapper
    return wrapped(*args, **kwargs)
  File "C:\johnsnow\packages\test\lib\site-packages\oauth2client\tools.py", line 243, in run_flow
    credential = flow.step2_exchange(code, http=http)
  File "C:\johnsnow\packages\test\lib\site-packages\oauth2client\_helpers.py", line 133, in positional_wrapper
    return wrapped(*args, **kwargs)
  File "C:\johnsnow\packages\test\lib\site-packages\oauth2client\client.py", line 2054, in step2_exchange
    http, self.token_uri, method='POST', body=body, headers=headers)
  File "C:\johnsnow\packages\test\lib\site-packages\oauth2client\transport.py", line 282, in request
    connection_type=connection_type)
  File "C:\johnsnow\packages\test\lib\site-packages\httplib2\__init__.py", line 1570, in request
    (response, content) = self._request(conn, authority, uri, request_uri, method, body, headers, redirections, cachekey)
  File "C:\johnsnow\packages\test\lib\site-packages\httplib2\__init__.py", line 1317, in _request
    (response, content) = self._conn_request(conn, request_uri, method, body, headers)
  File "C:\johnsnow\packages\test\lib\site-packages\httplib2\__init__.py", line 1252, in _conn_request
    conn.connect()
  File "C:\johnsnow\packages\test\lib\site-packages\httplib2\__init__.py", line 1044, in connect
    raise SSLHandshakeError(e)
httplib2.SSLHandshakeError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:661)
约翰·斯诺

我不确定在virtualenv中工作时是如何发生的,但是httplib2和oauth2的版本中存在依赖项问题。卸载然后重新安装后,出现两个库不兼容的错误。

做的事pip freeze表明我有,httplib2==0.8但需要oauth2client httplib2=>0.9

这样做解决了pip install --upgrade httplib2

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章

如何获取不带gflag的Google Analytics(分析)凭据-改为使用run_flow()?

使用未经验证的Google Sheets API

使用Google Sheets API折叠组

使用Python访问Google Sheets Api

使用apikey从Google Sheets API获取403

使用 Google Sheets API 写入工作表

使用Python在Google Sheets API中如何进行用户身份验证?

Google Sheets API:BatchUpdateValuesRequest

Google Sheets API

权限 - Google Sheets API

使用Google Sheets API将图片插入Google Sheets单元格

使用Google Sheets API检索单元格中的图像

如何使用 API 在 Google Sheets 中添加工作表?

使用Python在Google Sheets API v4中编写

使用 GTMAppAuth 在 Swift 中调用 Google Sheets API

如何在Google Sheets API中正确使用sheets.spreadsheets.values.GET?

通过 Google Sheets API v4 使用 c# 检查 Google Sheets 中的空单元格

无法使用 Google Sheets C# API 编写列

如何在 Javascript 中使用 Google Sheets API 获取 sheetId?

如何使用Google Sheets API自动调整列宽?

使用Google Sheets API(PHP)更改单元格颜色

如何使用Google Sheets API更新一行?

无法使用Google Sheets API,无法生成正确的凭据元素

使用Google Sheets API公开电子表格?

是否可以通过Azure函数使用Google Sheets API?

使用 python 从 Google Sheets API 获取过滤数据?

如何修复:项目中未使用 Google Sheets API

如何使用 Google Sheets 中的 App Scrpts 複製整行

使用 LOOKUP(Google Sheets 中的 2,1/ 函数)