我尝试将我的诗歌从1.1.x版本升级到1.3版本,但正如官方手册(https://python-poetry.org/docs/)建议的那样,我手动删除了旧版本。不幸的是,我可能删除了错误的文件,因为在安装1.3版本后,我仍然收到错误提示,似乎与旧诗歌有冲突。
我尝试使用find /home/username -name *poetry*
查找与诗歌相关的所有文件(这是一个远程机器,所以我不想影响其他人),并在卸载诗歌1.3后将它们删除。然后我重新安装了诗歌1.3,但仍然无法正常工作。
我还尝试删除整个存储库并再次克隆它,但问题仍然存在。我想我已经搞砸了,但希望有一些方法可以进行硬重置。有没有办法解决这个问题?
以下是我的错误消息开头:
Package operations: 28 installs, 0 updates, 0 removals
• Installing certifi (2021.10.8)
• Installing charset-normalizer (2.0.12)
• Installing idna (3.3)
• Installing six (1.16.0)
• Installing typing-extensions (4.2.0)
• Installing urllib3 (1.26.9)
DBusErrorResponse
[org.freedesktop.DBus.Error.UnknownMethod] ('No such interface “org.freedesktop.DBus.Properties” on object at path /org/freedesktop/secrets/collection/login',)
at ~/.local/share/pypoetry/venv/lib/python3.10/site-packages/secretstorage/util.py:48 in send_and_get_reply
44│ def send_and_get_reply(self, msg: Message) -> Any:
45│ try:
46│ resp_msg: Message = self._connection.send_and_get_reply(msg)
47│ if resp_msg.header.message_type == MessageType.error:
→ 48│ raise DBusErrorResponse(resp_msg)
49│ return resp_msg.body
50│ except DBusErrorResponse as resp:
51│ if resp.name in (DBUS_UNKNOWN_METHOD, DBUS_NO_SUCH_OBJECT):
52│ raise ItemNotFoundException('Item does not exist!') from resp
The following error occurred when trying to handle this error:
ItemNotFoundException
Item does not exist!
at ~/.local/share/pypoetry/venv/lib/python3.10/site-packages/secretstorage/util.py:52 in send_and_get_reply
48│ raise DBusErrorResponse(resp_msg)
49│ return resp_msg.body
50│ except DBusErrorResponse as resp:
51│ if resp.name in (DBUS_UNKNOWN_METHOD, DBUS_NO_SUCH_OBJECT):
→ 52│ raise ItemNotFoundException('Item does not exist!') from resp
53│ elif resp.name in (DBUS_SERVICE_UNKNOWN, DBUS_EXEC_FAILED,
54│ DBUS_NO_REPLY):
55│ data = resp.data
56│ if isinstance(data, tuple):
The following error occurred when trying to handle this error:
PromptDismissedException
Prompt dismissed.
at ~/.local/share/pypoetry/venv/lib/python3.10/site-packages/secretstorage/collection.py:159 in create_collection
155│ if len(collection_path) > 1:
156│ return Collection(connection, collection_path, session=session)
157│ dismissed, result = exec_prompt(connection, prompt)
158│ if dismissed:
→ 159│ raise PromptDismissedException('Prompt dismissed.')
160│ signature, collection_path = result
161│ assert signature == 'o'
162│ return Collection(connection, collection_path, session=session)
163│
The following error occurred when trying to handle this error:
InitError
Failed to create the collection: Prompt dismissed..
at ~/.local/share/pypoetry/venv/lib/python3.10/site-packages/keyring/backends/SecretService.py:63 in get_preferred_collection
59│ collection = secretstorage.Collection(bus, self.preferred_collection)
60│ else:
61│ collection = secretstorage.get_default_collection(bus)
62│ except exceptions.SecretStorageException as e:
→ 63│ raise InitError("Failed to create the collection: %s." % e)
64│ if collection.is_locked():
65│ collection.unlock()
66│ if collection.is_locked(): # User dismissed the prompt
67│ raise KeyringLocked("Failed to unlock the collection!")
DBusErrorResponse
[org.freedesktop.DBus.Error.UnknownMethod] ('No such interface “org.freedesktop.DBus.Properties” on object at path /org/freedesktop/secrets/collection/login',)
at ~/.local/share/pypoetry/venv/lib/python3.10/site-packages/secretstorage/util.py:48 in send_and_get_reply
44│ def send_and_get_reply(self, msg: Message) -> Any:
45│ try:
46│ resp_msg: Message = self._connection.send_and_get_reply(msg)
47│ if resp_msg.header.message_type == MessageType.error:
→ 48│ raise DBusErrorResponse(resp_msg)
49│ return resp_msg.body
50│ except DBusErrorResponse as resp:
51│ if resp.name in (DBUS_UNKNOWN_METHOD, DBUS_NO_SUCH_OBJECT):
52│ raise ItemNotFoundException('Item does not exist!') from resp
The following error occurred when trying to handle this error:
ItemNotFoundException
Item does not exist!
at ~/.local/share/pypoetry/venv/lib/python3.10/site-packages/secretstorage/util.py:52 in send_and_get_reply
48│ raise DBusErrorResponse(resp_msg)
49│ return resp_msg.body
50│ except DBusErrorResponse as resp:
51│ if resp.name in (DBUS_UNKNOWN_METHOD, DBUS_NO_SUCH_OBJECT):
→ 52│ raise ItemNotFoundException('Item does not exist!') from resp
53│ elif resp.name in (DBUS_SERVICE_UNKNOWN, DBUS_EXEC_FAILED,
54│ DBUS_NO_REPLY):
55│ data = resp.data
56│ if isinstance(data, tuple):
The following error occurred when trying to handle this error:
PromptDismissedException
Prompt dismissed.
at ~/.local/share/pypoetry/venv/lib/python3.10/site-packages/secretstorage/collection.py:159 in create_collection
155│ if len(collection_path) > 1:
156│ return Collection(connection, collection_path, session=session)
157│ dismissed, result = exec_prompt(connection, prompt)
158│ if dismissed:
→ 159│ raise PromptDismissedException('Prompt dismissed.')
160│ signature, collection_path = result
161│ assert signature == 'o'
162│ return Collection(connection, collection_path, session=session)
163│
secretstorage
以及为什么在运行Poetry时系统会尝试使用它吗? - Mikko Ohtamaasecretstorage
,但它似乎是一些辅助包。但我不确定它是为哪个包而需要的,而且在我的poetry.lock
文件中也没有指定(当我在另一台之前未安装过poetry 1.1
的电脑上尝试时,这不是问题)。 - Emil Haas