Skip to main content
 首页 » 编程设计

python之libnotify 错误 GLib.Error : The name org. freedesktop.Notifications 未由任何 .service 文件提供

2024年10月24日10powertoolsteam

我遇到了这个错误。知道有什么问题吗?

from gi.repository import Notify 
Notify.init("App Name") 
Notify.Notification.new("Hi").show() 
 
GLib.Error: g-dbus-error-quark: GDBus.Error:org.freedesktop.DBus.Error.ServiceUnknown: The name org.freedesktop.Notifications was not provided by any .service files  

(在 Raspberry Pi 上使用最新的 Raspbian)

请您参考如下方法:

这解决了::)

sudo apt-get install libnotify-cil-dev