/ blog
blog | work

Poetry: Failed to unlock the collection!

Person cm
Tag python

Quick fix for a keyring issue with Poetry for Python

When trying to install a package with Poetry over SSH, you might run into this error:

$ poetry add Pygments

Failed to unlock the collection!

This is caused when you don't have an initialised keyring/Secret Service [1] running, which gives applications a safe place to store credentials, etc.

This issue typically occurs when connecting over SSH as it may not even be spawning it.


The fix is to simply disable the keyring so that Poetry does not try to query it.

$ keyring --disable
$ poetry add Pygments
Using version ^2.13.0 for Pygments

Updating dependencies
Resolving dependencies...


  1. [1]: