Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PySide - Qt: Could not initialize OLE (error 80010106)

I'm using PySide with Python 2.7.3 x64, and when running my Qt application, I'm noticing the following error show up in the output of Wing IDE.

Qt: Could not initialize OLE (error 80010106)

This doesn't appear to be causing issues until I close the Qt application when I run it outside of Wing. The closed app will throw up a pythonw.exe windows error. I'm assuming the two are related, as it happens on even the most basic of Qt app. But I'm not exactly sure what the deal is. Any ideas would be really appreciated!

like image 667
jhayes Avatar asked Feb 15 '23 09:02

jhayes


1 Answers

The problem will be to do with Qt calling OleInitialize or CoInitialize on thread that has already been initialized to the MTA apartment model.

Those having issues after importing clr should note that in the .Net world threads are initialized as MTA by default although this can be changed by either calling SetApartmentState or using the STAThreadAttribute.

like image 170
David J Avatar answered Feb 17 '23 00:02

David J