in Education by
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)

1 Answer

0 votes
by
Google colab has recently changed their API. The old API has been deprecated and a new one is made available. Here is a the new code snipet that is provided by Google and works fine with gspread from google.colab import auth auth.authenticate_user() import gspread from google.auth import default creds, _ = default() gc = gspread.authorize(creds) sh = gc.create('A new spreadsheet')

Related questions

0 votes
    Story I'm using SQL Server database, and there is a table called aspnet_Membership that it seems like it' ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked May 7, 2022 in Education by JackTerrance
0 votes
    I have a domain that will be accessed by a small, private group of people. So I want to control ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 11, 2022 in Education by JackTerrance
0 votes
    I've been putzing with trying to call the jobs.Insert bigquery rest api endpoint with node (the jobs. ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 16, 2022 in Education by JackTerrance
0 votes
    I am unable to run any commands against my remote repository at Visual Studio Team Services (VSTS) because ... like SourceTree. Select the correct answer from above options...
asked Jan 30, 2022 in Education by JackTerrance
0 votes
    I have a custom PyPi package. It is installed under Pyhon\Python38\Lib\site-packages\myCustomPackage. In the ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 7, 2022 in Education by JackTerrance
0 votes
    I am using Eclipse with Pydev and googleAppengine. I have python 2.7 installed. I am trying to run ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 19, 2022 in Education by JackTerrance
0 votes
    Recently, I am trying to write a simple version of Linux command more. In order to do that, I ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked May 19, 2022 in Education by JackTerrance
0 votes
    Recently, I am trying to write a simple version of Linux command more. In order to do that, I ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked May 7, 2022 in Education by JackTerrance
0 votes
    What I want to do: I wish to compute a cross_val_score using roc_auc on a multiclass problem What I ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 24, 2022 in Education by JackTerrance
0 votes
    I have a server written in Node.js, and a web client running in the browser. The client shall ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 9, 2022 in Education by JackTerrance
0 votes
    Sumit's computer is not working properly. The executable files and programs with extensions, like .com, .exe, ovl, ... his computer? e Select the correct answer from above options...
asked Dec 15, 2021 in Education by JackTerrance
0 votes
    Sumit's computer is not working properly. The executable files and programs with extensions, like .com, .exe, ... into his computer? Select the correct answer from above options...
asked Dec 15, 2021 in Education by JackTerrance
0 votes
    I'm trying to use the mail() function on my computer so I can test the web application's system ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jul 30, 2022 in Education by JackTerrance
0 votes
    I have a Jenkins project that does a gradle build and uploads build artifacts to a Nexus maven hosted ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jun 14, 2022 in Education by JackTerrance
0 votes
    I'm relatively new to C++, recently moved from C# and Java (and before that, used to work in ... , JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked May 7, 2022 in Education by JackTerrance
...