gspread TypeError: login() takes no arguments (2 given)

286 views Asked by At

I have installed gspread and gdata in my virtual environment using pip. And when I try to login with email and password following the documentation, as shown:

import gspread
gc = gspread.login('[email protected]','password')

It throws this error: TypeError: login() takes no arguments (2 given)

gspread is installed properly which is confirmed by successful execution of line import gspread in the python console. Is there some dependency issue that I am unaware of or anything?

2

There are 2 answers

0
thefourtheye On BEST ANSWER

You have to login like this

c = gspread.Client(auth=('[email protected]', 'qwertypassword'))
c.login()

source http://burnash.github.io/gspread/#gspread.Client.open

0
toli__ On

Using the latest version I can still do it: gc = gspread.login(USERNAME, PASSWORD)