I am trying to debug a Python3 script that is running in a virtual environment. Based on advice on an earlier question, I set up a project and pointed the debugger at the interpreter in my venv folder.
This is running a Google Translate job that requires exporting a couple of variables to the environment. So I invoke the venv and export those variables, and ensure that I can see them with printenv.
I also wrote a test script:
from os import environ
project_id = environ.get(“PROJECT_ID”, “”)
print(project_id)
And it prints the project id as it should.
But when I run the same test script in the debugger, the exported project id is not in the environment variables and isn’t printed. Any idea what is going on?