-
-
Notifications
You must be signed in to change notification settings - Fork 225
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
winrt/winsdk error #2785
Comments
I don't know this package, but maybe this discussion can help you. |
Oh, this is bad, I have exactly the same problem when I try to subscribe to |
Many packages work out of the box, others require us to make hooks if some dll is not being copied, something like that. We would have to analyze this case, with a good example of how to reproduce the error. |
Here is the script, and you can run it from the console. It will get real-time Windows notifications, however, if you try to make an .exe file it will run but you should only get the initial count and than you will also see an error, I think it comes from this line:
|
I tested the sample with Python 3.10 and 3.12, and it showed the error message three times (three attempts) when I ran You can try using --packages and --includes-msvcr, for example: |
I've been playing with this for several hours now and I can't figure out why it's not working. I've included the module in the cx_Freeze setup script, but it seems like the problem is somewhere else. Maybe we're missing some DLL file or something that I can't seem to spot. Generally, I use the |
I only tested it on a VM with Windows 11, with py 3.10, and also with py 3.12. In both, using |
Sorry, I just copied my test code. Here is a simpler version without PyQt6, you only need to install
result should be like |
python test.py
|
Hmm, this is strange. I have Python installed from the Microsoft Store, so maybe that's why I'm not getting any errors like this, and everything is working fine? |
I had tested with python from python.org and now with uv python. Windows Store python has some restrictions[1] and generally does not allow modifications to the executable, which needs to be done when you freeze. I'll try something later. [1] https://docs.python.org/3.12/using/windows.html#known-issues |
OK, I removed Python from the Store, installed Python 3.12.9 from python.org, and encountered the same error as you. I uninstalled it again and installed it from the Store, and now everything is working fine :( btw only |
I have searched for solutions but cannot find, I have made some apps to get Windows Notification count, and when I run it with python from console all is working perfectly fine, but when I build .exe there is always same error
Error: [WinError -2147023728] Element not found
I have using import
Also, i have tried with winsdk
from winsdk.windows.ui.notifications import management
And I have absolutely same error from both
Any idea why this does not work when I build exe file, but works fine with python from console? There is no error when building the app.exe, but when I run it, I see this as the output.
I have tried also import as packages inside
build_options
this modules but also does not help.I have Python 3.12.8 and latest cx_Freeze also I have tried with dev.
I have no more ideas where the problem could be, any help is welcome?
The text was updated successfully, but these errors were encountered: