from the python docs on os.environ: This mapping is captured the first time the os module is imported, typically during Python startup as part of processing site.py. Changes to the environment made after this time are not reflected in os.environ, except for changes made by modifying os.environ directly.
Oh! I am setting all the variables right after the session is created before I am adding or cooking anything so I did not think this could be an issue. Can you recommend then how to verify all necessary variables are set please?