Make sure `os.environ` has a key before trying to use it.