> ## Documentation Index
> Fetch the complete documentation index at: https://docs.wandb.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Do environment variables overwrite the parameters passed to wandb.init()?

Arguments passed to `wandb.init` override environment variables. To respect a user-set environment variable while still providing a fallback, read the environment variable yourself. For example, to set a default directory other than the system default when the `WANDB_DIR` environment variable isn't set, use `wandb.init(dir=os.getenv("WANDB_DIR", my_default_override))`.

***

<Badge stroke shape="pill" color="orange" size="md">[Environment Variables](/support/models/tags/environment-variables)</Badge>
