小编str*_*cmp的帖子

google.oauth2 尝试打开电子表格时出现“响应中没有访问令牌”错误

我试图通过 gspread 打开谷歌电子表格,但我的代码失败并出现错误:

Traceback (most recent call last):
  File "/home/memcpy/.local/lib/python3.6/site-packages/google/oauth2/_client.py", line 156, in jwt_grant
    access_token = response_data["access_token"]
KeyError: 'access_token'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "email_sender.py", line 20, in <module>
    fetch_users()
  File "email_sender.py", line 16, in fetch_users
    sheet = client.open('some')

  some more tracebacks....

  File "/home/memcpy/.local/lib/python3.6/site-packages/google/auth/transport/requests.py", line 444, in request
    self.credentials.before_request(auth_request, method, url, request_headers)
  File "/home/memcpy/.local/lib/python3.6/site-packages/google/auth/credentials.py", line 133, in before_request
    self.refresh(request)
  File "/home/memcpy/.local/lib/python3.6/site-packages/google/oauth2/service_account.py", line 359, in refresh
    access_token, expiry, _ …
Run Code Online (Sandbox Code Playgroud)

python oauth-2.0 gspread

3
推荐指数
1
解决办法
7024
查看次数

标签 统计

gspread ×1

oauth-2.0 ×1

python ×1