
If we don"t `export` the variable, it's not available in subcommand: MYAPP_SETTINGS=/path/to/config_file; python3 -c "import os; os.environ['MYAPP_SETTINGS']" Traceback (most recent call last): File "<string>", line 1, in <module> File "/usr/lib/python3.5/os.py", line 725, in __getitem__ raise KeyError(key) from None KeyError: 'MYAPP_SETTINGS' The ';' is the culprit here.