【问题标题】:why shows ModuleNotFoundError after converting py to exe为什么将py转换为exe后显示ModuleNotFoundError
【发布时间】:2020-03-27 10:28:52
【问题描述】:

我是python的初学者。所以我无法理解这个问题。我正在使用 plyer 进行通知系统。但是在使用 auto-py-to-exe 或 pyinstaller 将 .py 转换为 .exe 后它不起作用。它只在IDE中工作。我想在打开 .exe 文件后得到通知。

请帮我解决这个问题。

from plyer import notification


def notifyMe(title, message):
    notification.notify(
        title=title,
        message=message,
        app_icon=None,
        timeout=15
    )

notifyMe("Hey Habib!", "Good Morning")

【问题讨论】:

标签: python module notifications


【解决方案1】:

尝试在pyinstaller命令中添加--hidden-import plyer.platforms.win.notification 例如:pyinstaller --onefile --windowed --hidden-import plyer.platforms.win.notification example.py

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2020-09-22
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2023-01-18
    相关资源
    最近更新 更多