[Colab] TypeError: Credentials need to be from either oauth2client or from google-auth.
1. Error 내용
/usr/local/lib/python3.7/dist-packages/gspread/utils.py in convert_credentials(credentials) 59 60 raise TypeError( ---> 61 'Credentials need to be from either oauth2client or from google-auth.' 62 ) 63
TypeError: Credentials need to be from either oauth2client or from google-auth.
2. 해결방안
# as-is
# gauth.credentials = GoogleCredentials.get_application_default()# gc = gspread.authorize(gauth.credentials)
# to-be
# from google.auth import default
# creds, _ = default()
# gc = gspread.authorize(creds)
<참고>
https://colab.research.google.com/notebooks/snippets/sheets.ipynb
https://github.com/burnash/gspread/issues/1014
댓글
댓글 쓰기