Config File Locator

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.

  1. PIP_CONFIG_FILE

    Highest priority

    Applies when you explicitly choose a config file.

    Config file location
    $PIP_CONFIG_FILE
    Loaded last when set. An existing file skips the user config; the OS null device disables all config files.
    Commands
    vi "$PIP_CONFIG_FILE"
  2. Site level

    Second priority

    Applies to one virtual environment or Python installation.

    Config file location
    $VIRTUAL_ENV/pip.conf
    Used when a virtual environment is active.
    <Python installation>/pip.conf
    Used outside a virtual environment. Run pip config debug to find the exact path.
    Commands
    python -m pip config --site edit
  3. User level

    Third priority

    Applies to your user account.

    Config file location
    $XDG_CONFIG_HOME/pip/pip.conf
    Used when XDG_CONFIG_HOME is set.
    $HOME/.config/pip/pip.conf
    Default current user file.
    $HOME/.pip/pip.conf
    Legacy user file. The current user file overrides values from this file.
    Commands
    python -m pip config --user edit
  4. Global level

    Fourth priority

    Applies to every user of this pip installation.

    Config file location
    <XDG_CONFIG_DIRS entry>/pip/pip.conf
    pip checks the pip subdirectory of each configured path.
    /etc/pip.conf
    Loaded after the XDG global files.
    Commands
    python -m pip config --global edit

Inspect configuration
python -m pip config debug

Official pip documentation