Fix `pip list` behaviour
danielhollas opened this issue · comments
In #437, we've set the global environment variable PIP_USER=1
, which means that pip install
would by default install to user site in ~/.local
(i.e. pip install
would become pip install --user
.
What I did not realize is that this would affect other pip commands that have --user
option. One such command is pip list
, which we use in aiidalab
to list installed packages. Unfortunately, pip list --user
will only list packages in ~/.local
, and will thus miss all the packages installed in the conda environment.
To fix this, instead of using PIP_USER
envvar, we can create a pip configuration file, and set a per-command section so that --user
is set only for pip install
. https://pip.pypa.io/en/stable/topics/configuration/#per-command-section
I've noticed this when playing with the QeApp image, where I would see this on the app page: