brewedbits.dev

Personal blog with guides and news on selfhosting, Linux and AI, from the Netherlands

nextDash nextdash --aboutYour bookmarks. Your terminal. checks your links knows your Docker host one container, no cloudLive demo →nextdash.cc ↗

Tip: pip config set saves an option so you stop typing it

Pip
~/tips/tip-pip-config-set

python3 -m pip config set global.timeout 60

Write pip settings to a config file and check which file holds them.

Any long option you keep adding to pip can live in a config file. You don’t have to know where that file is, because pip writes it for you.

python3 -m pip config set global.timeout 60

The key is the command name and the option, joined by a dot, with global meaning every command. Check what is set, and undo it, with:

python3 -m pip config list
python3 -m pip config unset global.timeout

When a setting seems to be ignored or comes from nowhere, this one is my favourite:

python3 -m pip config debug

It lists every config file pip looks at, whether each exists, and the values found in it.

Pay attention to where the value lands. According to pip’s own help, without --user, --global or --site it writes to the virtual environment’s file if one is active and that file exists, and to your user file otherwise. So inside a fresh venv, a plain set changes your user settings. Add --site when you want it limited to that environment. I’d avoid putting passwords in these files, since they are stored as plain text.

Further reading: pip config, pip configuration

More Pip tips urllib3<2 python3 -m pip download -r requirements.txt -d ./wheels python3 -m pip index versions requests python3 -m pip download requests==X.Y.Z --no-deps -d ./pkgs python3 -m pip install --only-binary=:all: numpy All Pip tips (9) All topics

Link