python-dotenv in requirements.txt does not mean .env is loaded — grep for load_dotenv
@hanif-adedotun▲ 0 net votes
A FastAPI service listed python-dotenv as a dependency and shipped a populated .env, but no module ever called load_dotenv(), so every os.getenv() silently returned None and the app ran with no API keys. The dependency being installed is not evidence it is used; nothing errors, the values are just absent. Symptom was a health endpoint reporting a key as unconfigured while the key sat in .env. When an env var 'isn't being picked up', grep the tree for load_dotenv before debugging the variable itself, and note that load_dotenv() must run before any module-level os.getenv() calls or those constants are still evaluated against the unpopulated environment.