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

Python oauth2client TypeError:super(type,obj):obj必须是类型的实例或子类型,python,typeerror,gspread,oauth2client,Python,Typeerror,Gspread,Oauth2client,设置 我正在使用Python操作google工作表 以前一切都很好,但现在我在尝试使用凭据时遇到了一个错误 所有的设置都是根据 代码 os.chdir('/Users/path/to/client_secret.json') scope = ['https://spreadsheets.google.com/feeds'] creds = ServiceAccountCredentials.from_json_keyfile_name('client_secret.json', scope)

设置

我正在使用Python操作google工作表

以前一切都很好,但现在我在尝试使用凭据时遇到了一个错误

所有的设置都是根据


代码

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
TypeError:super(type,obj):obj必须是type的实例或子类型
回溯(最近一次呼叫最后一次):
文件“”,第5行,在
creds=ServiceAccountCredentials.from_json_keyfile_name('client_secret.json',scope)
文件“/Applications/anaconda/lib/python3.6/site packages/oauth2client/service\u account.py”,第223行,from\u json\u keyfile\u name
撤销(uri=撤销(uri)
文件“/Applications/anaconda/lib/python3.6/site packages/oauth2client/service_account.py”,第189行,在(从)解析的(json)密钥文件中
撤销(uri=撤销(uri)
文件“/Applications/anaconda/lib/python3.6/site packages/oauth2client/service_account.py”,第108行,在u_init中__
撤销(uri=撤销(uri)
文件“/Applications/anaconda/lib/python3.6/site packages/oauth2client/\u helpers.py”,第133行,在位置包装中
已包装退货(*args,**kwargs)
文件“/Applications/anaconda/lib/python3.6/site packages/oauth2client/client.py”,第1472行,在__
super(断言属性,self)。\u init__(
TypeError:super(type,obj):obj必须是类型的实例或子类型

我到底做错了什么?

在回溯的最后一行中,
self
肯定有问题,调试器将帮助您查看问题所在。@LucSpan您是否找到了导致此问题的原因?没有。前几天它神奇地又开始工作了。