[PyQt] pyqtdeploy, Windows, ctypes and sys.dllhandle

Phil Thompson phil at riverbankcomputing.com
Sun Nov 1 12:43:26 GMT 2015


On 29 Sep 2015, at 7:00 p.m., Robert Kent <rob at gulon.co.uk> wrote:
> 
> Hi All,
> 
> I’ve hit a snag when trying to wrap the comtypes library with pyqtdeploy on (on Windows). This library depends on ctypes and when I include that in my project and run the application I get the following runtime error:
> 
>>   File “:/ctypes/__init__.pyo”, line 435, in <module>
> Attribute Error: ‘module’ has no attribute ‘dllhandle’
> 
> When I go to the relevant line in the ctypes source file I find that ‘dllhandle’ belongs to the ‘sys’ module and I can call it from the command line.
> 
> So, my question(s) is/are: is this a bug or is this omitted for a reason? If the latter, is there a tweaked version of ctypes available that I should be using or a workaround? Or (finally), have I simply broken something somewhere?

If you want to dynamically load DLLs then you have to have the Python interpreter as a DLL. Rather than compile your own it is easier to use the one from python.org.

Phil


More information about the PyQt mailing list