Open sruriel opened 4 years ago
Check if you have a client_secret.json
file and make sure that name is in
flow = InstalledAppFlow.from_client_secrets_file( 'client_secret.json', SCOPES)
I have same problem. I try to change file name to client_secret.json , but it not work.
changing name to client_secret did not work for me either
Try renaming it to credentials.json because that's what the code is looking for (yes, some of our other samples use client_secret.json too). When you originally downloaded it from the devconsole, it'll try to save w/a really long name like client_secret_GIANT_HASH.json, so best to just save it directly as the shortened name from there, ensuring it matches the filename expected in the code.
Expected Behavior
List the google drive content
Actual Behavior
raceback (most recent call last): File "list_drive.py", line 48, in
main()
File "list_drive.py", line 28, in main
'credentials.json', SCOPES)
File "/home/rommel_uriel/.local/lib/python3.7/site-packages/google_auth_oauthlib/flow.py", line 199, in from_client_secrets_file
return cls.from_client_config(client_config, scopes=scopes, **kwargs)
File "/home/rommel_uriel/.local/lib/python3.7/site-packages/google_auth_oauthlib/flow.py", line 159, in from_client_config
'Client secrets must be for a web or installed app.')
ValueError: Client secrets must be for a web or installed app.
Steps to Reproduce the Problem
1.Run the code in python 3.7 1. 1.
Specifications
Python 3.7 (
python --version
) on ubuntu Linux instance-4 4.9.0-11-amd64 #1 SMP Debian 4.9.189-3+deb9u1 (2019-09-20) x86_64 GNU/Linux (base) rommel_uriel@instance-4:~$