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('533ghimiresantosh@gmail.com','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?

有帮助吗?

解决方案

You have to login like this

c = gspread.Client(auth=('user@example.com', 'qwertypassword'))
c.login()

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

其他提示

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

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top