<span class="Apple-style-span" style="border-collapse: collapse; ">I attempted to run<div><br></div><div> pythonw PyQt4/examples/tools/qtdemo/qtdemo.pyw</div><div><br></div><div>After installing the Windows binaries for PyQt 4.4.4-2, with 64-bit Python 2.6.1, on 64-bit Windows Vista Business, and received the following error message:</div>
<div><br></div><div><div> Traceback (most recent call last):</div><div> File "qtdemo.pyw", line 28, in <module></div><div> from PyQt4 import QtGui</div><div> ImportError: DLL load failed: %1 is not a valid Win32 application.</div>
<div><br></div><div>I found the following mailing list thread that appears to deal with this issue:</div><div><br></div><div> <a href="http://www.mail-archive.com/pyqt@riverbankcomputing.com/msg15804.html" target="_blank" style="color: rgb(0, 0, 204); ">http://www.mail-archive.com/pyqt@riverbankcomputing.com/msg15804.html</a></div>
<div><br></div><div>The answer to that person's question was, "I don't see how a 64 bit interpreter can be expected to handle a 32 bit .pyd extension."</div><div><br></div><div>I assume that this answer means, "The PyQt Windows binaries cannot be used with the 64-bit Python interpreter. You must build PyQt yourself in order to use it with 64-bit Python 2.6.1". I attempted to do so following the instructions on the PyQt webpage, starting with installing SIP, using g++, make, and bison under cygwin to do the compilation. However, after running "python configure.py -p win32-g++", and running "make", I received the following error:</div>
<div><br></div><div><div><div>gcc -c -O2 -w -DUNICODE -DQT_LARGEFILE_SUPPORT -I. -o main.o main.c</div><div>gcc -c -O2 -w -DUNICODE -DQT_LARGEFILE_SUPPORT -I. -o transform.o transform.c</div><div>gcc -c -O2 -w -DUNICODE -DQT_LARGEFILE_SUPPORT -I. -o gencode.o gencode.c</div>
<div>gcc -c -O2 -w -DUNICODE -DQT_LARGEFILE_SUPPORT -I. -o export.o export.c</div><div>gcc -c -O2 -w -DUNICODE -DQT_LARGEFILE_SUPPORT -I. -o heap.o heap.c</div><div>gcc -c -O2 -w -DUNICODE -DQT_LARGEFILE_SUPPORT -I. -o parser.o parser.c</div>
<div>gcc -c -O2 -w -DUNICODE -DQT_LARGEFILE_SUPPORT -I. -o lexer.o lexer.c</div><div>g++ -mthreads -Wl,-enable-stdcall-fixup -Wl,-enable-auto-import -Wl,-enable-runtime-pseudo-reloc -Wl,-subsystem,console -Wl,-s -o sip.exe main.o transform.o gencode.o export.o heap.o parser.o lexer.o </div>
<div>make[1]: Leaving directory `/cygdrive/c/Users/ddoty/Downloads/python/sip-4.7.9/sipgen'</div><div>make[1]: Entering directory `/cygdrive/c/Users/ddoty/Downloads/python/sip-4.7.9/siplib'</div><div>gcc -c -O2 -w -DUNICODE -DQT_LARGEFILE_SUPPORT -I. -Ic:\programs\Python26\include -o siplib.o siplib.c</div>
<div>siplib.c:16:20: Python.h: No such file or directory</div><div>In file included from siplib.c:22:</div><div>sip.h:46:2: #error "This version of SIP requires Python v2.3 or later"</div><div>In file included from siplib.c:22:</div>
<div><div>sip.h:190: error: parse error before "PyHeapTypeObject"</div><div>sip.h:200: error: parse error before '}' token</div><div>sip.h:207: error: parse error before "PyObject_HEAD"</div></div>
</div><div>...</div><div><br></div><div>and the parse errors go on for a while.</div><div><br></div><div>Is there a prebuilt 64-bit PyQt binary for Windows that I can use instead? Alternately, did I misunderstand the advice from the other mailing list thread, and in fact there is some other problem that I can fix to use the PyQt Windows binaries with 64-bit Python 2.6.1?</div>
<div><br></div><div>Thank you,</div><div>Dave</div></div></div></span>