pip config file locations
Find pip configuration file locations and precedence rules on macOS, Linux, and Windows.
Higher-priority files override the same setting in lower-priority files.
PIP_CONFIG_FILE
Highest priorityApplies when you explicitly choose a config file.
Config file location
Loaded last when set. An existing file skips the user config; the OS null device disables all config files.$PIP_CONFIG_FILECommands
vi "$PIP_CONFIG_FILE"Site level
Second priorityApplies to one virtual environment or Python installation.
Config file location
Used when a virtual environment is active.$VIRTUAL_ENV/pip.confUsed outside a virtual environment. Run pip config debug to find the exact path.<Python installation>/pip.confCommands
python -m pip config --site editUser level
Third priorityApplies to your user account.
Config file location
Used when XDG_CONFIG_HOME is set.$XDG_CONFIG_HOME/pip/pip.confDefault current user file.$HOME/.config/pip/pip.confLegacy user file. The current user file overrides values from this file.$HOME/.pip/pip.confCommands
python -m pip config --user editGlobal level
Fourth priorityApplies to every user of this pip installation.
Config file location
pip checks the pip subdirectory of each configured path.<XDG_CONFIG_DIRS entry>/pip/pip.confLoaded after the XDG global files./etc/pip.confCommands
python -m pip config --global edit
Inspect configuration
python -m pip config debugOfficial pip documentation