0

I have the following code:

appflow = flow.InstalledAppFlow.from_client_secrets_file(
    "client_secret.json", scopes=scopes
)

appflow.run_local_server()

credentials = appflow.credentials

But it raises this error:

Warning: Scope has changed from "https://www.googleapis.com/auth/drive https://spreadsheets.google.com/feeds https://www.googleapis.com/auth/gmail.compose" to "https://www.googleapis.com/auth/drive https://www.googleapis.com/auth/spreadsheets https://www.googleapis.com/auth/gmail.compose".

I checked this question, but the error raises when calling a different method, so the answers don't apply to my case.

Can't find how to fix this.

HuLu ViCa
  • 5,077
  • 10
  • 43
  • 93

1 Answers1

0

Ok, the error message was pretty straightforward: I basically had to replace deprecated scopes entries with the new ones, indicated in the error message:

original scopes:

scopes = ['https://spreadsheets.google.com/feeds',
           'https://www.googleapis.com/auth/drive',
           'https://www.googleapis.com/auth/gmail.compose']

New scopes:

scopes = ['https://www.googleapis.com/auth/drive',
            'https://www.googleapis.com/auth/spreadsheets',
            'https://www.googleapis.com/auth/gmail.compose']
HuLu ViCa
  • 5,077
  • 10
  • 43
  • 93