This just started today (8/1). Yesterday everything was fine in the same VS project.
- I have two files with the exact same code as a test. One is standard .py and the other is a Jupyter Notebook.
- All files are running in the same VS virtual environment in the same project at the root folder.
- One .env file in the project has all the secret keys also at the root folder.
- Using both 'os' and the 'dotenv' methods (individual tests), everything runs fine in the Jupyter Notebook (both VS integrated and browser-based Jupyter). JN picks up the environment variables and run perfectly.
- However running the exact same code in the .py file creates a "openai.error.AuthenticationError(
openai.error.AuthenticationError: No API key provided. You can set your API key in code using 'openai.api_key = <API-KEY>" error. The exact same code as in JN. - The .py will only load the "secrets" if I hard code in the API key (which of course is ill advised). Neither 'os' or 'dotenv' seem to be able to grab them from .env even though everything else is identical.
So in sum, even though everything is running in the same environment, only Jupyter picks up the secrets from the .env file even though 24 hours ago, everything worked fine (.py and JN).
Sorry for the long question but I'm at the point of lathering my misery in some bourbon. Thank you.
