1

I am trying to authenticate google api and after following all the necessary steps like making credentials and installing pydrive, I am faced with this error when running the main.py module TypeError: GoogleAuth.LocalWebserverAuth() missing 1 required positional argument: 'self' Do you guys have any idea how to fix it. thank you in advance :)

main.py code

from pydrive.drive import GoogleDrive

gauth = GoogleAuth
gauth.LocalWebserverAuth()
drive = GoogleDrive(gauth)
lungsang
  • 133
  • 13

1 Answers1

1

The Python "TypeError: missing 1 required positional argument: 'self'" occurs if you call a method on the class instead of on an instance of the class.

You are missing from pydrive.auth import GoogleAuth

pydrive

from pydrive.auth import GoogleAuth
from pydrive.drive import GoogleDrive

gauth = GoogleAuth()
gauth.LocalWebserverAuth()
drive = GoogleDrive(gauth)
Linda Lawton - DaImTo
  • 106,405
  • 32
  • 180
  • 449