-
Notifications
You must be signed in to change notification settings - Fork 305
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
QWindowsContext: OleInitialize() failed: "COM error 0xffffffff80010106 RPC_E_CHANGED_MODE (Unknown error 0x080010106)" #423
Comments
I cannot help you much here, given that I never tried using Qt with Bleak. But I expect that it does not play nice with |
Thank you |
I have this same issue happening now after reverting from Python 3.9 to Python 3.8. I get this same annoying warning if PyQt5 and bleak are both imported. My program ran fine on Python 3.9, but when trying to share my program and get the modules installed for someone else it was too difficult (pynnet installation issues and so forth). I can't remember how to get around them for python 3.9, and it is so much simpler to just use python 3.8 to get around that. However, this new warning/error is seemingly impossible to fix. I've tried everything including suppressing it with 'warnings' module (didn't work). To summarize, the issue is not with asyncio but with PyQt5 and Bleak imports specifically. It occurs after app = QApplication(sys.argv) is called. I can find no way around this. We either need a fix for this issue or a way to make things install more smoothly with python 3.9. |
Related issue (for pywinrt backend): microsoft/xlang#690 I think the solution is probably to make sure Qt calls and Bleak calls each stay on their own thread. |
Also see #580 (comment) for another possible workaround. |
I tried adding
but python says "AttributeError: module 'winrt._winrt' has no attribute 'unint_apartment'" |
Looks like I spelled "uninit" wrong. |
ahh thanks! I think this fixed it! |
from bleak_winrt import _winrt |
FYI, this workaround is no longer needed since Bleak v0.14.x. |
bluetoothctl -v
) in case of Linux:Description
I am using bleak in PyQt5 projects on win10
and after import bleak, the console printed 'QWindowsContext: OleInitialize() failed: "COM error 0xffffffff80010106 RPC_E_CHANGED_MODE (Unknown error 0x080010106)"' when runing the PyQt5 project.
This caused my program failed to open the QFiledialog with Native windows. The program just hanged there like dead.
What I Did
The text was updated successfully, but these errors were encountered: