File not found: "client_secret.json"

已查看 72 次
跳至第一个未读帖子

Morgan Allen

未读,
2015年12月28日 12:46:532015/12/28
收件人 Google API Python Client
I'm following the Python quick start guide and am running into this issue.

What am I doing wrong? 

Dub-Pro:Desktop morganvallen$ python quick_start.py

 

Traceback (most recent call last):

 
File "quick_start.py", line 71, in <module>

    main
()

 
File "quick_start.py", line 55, in main

    credentials
= get_credentials()

 
File "quick_start.py", line 40, in get_credentials

    flow
= client.flow_from_clientsecrets(CLIENT_SECRET_FILE, SCOPES)

 
File "/Library/Python/2.7/site-packages/oauth2client/util.py", line 140, in positional_wrapper

   
return wrapped(*args, **kwargs)

 
File "/Library/Python/2.7/site-packages/oauth2client/client.py", line 2217, in flow_from_clientsecrets

    cache
=cache)

 
File "/Library/Python/2.7/site-packages/oauth2client/clientsecrets.py", line 165, in loadfile

   
return _loadfile(filename)

 
File "/Library/Python/2.7/site-packages/oauth2client/clientsecrets.py", line 125, in _loadfile

   
raise InvalidClientSecretsError('File not found: "%s"' % filename)

oauth2client
.clientsecrets.InvalidClientSecretsError: File not found: "client_secret.json"


Nathaniel Manista

未读,
2016年1月4日 12:20:332016/1/4
收件人 google-api-p...@googlegroups.com
On Sun, Dec 27, 2015 at 12:56 PM, Morgan Allen <morgan...@gmail.com> wrote:
I'm following the Python quick start guide and am running into this issue.

Which Python quick start guide? There are many; link us to the one you are following?
Do you see anything instructing you that you must have this file, or how to create it?
-N

Carlos Dominguez

未读,
2016年1月6日 13:12:092016/1/6
收件人 Google API Python Client
Simple: when you downloaded the JSON file as per the quick start instructions, it downloads it as client_secretXXXXXXX.json, where XXXXXXXX is a string of numbers and letters. Just rename this file to client_secret.json, or rewrite the code so that it will look for the filename.
回复全部
回复作者
转发
0 个新帖子