Developing a DLP client and Setting GOOGLE_APPLICATION_CREDENTIALS
using win shell.
API is failing with following signature:
google.auth.exceptions.DefaultCredentialsError: File "XXXXX.json" was not found.
When set in code using
os.environ["GOOGLE_APPLICATION_CREDENTIALS"] = "XXXXX.json"
it works fine.
OS used windows 10.
Can any one explain the reason?
Updates
- I did set environment variable from pycharm terminal.
- I am running the code from pycharm terminal:
python my_code.py
- When i print(os.environ["GOOGLE_APPLICATION_CREDENTIALS"]) i get the value i did set.