为了账号安全,请及时绑定邮箱和手机立即绑定

运行时错误:无法初始化 SecretService:

运行时错误:无法初始化 SecretService:

ABOUTYOU 2021-06-09 18:55:58
运行到密钥环问题:运行时错误:无法初始化 SecretService:环境变量 DBUS_SESSION_BUS_ADDRESS 未设置SecretService 已安装。操作系统是 RHEL运行: python -c "import keyring.backends.SecretService as SS; SS.Keyring.priority"提供了以下错误:回溯(最近通话最后一个):文件“/home/webpage/.pyenv/versions/WEBPAGE/lib/python3.6/site-packages/secretstorage/初始化py”为41行,在dbus_init回报connect_and_authenticate() 文件“/home/webpage/.pyenv/versions/WEBPAGE/lib/python3.6/site-packages/jeepney/integrate/blocking.py”,第 70 行,connect_and_authenticate bus_addr = get_bus(bus) 文件“/ home/webpage/.pyenv/versions/WEBPAGE/lib/python3.6/site-packages/jeepney/bus.py", line 53, in get_bus return find_session_bus() File "/home/webpage/.pyenv/versions/WEBPAGE /lib/python3.6/site-packages/jeepney/bus.py”,第 42 行,在 find_session_bus addr = os.environ['DBUS_SESSION_BUS_ADDRESS'] 文件“/home/webpage/.pyenv/versions/3.6.5/lib /python3.6/os.py",第 669 行,在getitem 中 从 None KeyError 引发 KeyError(key): 'DBUS_SESSION_BUS_ADDRESS'上述异常是以下异常的直接原因:回溯(最近一次通话):文件“/home/webpage/.pyenv/versions/WEBPAGE/lib/python3.6/site-packages/keyring/backends/SecretService.py”,第 37 行,在优先级总线 = secretstorage 中。 dbus_init()文件“/home/webpage/.pyenv/versions/WEBPAGE/lib/python3.6/site-packages/secretstorage/初始化从EX secretstorage.exceptions py”为45行,在dbus_init提高SecretServiceNotAvailableException(原因)。 SecretServiceNotAvailableException:环境变量 DBUS_SESSION_BUS_ADDRESS 未设置在处理上述异常的过程中,又发生了一个异常:回溯(最近一次调用):文件“”,第 1 行,在文件“/home/webpage/.pyenv/versions/WEBPAGE/lib/python3.6/site-packages/keyring/util/properties.py”中,行26、在get中 返回self.fget。get (None, owner)() File "/home/webpage/.pyenv/versions/WEBPAGE/lib/python3.6/site-packages/keyring/backends/SecretService.py", line 41, in priority "Unable to initialize SecretService:%s" % e) 运行时错误:无法初始化 SecretService:环境变量 DBUS_SESSION_BUS_ADDRESS 未设置任何帮助表示赞赏!
查看完整描述

2 回答

?
翻过高山走不出你

TA贡献1875条经验 获得超3个赞

缺少依赖项:dbus-python


查看完整回答
反对 回复 2021-06-15
?
慕容3067478

TA贡献1773条经验 获得超3个赞

试试这个

export $(dbus-launch)


查看完整回答
反对 回复 2021-06-15
  • 2 回答
  • 0 关注
  • 162 浏览
慕课专栏
更多

添加回答

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信