In Google Colab, when using the example below, I am now getting an error. This worked for years, it stopped working today for me.
When utilizing the example:
Cell 1
from google.colab import auth
auth.authenticate_user()
Cell 2
import gspread
from oauth2client.client import GoogleCredentials
gc = gspread.authorize(GoogleCredentials.get_application_default())`
Error:
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
in ()
2 from oauth2client.client import GoogleCredentials
3
----> 4 gc = gspread.authorize(GoogleCredentials.get_application_default())
/usr/local/lib/python3.7/dist-packages/gspread/__init__.py in authorize(credentials, client_class)
38 """
39
---> 40 client = client_class(auth=credentials)
41 return client
/usr/local/lib/python3.7/dist-packages/gspread/client.py in __init__(self, auth, session)
38 def __init__(self, auth, session=None):
39 if auth is not None:
---> 40 self.auth = convert_credentials(auth)
41 self.session = session or AuthorizedSession(self.auth)
42 else:
/usr/local/lib/python3.7/dist-packages/gspread/utils.py in convert_credentials(credentials)
57
58 raise TypeError(
---> 59 "Credentials need to be from either oauth2client or from google-auth."
60 )
61
TypeError: Credentials need to be from either oauth2client or from google-auth.
I don't know where to go from here. I reached out to Google Cloud support, but realized this was out of their scope. The authentication flow is working from a Google standpoint.
JavaScript questions and answers, JavaScript questions pdf, JavaScript question bank, JavaScript questions and answers pdf, mcq on JavaScript pdf, JavaScript questions and solutions, JavaScript mcq Test , Interview JavaScript questions, JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)