9
5

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

poetry addしようとしたらFailed to unlock the collection!と怒られた

Posted at

ぱっとググって、直接的な記事が見当たらなかったので、念の為備忘録的に残しておきます。
誰かの助けになれば幸いです。

poetryでpythonの環境構築をしようとして、poetry initとかで立ち上げたプロジェクトに対し、poetry addでライブラリを追加しようとしたら、掲題の通りのエラーがでました。

$ poetry add numpy

Failed to unlock the collection!

下記のpoetryのissueを見ていくと、ターミナルでkeyring --disableを実行すると良い、とおっしゃってる方がいるので、そちらをやってみました。

$ keyring --disable

poetry addをしてみると、うまくライブラリがインストールできました。

$ poetry add numpy
Using version ^1.23.3 for numpy

Updating dependencies
Resolving dependencies... (10.5s)

tomlファイルにちゃんと追加されていることも確認できました。

$ cat pyproject.toml 
[tool.poetry]
name = "poetry-tutorial-pj"
version = "0.1.0"
description = ""
authors = ["hoge.fuga <hoge.fuga@hogehoge.com>"]
readme = "README.md"
packages = [{include = "poetry_tutorial_pj"}]

[tool.poetry.dependencies]
python = "^3.9"
numpy = "^1.23.3"


[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"

以上です。

9
5
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
9
5

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?