Problem creating executable, with PyQwt


G

Gib Bogle

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
 
Ad

Advertisements

D

David Boddie

<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
 
G

Gib Bogle

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
 
D

David Boddie

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
 
Ad

Advertisements

G

Gib Bogle

David said:
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

OK, I'll put it on the to-do list.

Gib
 
Ad

Advertisements


Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top