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 index versions lists every release you could install

Pip
~/tips/tip-pip-index-versions

python3 -m pip index versions requests

See available versions of a package before you pin or downgrade.

Rolling back a package starts with knowing which versions exist. Asking for a nonsense version to force pip to print the list in its error message works, but there is a proper command that I’d use instead:

python3 -m pip index versions requests

The first line shows the newest version, and under it comes the list of available ones. If the package is installed in the current environment, pip also shows which version you have next to the latest.

Pre-releases are left out unless you ask for them:

python3 -m pip index versions requests --pre

Then pick one and pin it:

python3 -m pip install "requests==X.Y.Z"

The list is filtered for your setup. Releases that don’t support your Python version or platform are not offered, so the same command can answer differently on an older server. That’s useful when you wonder why an upgrade stops at an old release there. The options --python-version and --platform let you check for another target. It asks whichever index pip is configured to use, so a private mirror may show fewer versions than PyPI itself.

Further reading: pip index

More Pip tips urllib3<2 python3 -m pip download -r requirements.txt -d ./wheels python3 -m pip config set global.timeout 60 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