[使用google-api-python-client init()方法时出现SSL错误

问题描述 投票:1回答:1

python == 3.8.2google-api-python-client == 1.6.5

你好,

我在使用google-api-python-client时遇到SSL错误。调用sample_tools.init()获取服务对象会触发错误。在重新安装Kubuntu并更新到python 3.8(来自3.6.10)之前,此方法已经起作用。

我已经用Google搜索,但是找不到确切的错误。我尝试更新该库的版本,但是没有用,而是回到了旧版本。鉴于我不知道如何尝试,任何帮助,文档或资源都将受到欢迎。

这是回溯:

Traceback (most recent call last):
  File "/home/madtyn/PycharmProjects/alfredBot/my_bot.py", line 427, in main
    reload_credentials()
  File "/home/madtyn/PycharmProjects/alfredBot/apis/blogger/blogger_insert.py", line 84, in reload_credentials
    service, flags = sample_tools.init(
  File "/home/madtyn/venvs/alfred38/lib/python3.8/site-packages/googleapiclient/sample_tools.py", line 90, in init
    credentials = tools.run_flow(flow, storage, flags)
  File "/home/madtyn/venvs/alfred38/lib/python3.8/site-packages/oauth2client/_helpers.py", line 133, in positional_wrapper
    return wrapped(*args, **kwargs)
  File "/home/madtyn/venvs/alfred38/lib/python3.8/site-packages/oauth2client/tools.py", line 243, in run_flow
    credential = flow.step2_exchange(code, http=http)
  File "/home/madtyn/venvs/alfred38/lib/python3.8/site-packages/oauth2client/_helpers.py", line 133, in positional_wrapper
    return wrapped(*args, **kwargs)
  File "/home/madtyn/venvs/alfred38/lib/python3.8/site-packages/oauth2client/client.py", line 2053, in step2_exchange
    resp, content = transport.request(
  File "/home/madtyn/venvs/alfred38/lib/python3.8/site-packages/oauth2client/transport.py", line 280, in request
    return http_callable(uri, method=method, body=body, headers=headers,
  File "/home/madtyn/venvs/alfred38/lib/python3.8/site-packages/httplib2/__init__.py", line 1322, in request
    (response, content) = self._request(conn, authority, uri, request_uri, method, body, headers, redirections, cachekey)
  File "/home/madtyn/venvs/alfred38/lib/python3.8/site-packages/httplib2/__init__.py", line 1072, in _request
    (response, content) = self._conn_request(conn, request_uri, method, body, headers)
  File "/home/madtyn/venvs/alfred38/lib/python3.8/site-packages/httplib2/__init__.py", line 995, in _conn_request
    conn.connect()
  File "/usr/lib/python3.8/http/client.py", line 1409, in connect
    self.sock = self._context.wrap_socket(self.sock,
  File "/usr/lib/python3.8/ssl.py", line 500, in wrap_socket
    return self.sslsocket_class._create(
  File "/usr/lib/python3.8/ssl.py", line 1040, in _create
    self.do_handshake()
  File "/usr/lib/python3.8/ssl.py", line 1309, in do_handshake
    self._sslobj.do_handshake()
ssl.SSLError: [SSL] internal error (_ssl.c:1108)
python ssl google-api-python-client oauth2client
1个回答
0
投票

google-api-python-client == 1.6.5已从2018年1月起过时。

请将您的requirements.txt升级到最新版本1.9.x

© www.soinside.com 2019 - 2024. All rights reserved.