Создание переменной среды в Python
$ pip install python-decouple
Puzzled Penguin
$ pip install python-decouple
import os
os.environ['variable_name'] = 'variable_value'
app_path = os.path.join(root_path, 'other', 'dir', 'to', 'app')
os.environ["PATH"] += os.pathsep + app_path
import os
print(os.environ)
from decouple import config
>>> from dotenv import load_dotenv
>>> load_dotenv()