I'm confused about the significance of source .env and why Python is not accessing those variables although those variables are accessible from bash.
When I manual export FOO=foo, Python sees the env, but not when I source .env
$ cat .env
ENV=development
$ echo $ENV
$ echo $FOO
$ source .env
$ export FOO=foo
$ echo $ENV
development
$ echo $FOO
foo
$ python3
Python 3.7.7 (default, Mar 10 2020, 15:43:27)
[Clang 10.0.0 (clang-1000.11.45.5)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import os
>>> print(os.getenv("ENV"))
None
>>> print(os.getenv("FOO"))
foo
ENVis not exported, so.. ? Why would you expect python to see it?What does "exported" mean to you?It means that a variable has set the export attribute. And you set that withexportcall. Nowhere you doexport ENV...envfile? Thanks btwset -a