16

On a fresh poetry install, I get the following error trying to install anything:

(base) ➜  celeba poetry add numpy       
Failed to unlock the collection!

How can I fix this?

1
  • 1
    Seems to be something to do with "keyring"? Maybe try this suggestion from python-poetry issues
    – Temba
    Nov 14, 2022 at 23:20

2 Answers 2

57

There is an extensive discussion and various workarounds suggested in poetry issue #1719. Probably the fastest way to make this work is to run the following before you run poetry:

export PYTHON_KEYRING_BACKEND=keyring.backends.null.Keyring
1
  • 3
    This problem is a real black-eye for the reputation of poetry. It's a great tool, but the fact that the maintainers simply will not fix this after years of complaints points to some real cultural problems within their team.
    – Leopd
    Aug 9 at 4:40
2

If you are remotely accessing your work environment via SSH, add this function to your .bashrc file and run it from the remote terminal:

# Linux unlock gnome keyring
function unlock-keyring ()
{
    read -rsp "Password: " pass
    export $(echo -n "$pass" | gnome-keyring-daemon --replace --unlock)
    unset pass
}

Source: https://unix.stackexchange.com/questions/602313/unlock-gnome-keyring-daemon-from-command-line

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.