When trying to use newer versions of pip on a remote headless system, it requires keyring access, or will at least use it if present. When running poetry installed via pipx, it installs keyring and it all breaks. Here's how I fixed it today.
Install development headers (assumes build tools already installed).
sudo apt install -y libkeyutils-dev
Enter the bin dir for the poetry pipx environment and install the keyutils extension for keyring.