【问题标题】:dbus-python - error: [WinError 193] %1 is not a valid Win32 applicationdbus-python - 错误:[WinError 193] %1 不是有效的 Win32 应用程序
【发布时间】:2020-10-27 12:02:01
【问题描述】:

我正在尝试通过 python notify2 模块发送一个简单的桌面通知。代码如下:

import notify2

notify2.init('app name')
n = notify2.Notification('Test','This is a test','C:/Users/meneu/Documents/test.PNG')
n.show()

Notify2 需要 dbus-python 模块,但这就是问题所在。当我尝试通过 pip 安装它时,它会抛出此错误:

creating C:\Users\meneu\AppData\Local\Temp\pip-req-build-4qrgk1t2\build
creating C:\Users\meneu\AppData\Local\Temp\pip-req-build-4qrgk1t2\build\temp.win-amd64-3.7
error: [WinError 193] %1 is not a valid Win32 application

我的系统是 64 位的,我认为存在问题。有谁知道如何为 64 位安装 dbus?我正在使用 python 3.7。

我也尝试了 GLib 和 Gtk3,但也引发了很多错误。

提前致谢。

【问题讨论】:

    标签: python python-3.x notify


    【解决方案1】:

    AFAIK,没有适用于 Windows 的 DBus,因此没有适用于 Windows 的 dbus-python。

    【讨论】:

    • 好吧,知道任何可行的替代方案吗?
    • 我真的不知道你想做什么,但如果你想在 Windows 上获得桌面通知,我已经保存了这个 gem:stackoverflow.com/questions/15921203/… 可能还有更现代的解决方案,只是谷歌周围。
    • 感谢您的链接,我终于找到了工作!
    猜你喜欢
    • 2020-02-19
    • 1970-01-01
    • 2019-08-10
    • 2014-10-28
    • 2021-12-25
    • 1970-01-01
    • 2020-07-28
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多