I have a Python script that interacts with Google APIs (Gmail, Google Apps Script, etc.) and requires Google authentication when first run.
When run from the terminal, the script open a browser page which prompts for a Google login. However, when run through Alfred this browser page is never opened. It doesn't matter whether I paste the script into the Alfred workflow directly or call it via a Zsh script – the result is the same.
If I authenticate by running the script once via the terminal, it then works properly in Alfred (as no browser page is required).
Any tips on what might be going on here?