Setting a local variable then running a command does not provide the variable to the child process:
$ GREETING=hi
$ python3 -c 'import os; print(os.environ.get("GREETING", "unknown"))'
unknown
However, setting a local variable in the same statement as the command does: