[Pythonmac-SIG] ImportError when trying to open app made with py2app
Terry Jones
tcj25 at cam.ac.uk
Wed Sep 28 14:31:57 CEST 2005
Greetings. I'm new at all things Python, so I hope the following is not too
naive or annoying. I've spent time looking for an answer - in the archives
(2005 only), on the web, etc., and also tried passing additional things to
py2app.
I am trying to wrap up some simple python code with py2app to distribute it.
My setup.py is trivial
from distutils.core import setup
import py2app
setup(
app=['examiner.py'],
)
Running
$ python setup.py py2app
appears to work fine, with exit status 0, output attached. I can then cd
into the dist directory and open the app successfully.
But when I open a finder window and double click on the app, I get an
error (the following is pasted from the console):
===== Wed Sep 28 2005 ===== 14:19:26 Europe/Madrid =====
Traceback (most recent call last):
File "/Users/terry/mds/terry/xx/dist/examiner.app/Contents/Resources/__boot__.py", line 31, in ?
_run('examiner.py')
File "/Users/terry/mds/terry/xx/dist/examiner.app/Contents/Resources/__boot__.py", line 28, in _run
execfile(path, globals(), globals())
File "/Users/terry/mds/terry/xx/dist/examiner.app/Contents/Resources/examiner.py", line 7, in ?
from pivy.gui.soqt import *
File "pivy/gui/soqt.pyc", line 4, in ?
File "pivy/gui/_soqt.pyc", line 18, in ?
File "pivy/gui/_soqt.pyc", line 11, in __load
ImportError: Failure linking new module: libqt.3.dylib: dyld: /Users/terry/mds/terry/xx/dist/examiner.app/Contents/MacOS/examiner can't open library: libqt.3.dylib (No such file or directory, errno = 2)
2005-09-28 14:19:47.022 examiner[23268] examiner Error
2005-09-28 14:19:47.023 examiner[23268] An unexpected error has occurred during execution of the main script
ImportError: Failure linking new module: libqt.3.dylib: dyld: /Users/terry/mds/terry/xx/dist/examiner.app/Contents/MacOS/examiner can't open library: libqt.3.dylib (No such file or directory, errno = 2)
Can anyone tell me what the problem is here? When I look in the dist dir, I
can see the following Qt relevant files:
$ find dist -name '*[qQ]*' -print
dist/examiner.app/Contents/Frameworks/libSoQt.20.dylib
dist/examiner.app/Contents/Resources/Python/lib-dynload/pivy/gui/_soqt.so
dist/examiner.app/Contents/Resources/Python/lib-dynload/qt.so
dist/examiner.app/Contents/Resources/Python/lib-dynload/qtcanvas.so
dist/examiner.app/Contents/Resources/Python/lib-dynload/qtgl.so
dist/examiner.app/Contents/Resources/Python/lib-dynload/qtnetwork.so
dist/examiner.app/Contents/Resources/Python/lib-dynload/qtsql.so
dist/examiner.app/Contents/Resources/Python/lib-dynload/qttable.so
dist/examiner.app/Contents/Resources/Python/lib-dynload/qtui.so
dist/examiner.app/Contents/Resources/Python/lib-dynload/qtxml.so
So py2app has clearly found the use of Qt and included some libraries. But
the missing libqt.3.dylib which it's looking for is not present. I do have
this, in /usr/local/qt/lib:
$ ls -la /usr/local/qt/lib/libqt*
-rwxrwxr-x 1 root terry 9907224 Jun 9 18:12 /usr/local/qt/lib/libqt.3.3.4.dylib
lrwxrwxr-x 1 terry terry 17 Jun 9 18:12 /usr/local/qt/lib/libqt.3.3.dylib -> libqt.3.3.4.dylib
lrwxrwxr-x 1 terry terry 17 Jun 9 18:12 /usr/local/qt/lib/libqt.3.dylib -> libqt.3.3.4.dylib
lrwxrwxr-x 1 terry terry 17 Jun 9 18:12 /usr/local/qt/lib/libqt.dylib -> libqt.3.3.4.dylib
-rw-rw-r-- 1 root terry 707 Jun 9 17:21 /usr/local/qt/lib/libqt.la
-rw-rw-r-- 1 root terry 714 Jun 9 17:21 /usr/local/qt/lib/libqt.prl
If the above information is not sufficient, I'll happily send more details
of my setup (OS X 10.3.9, python 2.4, etc). I'm not sure that they matter
though, seeing as I can manually do a successful open from the dist
directory.
Thanks for any help,
Terry Jones
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: fred
Url: http://mail.python.org/pipermail/pythonmac-sig/attachments/20050928/3ac320df/fred-0001.asc
More information about the Pythonmac-SIG
mailing list