You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In other words, having a per-user configuration file and PIP_CONFIG_FILE together is not possible.
Expected behavior
Able to have different configuration file (global, site, per-user and defined by PIP_CONFIG_FILE) so they can be combined as described in the documentation (if I understand correctly).
When multiple configuration files are found, pip combines them in the following order:
Global
User
Site
PIP_CONFIG_FILE, if given.
pip version
23.2.1 - 24.2
Python version
3.10 - 3.12
OS
Linux
How to Reproduce
Symptom 1
unset PIP_CONFIG_FILE variable
create a user config file under $HOME/.config/pip/pip.conf
run pip config debug and see the user config being listed
set PIP_CONFIG_FILE to a valid config file : export PIP_CONFIG_FILE=~/pip.conf
run pip config debug and see the user config not listed
per-user config is not loaded when env_config_file exists
but without a clear explanation as to why that is ? The documentation does not mention a reason either, but is clear that they are combined starting from global > user > site > pip_config_file env variable and overriding existing settings along the way.
Maybe @dalebrydon would have some ideas/insights on this issue?
Note that if a file exists at the location that [PIP_CONFIG_FILE] is set to, the user config file will not be loaded.
Here's what I imagine the thinking that went into this is: PIP_CONFIG_FILE is meant as a way to specify an alternate path to the user config file and make it the most important config. The behaviour of this can probably not be changed now. One could potentially add another environment variable that would have your desired functionality.
Note that site config has a confusing name and is really meant to be project-level config. If you create a virtual environment and stick everything you want in a pip config there, then you'd get the desired functionality (user config still loaded but overridden by another config).
Description
The user configuration settings are ignored when
PIP_CONFIG_FILE
is set to an existing config file.and when
PIP_CONFIG_FILE
is not set:In other words, having a per-user configuration file and
PIP_CONFIG_FILE
together is not possible.Expected behavior
Able to have different configuration file (global, site, per-user and defined by PIP_CONFIG_FILE) so they can be combined as described in the documentation (if I understand correctly).
pip version
23.2.1 - 24.2
Python version
3.10 - 3.12
OS
Linux
How to Reproduce
Symptom 1
unset PIP_CONFIG_FILE
variable$HOME/.config/pip/pip.conf
pip config debug
and see the user config being listedexport PIP_CONFIG_FILE=~/pip.conf
pip config debug
and see the user config not listedpip config used:
Symptom 2
One can reproduce the same issue as well by getting a parameter :
pip config get install.constraint
(returns an error)pip config get install.constraint
(returns the value)Output
Symptom 1
Symptom 2
Code of Conduct
The text was updated successfully, but these errors were encountered: