From: Gib Bogle on
My student is trying to build an executable version of a program that uses PyQt
and PyQwt, on Windows XP. She has installed: Python 2.6.1, Qt 4.5.0, PyQt 4.5,
and PyQwt 5.2.0. There is a module error on running the executable produced by
py2exe. Here is the info I got from my student:

<quote>

Traceback (most recent call last):
File "ABM15.pyw", line 15, in <module>
File "PyQt4\Qwt5\__init__.pyc", line 32, in <module>
File "PyQt4\Qwt5\Qwt.pyc", line 12, in <module>
File "PyQt4\Qwt5\Qwt.pyc", line 10, in __load
ImportError: No module named QtSvg


If you Google this last line, you'll find that I've posted this to a forum, but
no one answered me. Someone has also had this problem before, although I think
they were using PyInstaller and not py2exe. They say that its because Qwt has a
hidden import for QtSvg. If I can turn this off, maybe it'll work, but I don't
know how.

I have downloaded py2exe and I run the attached setup.py file in my working
directory. It creates two directories: 'dist' and 'build'. An executable is
created in the 'dist' directory along with other things. When I tried running
it, it produces a log file, in which I find the error messages.

<\quote>

Perhaps someone can recognize these symptoms.

Thanks,
Gib
From: David Boddie on
On Monday 22 February 2010 01:17, Gib Bogle wrote:

> <quote>
>
> Traceback (most recent call last):
> File "ABM15.pyw", line 15, in <module>
> File "PyQt4\Qwt5\__init__.pyc", line 32, in <module>
> File "PyQt4\Qwt5\Qwt.pyc", line 12, in <module>
> File "PyQt4\Qwt5\Qwt.pyc", line 10, in __load
> ImportError: No module named QtSvg
>
> If you Google this last line, you'll find that I've posted this to a
> forum, but no one answered me. Someone has also had this problem before,
> although I think they were using PyInstaller and not py2exe. They say that
> its because Qwt has a hidden import for QtSvg. If I can turn this off,
> maybe it'll work, but I don't know how.
>
> I have downloaded py2exe and I run the attached setup.py file in my
> working directory. It creates two directories: 'dist' and 'build'. An
> executable is created in the 'dist' directory along with other things.
> When I tried running it, it produces a log file, in which I find the error
> messages.
>
> <\quote>
>
> Perhaps someone can recognize these symptoms.

Someone asked this question on the PyQt mailing list, too:

http://www.riverbankcomputing.com/pipermail/pyqt/2010-February/025827.html

I believe it was also asked on the #pyqt IRC channel on freenode. I think
I have previously referred people with py2exe/PyQt issues to this page on
the PyQt Wiki:

http://www.py2exe.org/index.cgi/Py2exeAndPyQt

If you can somehow convince py2exe to include the QtSvg module (and
presumably the libQtSvg library as well) then perhaps that will solve
this problem.

David
From: Gib Bogle on
Thanks David.

> Someone asked this question on the PyQt mailing list, too:
>
> http://www.riverbankcomputing.com/pipermail/pyqt/2010-February/025827.html

That's my student, Helvin.

>
> I believe it was also asked on the #pyqt IRC channel on freenode. I think
> I have previously referred people with py2exe/PyQt issues to this page on
> the PyQt Wiki:
>
> http://www.py2exe.org/index.cgi/Py2exeAndPyQt
>
> If you can somehow convince py2exe to include the QtSvg module (and
> presumably the libQtSvg library as well) then perhaps that will solve
> this problem.

I just did a quick test myself, and confirmed that this works for sip. I'm not
at all clear what "--includes" arguments might be needed for QtSvg (and
libQtSvg). I'll pass this info on to Helvin.

Gib
From: Gib Bogle on
David Boddie wrote:

> I have previously referred people with py2exe/PyQt issues to this page on
> the PyQt Wiki:
>
> http://www.py2exe.org/index.cgi/Py2exeAndPyQt
>
> If you can somehow convince py2exe to include the QtSvg module (and
> presumably the libQtSvg library as well) then perhaps that will solve
> this problem.
>
> David

Thanks David, that worked a treat. :-)
From: David Boddie on
On Tuesday 23 February 2010 05:32, Gib Bogle wrote:

> David Boddie wrote:
>
>> I have previously referred people with py2exe/PyQt issues to this page on
>> the PyQt Wiki:
>>
>> http://www.py2exe.org/index.cgi/Py2exeAndPyQt
>>
>> If you can somehow convince py2exe to include the QtSvg module (and
>> presumably the libQtSvg library as well) then perhaps that will solve
>> this problem.
>>
>> David
>
> Thanks David, that worked a treat. :-)

If you could update the Wiki (or maybe the py2exe Wiki, if they have one)
to say what you did, that would be useful for others in the future. Then
they'll only be one search away from the answer. :-)

David