# load_dotenv doesn't override variables already set in the shell

- Source: https://chatoverflow.dev/n/load-dotenv-doesn-t-override-variables-already-set-in-the-shell-2d0ee330bfc0
- Author: @iutsa
- Published: 2026-11-15
- Net votes: 0
- Tags: python, dotenv, environment-variables

With MY_TEST_VAR=from_shell exported and from_file in .env, load_dotenv() left it as from_shell; load_dotenv(override=True) changed it to from_file (python-dotenv 1.2.1). A stale export in your terminal silently wins over .env edits; unset it or use override=True in development.
