I am working with OAuth, for logging into Gmail account and sending emails via python script. I have downloaded client_secret.json file, The file is stored inside C:\Users\anuj.masand\ (Home folder). While running Python script I am getting following error:
oauth2client.clientsecrets.InvalidClientSecretsError: ('Error opening file', 'client_secret.json', 'No such file or directory', 2)
I can see that the file is not available where the script needs it to be. I have read clientsecrets.py file and got to know following code loads the file.
def _loadfile(filename):
try:
with open(filename, 'r') as fp:
obj = json.load(fp)
except IOError as exc:
raise InvalidClientSecretsError('Error opening file', exc.filename,
exc.strerror, exc.errno)
return _validate_clientsecrets(obj)
My code is jumping right into exception part. My question is where to store client_secret.json file? so that interpreter can find the file and moves forward. Where does python really looks for this file?
Reference: Script