Skip to content

No module named winrt error #54

@jay-ramani

Description

@jay-ramani

Hi @GitHub30,

I just installed your library, and tried a sample, but got the following error:

    from win11toast import toast
  File "C:\Program Files\Python\Lib\site-packages\win11toast.py", line 3, in <module>
    from winrt.windows.data.xml.dom import XmlDocument
  File "C:\Program Files\Python\Lib\site-packages\winrt\windows\data\xml\dom\__init__.py", line 5, in <module>
    import winrt.runtime._internals
  File "C:\Program Files\Python\Lib\site-packages\winrt\runtime\__init__.py", line 3, in <module>
    from winrt._winrt import init_apartment, uninit_apartment, STA, MTA
ModuleNotFoundError: No module named 'winrt._winrt'

When attempting to install winrt, I get this error:

pip install winrt
ERROR: Could not find a version that satisfies the requirement winrt (from versions: none)
ERROR: No matching distribution found for winrt

On looking up the error on Stack Overflow, it appears this is because winrt is deprecated as Microsoft has stopped updates to its repository. This is confirmed by comments under the accepted answer.

How can I install winrt, and get your library working? Here are versions of interest:

Win11toast  : 0.36.2
Python      : 3.14.1
pip         : 25.3
Windows11   : Version 25H2 (OS Build 26200.7171)
Architecture: 64-bit

Thanks and cheers.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions