Windows-Toasts icon indicating copy to clipboard operation
Windows-Toasts copied to clipboard

windows notifications fail - missing module

Open ZyphrZero opened this issue 5 months ago • 1 comments

After I build with Nuitka, my app cannot find the winrt.windows.foundation.collections module

Windows-Toasts Version:

windows-toasts==1.3.1
winrt-runtime==3.2.1
winrt-windows-data-xml-dom==3.2.1
winrt-windows-foundation==3.2.1
winrt-windows-foundation-collections==3.2.1
winrt-windows-ui-notifications==3.2.1

Error info:

2025-06-26 17:08:28 | ERROR | notification:send_notification:129 | Failed to send notification: No module named 'winrt.windows.foundation.collections'
2025-06-26 17:08:28 | DEBUG | notification:send_notification:130 | Exception details: Traceback (most recent call last):
  File "C:\Users\mucha\DOWNLO~1\PYAPP-~1.1-X\utils\notification.py", line 124, in send_notification
  File "C:\Users\mucha\DOWNLO~1\PYAPP-~1.1-X\windows_toasts\toasters.py", line 138, in show_toast
  File "C:\Users\mucha\DOWNLO~1\PYAPP-~1.1-X\windows_toasts\toasters.py", line 40, in _build_adaptable_data
ModuleNotFoundError: No module named 'winrt.windows.foundation.collections'

ZyphrZero avatar Jun 26 '25 09:06 ZyphrZero

Creating a fresh Python 3.11 venv with https://github.com/DatGuy1/Windows-Toasts/blob/main/tests/test_toasts.py#L6-L15 and building with Nuitka works on my machine. Here's the pip freeze output:

ordered-set==4.1.0
typing_extensions==4.14.0
Windows-Toasts==1.3.1
winrt-runtime==3.2.1
winrt-Windows.Data.Xml.Dom==3.2.1
winrt-Windows.Foundation==3.2.1
winrt-Windows.Foundation.Collections==3.2.1
winrt-Windows.UI.Notifications==3.2.1
zstandard==0.23.0

Perhaps try reinstalling the windows-toasts and winrt-* packages?

DatGuy1 avatar Jun 26 '25 10:06 DatGuy1