[PyQt] Re: Deploying from Linux to Windows

Thorsten Kampe thorsten at thorstenkampe.de
Fri Jan 16 18:53:52 GMT 2009


* Doug Hackworth (Fri, 16 Jan 2009 11:53:45 -0600)
> I have developed a PyQt4 application on my Ubuntu machine, and itworks
> fine, no problems. Now I want another user to be able to use it on his
> Windows XP machine, so on his computer I do the following, in this
> order:
> 
> 1.  Install Python 2.6
> 2.  Install the PyQt4 for Python 2.6
> 
> Both installations were successful, and I can run the PyQt example programs that 
> are installed.  Also I can see, in the Python installation directory, that 
> Lib/site-packages/PyQt4 exists and has appropriate-looking stuff in it.
> 
> And yet -- I bet you can see this coming -- I cannot get my application to 
> execute.  Doubleclicking on my_app.py produces an instantaneously visible DOS 
> shell and no application, and renaming the file to my_app.pyw also has no effect 
> (less the flashing DOS shell).  Entering a DOS shell and trying to run the 
> program from there by means of a "python my_app.py" command simply results in:
> 
> Traceback (most recent call last):
>    File "my_app.py", line 2, in <module>
>      from PyQt4 import QtCore, QtGui
> ImportError: No module named PyQt4

You've done the installation and the necessary troubleshooting steps 
"according to the book". Nothing is wrong there. Now you have go a bit 
deeper: open a Python prompt and try to import any module, then try to 
import PyQt4. Also install pywin32. This is /not/ needed for PyQt but it 
might make a difference. I can't give you more tips at the moment as 
your environment sounds completely sane to me.

Thorsten



More information about the PyQt mailing list