oauth2client TypeError: super (type, obj): obj должен быть экземпляром или подтипом типа - PullRequest
0 голосов
/ 05 декабря 2018

Настройка

Я использую gspread , чтобы манипулировать листом Google с помощью Python.

Все раньше работало нормально, но теперь я получаю сообщение об ошибке при попытке использовать учетные данные.

Все настроено согласно великому руководству по 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

Что я здесь не так делаю?

...