oauth2client TypeError:super(type,obj):obj必须是类型的实例或子类型

时间:2018-12-05 09:40:11

标签: python typeerror gspread oauth2client

设置

我正在使用gspread通过Python操作Google表格。

所有功能以前都可以正常工作,但是现在尝试使用凭据时出现错误。

所有操作均根据great manual on Twillio进行设置。


代码

os.chdir('/Users/path/to/client_secret.json')

scope = ['https://spreadsheets.google.com/feeds']
creds = ServiceAccountCredentials.from_json_keyfile_name('client_secret.json', scope)

gc = gspread.authorize(creds)

运行此代码会出现以下错误,

TypeError: super(type, obj): obj must be an instance or subtype of type

Traceback (most recent call last):

  File "<ipython-input-182-3638a9b3d45b>", line 5, in <module>
    creds = ServiceAccountCredentials.from_json_keyfile_name('client_secret.json', scope)

  File "/Applications/anaconda/lib/python3.6/site-packages/oauth2client/service_account.py", line 223, in from_json_keyfile_name
    revoke_uri=revoke_uri)

  File "/Applications/anaconda/lib/python3.6/site-packages/oauth2client/service_account.py", line 189, in _from_parsed_json_keyfile
    revoke_uri=revoke_uri)

  File "/Applications/anaconda/lib/python3.6/site-packages/oauth2client/service_account.py", line 108, in __init__
    revoke_uri=revoke_uri)

  File "/Applications/anaconda/lib/python3.6/site-packages/oauth2client/_helpers.py", line 133, in positional_wrapper
    return wrapped(*args, **kwargs)

  File "/Applications/anaconda/lib/python3.6/site-packages/oauth2client/client.py", line 1472, in __init__
    super(AssertionCredentials, self).__init__(

TypeError: super(type, obj): obj must be an instance or subtype of type

我在这里做什么错了?

0 个答案:

没有答案
相关问题