py2app ValueError: total_size > low_offset (164 > 0)

146 Views Asked by At

I have a simple python script with two resources that I want to covert to an Mac OSX app. Script runs fins from the command line, but when i try to package it into an app, I get:

Ante-scriptum: I'm building in /opt/k which has the right permisions...

running py2app
creating /opt/k/build/bdist.macosx-10.8-x86_64/python2.7-standalone/app
creating /opt/k/build/bdist.macosx-10.8-x86_64/python2.7-standalone/app/collect
creating /opt/k/build/bdist.macosx-10.8-x86_64/python2.7-standalone/app/temp
creating build/bdist.macosx-10.8-x86_64/python2.7-standalone/app/lib-dynload
creating build/bdist.macosx-10.8-x86_64/python2.7-standalone/app/Frameworks
*** using recipe: virtualenv ***
*** using recipe: sip ***
*** using recipe: pyside ***
*** using recipe: email ***
*** filtering dependencies ***
468 total
66 filtered
9 orphaned
402 remaining
*** create binaries ***
creating /opt/k/build/bdist.macosx-10.8-x86_64/python2.7-standalone/app/temp/PySide
creating python loader for extension 'PySide.QtCore'
creating python loader for extension 'PySide.QtGui'
creating python loader for extension 'PySide.QtNetwork'
creating python loader for extension 'PySide.QtWebKit'
*** byte compile python files ***
byte-compiling /usr/local/Cellar/pyside/1.2.1/lib/python2.7/site-packages/PySide/__init__.py to PySide/__init__.pyc
creating /opt/k/build/bdist.macosx-10.8-x86_64/python2.7-standalone/app/collect/PySide
byte-compiling /usr/local/Cellar/pyside/1.2.1/lib/python2.7/site-packages/PySide/_utils.py to PySide/_utils.pyc
byte-compiling /usr/local/Cellar/python/2.7.6/Frameworks/Python.framework/Versions/2.7/lib/python2.7/StringIO.py to StringIO.pyc
byte-compiling /usr/local/Cellar/python/2.7.6/Frameworks/Python.framework/Versions/2.7/lib/python2.7/UserDict.py to UserDict.pyc
byte-compiling /usr/local/Cellar/python/2.7.6/Frameworks/Python.framework/Versions/2.7/lib/python2.7/_LWPCookieJar.py to _LWPCookieJar.pyc
byte-compiling /usr/local/Cellar/python/2.7.6/Frameworks/Python.framework/Versions/2.7/lib/python2.7/_MozillaCookieJar.py to _MozillaCookieJar.pyc
byte-compiling /usr/local/Cellar/python/2.7.6/Frameworks/Python.framework/Versions/2.7/lib/python2.7/__future__.py to __future__.pyc
byte-compiling /usr/local/Cellar/python/2.7.6/Frameworks/Python.framework/Versions/2.7/lib/python2.7/_abcoll.py to _abcoll.pyc
byte-compiling /usr/local/Cellar/python/2.7.6/Frameworks/Python.framework/Versions/2.7/lib/python2.7/_osx_support.py to _osx_support.pyc
byte-compiling /usr/local/Cellar/python/2.7.6/Frameworks/Python.framework/Versions/2.7/lib/python2.7/_strptime.py to _strptime.pyc
byte-compiling /usr/local/Cellar/python/2.7.6/Frameworks/Python.framework/Versions/2.7/lib/python2.7/_sysconfigdata.py to _sysconfigdata.pyc
byte-compiling /usr/local/Cellar/python/2.7.6/Frameworks/Python.framework/Versions/2.7/lib/python2.7/_threading_local.py to _threading_local.pyc
byte-compiling /usr/local/Cellar/python/2.7.6/Frameworks/Python.framework/Versions/2.7/lib/python2.7/_weakrefset.py to _weakrefset.pyc
byte-compiling /usr/local/Cellar/python/2.7.6/Frameworks/Python.framework/Versions/2.7/lib/python2.7/abc.py to abc.pyc
byte-compiling /usr/local/Cellar/python/2.7.6/Frameworks/Python.framework/Versions/2.7/lib/python2.7/aifc.py to aifc.pyc
byte-compiling /usr/local/Cellar/python/2.7.6/Frameworks/Python.framework/Versions/2.7/lib/python2.7/ast.py to ast.pyc
byte-compiling /usr/local/Cellar/python/2.7.6/Frameworks/Python.framework/Versions/2.7/lib/python2.7/atexit.py to atexit.pyc
byte-compiling /usr/local/Cellar/python/2.7.6/Frameworks/Python.framework/Versions/2.7/lib/python2.7/base64.py to base64.pyc
byte-compiling /usr/local/Cellar/python/2.7.6/Frameworks/Python.framework/Versions/2.7/lib/python2.7/bdb.py to bdb.pyc
byte-compiling /usr/local/Cellar/python/2.7.6/Frameworks/Python.framework/Versions/2.7/lib/python2.7/bisect.py to bisect.pyc
byte-compiling /usr/local/Cellar/python/2.7.6/Frameworks/Python.framework/Versions/2.7/lib/python2.7/calendar.py to calendar.pyc
byte-compiling /usr/local/Cellar/python/2.7.6/Frameworks/Python.framework/Versions/2.7/lib/python2.7/chunk.py to chunk.pyc
byte-compiling /usr/local/Cellar/python/2.7.6/Frameworks/Python.framework/Versions/2.7/lib/python2.7/cmd.py to cmd.pyc
byte-compiling /usr/local/Cellar/python/2.7.6/Frameworks/Python.framework/Versions/2.7/lib/python2.7/codecs.py to codecs.pyc
byte-compiling /usr/local/Cellar/python/2.7.6/Frameworks/Python.framework/Versions/2.7/lib/python2.7/collections.py to collections.pyc
byte-compiling /usr/local/Cellar/python/2.7.6/Frameworks/Python.framework/Versions/2.7/lib/python2.7/contextlib.py to contextlib.pyc
byte-compiling /usr/local/Cellar/python/2.7.6/Frameworks/Python.framework/Versions/2.7/lib/python2.7/cookielib.py to cookielib.pyc
byte-compiling /usr/local/Cellar/python/2.7.6/Frameworks/Python.framework/Versions/2.7/lib/python2.7/copy.py to copy.pyc
byte-compiling /usr/local/Cellar/python/2.7.6/Frameworks/Python.framework/Versions/2.7/lib/python2.7/copy_reg.py to copy_reg.pyc
byte-compiling /usr/local/Cellar/python/2.7.6/Frameworks/Python.framework/Versions/2.7/lib/python2.7/ctypes/__init__.py to ctypes/__init__.pyc
creating /opt/k/build/bdist.macosx-10.8-x86_64/python2.7-standalone/app/collect/ctypes
byte-compiling /usr/local/Cellar/python/2.7.6/Frameworks/Python.framework/Versions/2.7/lib/python2.7/ctypes/_endian.py to ctypes/_endian.pyc
byte-compiling /usr/local/Cellar/python/2.7.6/Frameworks/Python.framework/Versions/2.7/lib/python2.7/ctypes/wintypes.py to ctypes/wintypes.pyc
byte-compiling /usr/local/Cellar/python/2.7.6/Frameworks/Python.framework/Versions/2.7/lib/python2.7/difflib.py to difflib.pyc
byte-compiling /usr/local/Cellar/python/2.7.6/Frameworks/Python.framework/Versions/2.7/lib/python2.7/dis.py to dis.pyc
byte-compiling /usr/local/Cellar/python/2.7.6/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/__init__.py to distutils/__init__.pyc
creating /opt/k/build/bdist.macosx-10.8-x86_64/python2.7-standalone/app/collect/distutils
byte-compiling /usr/local/Cellar/python/2.7.6/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/dep_util.py to distutils/dep_util.pyc
byte-compiling /usr/local/Cellar/python/2.7.6/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/errors.py to distutils/errors.pyc
byte-compiling /usr/local/Cellar/python/2.7.6/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/log.py to distutils/log.pyc

...
copying file /usr/local/Cellar/pyside/1.2.1/lib/python2.7/site-packages/PySide/QtWebKit.so -> /opt/k/dist/TestApp.app/Contents/Resources/lib/python2.7/lib-dynload/PySide/QtWebKit.so
copying file /usr/local/Cellar/python/2.7.6/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/MacOS.so -> /opt/k/dist/TestApp.app/Contents/Resources/lib/python2.7/lib-dynload/MacOS.so
copying file /usr/local/Cellar/python/2.7.6/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/Nav.so -> /opt/k/dist/TestApp.app/Contents/Resources/lib/python2.7/lib-dynload/Nav.so
copying file /usr/local/Cellar/python/2.7.6/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/_AE.so -> /opt/k/dist/TestApp.app/Contents/Resources/lib/python2.7/lib-dynload/_AE.so
copying file /usr/local/Cellar/python/2.7.6/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/_Ctl.so -> /opt/k/dist/TestApp.app/Contents/Resources/lib/python2.7/lib-dynload/_Ctl.so
copying file /usr/local/Cellar/python/2.7.6/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/_Dlg.so -> /opt/k/dist/TestApp.app/Contents/Resources/lib/python2.7/lib-dynload/_Dlg.so
copying file /usr/local/Cellar/python/2.7.6/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/_Evt.so -> /opt/k/dist/TestApp.app/Contents/Resources/lib/python2.7/lib-dynload/_Evt.so
copying file /usr/local/Cellar/python/2.7.6/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/_File.so -> /opt/k/dist/TestApp.app/Contents/Resources/lib/python2.7/lib-dynload/_File.so
copying file /usr/local/Cellar/python/2.7.6/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/_Menu.so -> /opt/k/dist/TestApp.app/Contents/Resources/lib/python2.7/lib-dynload/_Menu.so
copying file /usr/local/Cellar/python/2.7.6/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/_Qd.so -> /opt/k/dist/TestApp.app/Contents/Resources/lib/python2.7/lib-dynload/_Qd.so
copying file /usr/local/Cellar/python/2.7.6/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/_Res.so -> /opt/k/dist/TestApp.app/Contents/Resources/lib/python2.7/lib-dynload/_Res.so
copying file /usr/local/Cellar/python/2.7.6/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/_Win.so -> /opt/k/dist/TestApp.app/Contents/Resources/lib/python2.7/lib-dynload/_Win.so
copying file /usr/local/Cellar/python/2.7.6/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/_bisect.so -> /opt/k/dist/TestApp.app/Contents/Resources/lib/python2.7/lib-dynload/_bisect.so
copying file /usr/local/Cellar/python/2.7.6/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/_codecs_cn.so -> /opt/k/dist/TestApp.app/Contents/Resources/lib/python2.7/lib-dynload/_codecs_cn.so
copying file /usr/local/Cellar/python/2.7.6/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/_codecs_hk.so -> /opt/k/dist/TestApp.app/Contents/Resources/lib/python2.7/lib-dynload/_codecs_hk.so
copying file /usr/local/Cellar/python/2.7.6/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/_codecs_iso2022.so -> /opt/k/dist/TestApp.app/Contents/Resources/lib/python2.7/lib-dynload/_codecs_iso2022.so
copying file /usr/local/Cellar/python/2.7.6/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/_codecs_jp.so -> /opt/k/dist/TestApp.app/Contents/Resources/lib/python2.7/lib-dynload/_codecs_jp.so
copying file /usr/local/Cellar/python/2.7.6/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/_codecs_kr.so -> /opt/k/dist/TestApp.app/Contents/Resources/lib/python2.7/lib-dynload/_codecs_kr.so
copying file /usr/local/Cellar/python/2.7.6/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/_codecs_tw.so -> /opt/k/dist/TestApp.app/Contents/Resources/lib/python2.7/lib-dynload/_codecs_tw.so
copying file /usr/local/Cellar/python/2.7.6/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/_collections.so -> /opt/k/dist/TestApp.app/Contents/Resources/lib/python2.7/lib-dynload/_collections.so
copying file /usr/local/Cellar/python/2.7.6/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/_ctypes.so -> /opt/k/dist/TestApp.app/Contents/Resources/lib/python2.7/lib-dynload/_ctypes.so
copying file /usr/local/Cellar/python/2.7.6/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/_elementtree.so -> /opt/k/dist/TestApp.app/Contents/Resources/lib/python2.7/lib-dynload/_elementtree.so
copying file /usr/local/Cellar/python/2.7.6/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/_functools.so -> /opt/k/dist/TestApp.app/Contents/Resources/lib/python2.7/lib-dynload/_functools.so
copying file /usr/local/Cellar/python/2.7.6/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/_hashlib.so -> /opt/k/dist/TestApp.app/Contents/Resources/lib/python2.7/lib-dynload/_hashlib.so
copying file /usr/local/Cellar/python/2.7.6/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/_heapq.so -> /opt/k/dist/TestApp.app/Contents/Resources/lib/python2.7/lib-dynload/_heapq.so
copying file /usr/local/Cellar/python/2.7.6/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/_io.so -> /opt/k/dist/TestApp.app/Contents/Resources/lib/python2.7/lib-dynload/_io.so
copying file /usr/local/Cellar/python/2.7.6/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/_locale.so -> /opt/k/dist/TestApp.app/Contents/Resources/lib/python2.7/lib-dynload/_locale.so
copying file /usr/local/Cellar/python/2.7.6/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/_multibytecodec.so -> /opt/k/dist/TestApp.app/Contents/Resources/lib/python2.7/lib-dynload/_multibytecodec.so
copying file /usr/local/Cellar/python/2.7.6/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/_random.so -> /opt/k/dist/TestApp.app/Contents/Resources/lib/python2.7/lib-dynload/_random.so
copying file /usr/local/Cellar/python/2.7.6/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/_scproxy.so -> /opt/k/dist/TestApp.app/Contents/Resources/lib/python2.7/lib-dynload/_scproxy.so
copying file /usr/local/Cellar/python/2.7.6/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/_socket.so -> /opt/k/dist/TestApp.app/Contents/Resources/lib/python2.7/lib-dynload/_socket.so
copying file /usr/local/Cellar/python/2.7.6/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/_ssl.so -> /opt/k/dist/TestApp.app/Contents/Resources/lib/python2.7/lib-dynload/_ssl.so
copying file /usr/local/Cellar/python/2.7.6/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/_struct.so -> /opt/k/dist/TestApp.app/Contents/Resources/lib/python2.7/lib-dynload/_struct.so
copying file /usr/local/Cellar/python/2.7.6/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/_testcapi.so -> /opt/k/dist/TestApp.app/Contents/Resources/lib/python2.7/lib-dynload/_testcapi.so
copying file /usr/local/Cellar/python/2.7.6/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/array.so -> /opt/k/dist/TestApp.app/Contents/Resources/lib/python2.7/lib-dynload/array.so
copying file /usr/local/Cellar/python/2.7.6/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/audioop.so -> /opt/k/dist/TestApp.app/Contents/Resources/lib/python2.7/lib-dynload/audioop.so
copying file /usr/local/Cellar/python/2.7.6/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/binascii.so -> /opt/k/dist/TestApp.app/Contents/Resources/lib/python2.7/lib-dynload/binascii.so
copying file /usr/local/Cellar/python/2.7.6/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/bz2.so -> /opt/k/dist/TestApp.app/Contents/Resources/lib/python2.7/lib-dynload/bz2.so
copying file /usr/local/Cellar/python/2.7.6/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/cPickle.so -> /opt/k/dist/TestApp.app/Contents/Resources/lib/python2.7/lib-dynload/cPickle.so
copying file /usr/local/Cellar/python/2.7.6/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/cStringIO.so -> /opt/k/dist/TestApp.app/Contents/Resources/lib/python2.7/lib-dynload/cStringIO.so
copying file /usr/local/Cellar/python/2.7.6/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/datetime.so -> /opt/k/dist/TestApp.app/Contents/Resources/lib/python2.7/lib-dynload/datetime.so
copying file /usr/local/Cellar/python/2.7.6/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/fcntl.so -> /opt/k/dist/TestApp.app/Contents/Resources/lib/python2.7/lib-dynload/fcntl.so
copying file /usr/local/Cellar/python/2.7.6/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/gestalt.so -> /opt/k/dist/TestApp.app/Contents/Resources/lib/python2.7/lib-dynload/gestalt.so
copying file /usr/local/Cellar/python/2.7.6/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/grp.so -> /opt/k/dist/TestApp.app/Contents/Resources/lib/python2.7/lib-dynload/grp.so
copying file /usr/local/Cellar/python/2.7.6/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/itertools.so -> /opt/k/dist/TestApp.app/Contents/Resources/lib/python2.7/lib-dynload/itertools.so
copying file /usr/local/Cellar/python/2.7.6/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/math.so -> /opt/k/dist/TestApp.app/Contents/Resources/lib/python2.7/lib-dynload/math.so
copying file /usr/local/Cellar/python/2.7.6/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/operator.so -> /opt/k/dist/TestApp.app/Contents/Resources/lib/python2.7/lib-dynload/operator.so
copying file /usr/local/Cellar/python/2.7.6/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/parser.so -> /opt/k/dist/TestApp.app/Contents/Resources/lib/python2.7/lib-dynload/parser.so
copying file /usr/local/Cellar/python/2.7.6/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/pyexpat.so -> /opt/k/dist/TestApp.app/Contents/Resources/lib/python2.7/lib-dynload/pyexpat.so
copying file /usr/local/Cellar/python/2.7.6/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/resource.so -> /opt/k/dist/TestApp.app/Contents/Resources/lib/python2.7/lib-dynload/resource.so
copying file /usr/local/Cellar/python/2.7.6/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/select.so -> /opt/k/dist/TestApp.app/Contents/Resources/lib/python2.7/lib-dynload/select.so
copying file /usr/local/Cellar/python/2.7.6/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/strop.so -> /opt/k/dist/TestApp.app/Contents/Resources/lib/python2.7/lib-dynload/strop.so
copying file /usr/local/Cellar/python/2.7.6/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/termios.so -> /opt/k/dist/TestApp.app/Contents/Resources/lib/python2.7/lib-dynload/termios.so
copying file /usr/local/Cellar/python/2.7.6/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/time.so -> /opt/k/dist/TestApp.app/Contents/Resources/lib/python2.7/lib-dynload/time.so
copying file /usr/local/Cellar/python/2.7.6/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/unicodedata.so -> /opt/k/dist/TestApp.app/Contents/Resources/lib/python2.7/lib-dynload/unicodedata.so
copying file /usr/local/Cellar/python/2.7.6/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/zlib.so -> /opt/k/dist/TestApp.app/Contents/Resources/lib/python2.7/lib-dynload/zlib.so
copying file test/blah/whatever.png -> /opt/k/dist/TestApp.app/Contents/Resources/test/Ikons/iphone_mail_icon.png
copying file test/jquery-1.8.3.min.js -> /opt/k/dist/TestApp.app/Contents/Resources/test/jquery-1.8.3.min.js
copying file test/jquery-ui.css -> /opt/k/dist/TestApp.app/Contents/Resources/test/jquery-ui.css
copying file test/jquery-ui.min.js -> /opt/k/dist/TestApp.app/Contents/Resources/test/jquery-ui.min.js
copying file test/jquery.jsPlumb-1.5.5-min.js -> /opt/k/dist/TestApp.app/Contents/Resources/test/jquery.jsPlumb-1.5.5-min.js
copying file test/normalize.css -> /opt/k/dist/TestApp.app/Contents/Resources/test/normalize.css
copying file test/phantomjs -> /opt/k/dist/TestApp.app/Contents/Resources/test/phantomjs
copying file test.htm -> /opt/k/dist/TestApp.app/Contents/Resources/test.htm
copying file /usr/local/Cellar/python/2.7.6/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/Resources/PythonApplet.icns -> /opt/k/dist/TestApp.app/Contents/Resources/PythonApplet.icns
copying file /usr/local/Cellar/python/2.7.6/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/py2app/recipes/qt.conf -> /opt/k/dist/TestApp.app/Contents/Resources/qt.conf
copying /usr/local/Cellar/python/2.7.6/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python -> /opt/k/dist/TestApp.app/Contents/MacOS/python
creating /opt/k/dist/TestApp.app/Contents/Frameworks/Python.framework
creating /opt/k/dist/TestApp.app/Contents/Frameworks/Python.framework/Versions
creating /opt/k/dist/TestApp.app/Contents/Frameworks/Python.framework/Versions/2.7
creating /opt/k/dist/TestApp.app/Contents/Frameworks/Python.framework/Versions/2.7/Resources
creating /opt/k/dist/TestApp.app/Contents/Frameworks/Python.framework/Versions/2.7/include
creating /opt/k/dist/TestApp.app/Contents/Frameworks/Python.framework/Versions/2.7/include/python2.7
creating /opt/k/dist/TestApp.app/Contents/Frameworks/Python.framework/Versions/2.7/lib
creating /opt/k/dist/TestApp.app/Contents/Frameworks/Python.framework/Versions/2.7/lib/python2.7
creating /opt/k/dist/TestApp.app/Contents/Frameworks/Python.framework/Versions/2.7/lib/python2.7/config
copying /usr/local/Cellar/python/2.7.6/Frameworks/Python.framework/Versions/2.7/Python -> /opt/k/dist/TestApp.app/Contents/Frameworks/Python.framework/Versions/2.7
copying /usr/local/Cellar/python/2.7.6/Frameworks/Python.framework/Versions/2.7/Python -> /opt/k/dist/TestApp.app/Contents/Frameworks/Python.framework/Versions/2.7
copying /usr/local/Cellar/python/2.7.6/Frameworks/Python.framework/Versions/2.7/Resources/Info.plist -> /opt/k/dist/TestApp.app/Contents/Frameworks/Python.framework/Versions/2.7/Resources
copying /usr/local/Cellar/python/2.7.6/Frameworks/Python.framework/Versions/2.7/include/python2.7/pyconfig.h -> /opt/k/dist/TestApp.app/Contents/Frameworks/Python.framework/Versions/2.7/include/python2.7
copying /usr/local/Cellar/python/2.7.6/Frameworks/Python.framework/Versions/2.7/lib/python2.7/config/Makefile -> /opt/k/dist/TestApp.app/Contents/Frameworks/Python.framework/Versions/2.7/lib/python2.7/config
Traceback (most recent call last):
  File "setup.py", line 24, in <module>
    setup_requires=['py2app'],
  File "/usr/local/Cellar/python/2.7.6/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/core.py", line 152, in setup
    dist.run_commands()
  File "/usr/local/Cellar/python/2.7.6/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/dist.py", line 953, in run_commands
    self.run_command(cmd)
  File "/usr/local/Cellar/python/2.7.6/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/dist.py", line 972, in run_command
    cmd_obj.run()
  File "/usr/local/Cellar/python/2.7.6/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/py2app/build_app.py", line 553, in run
    self._run()
  File "/usr/local/Cellar/python/2.7.6/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/py2app/build_app.py", line 741, in _run
    self.run_normal()
  File "/usr/local/Cellar/python/2.7.6/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/py2app/build_app.py", line 831, in run_normal
    self.create_binaries(py_files, pkgdirs, extensions, loader_files)
  File "/usr/local/Cellar/python/2.7.6/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/py2app/build_app.py", line 978, in create_binaries
    platfiles = mm.run()
  File "/usr/local/Cellar/python/2.7.6/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/macholib/MachOStandalone.py", line 105, in run
    mm.run_file(fn)
  File "/usr/local/Cellar/python/2.7.6/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/macholib/MachOGraph.py", line 70, in run_file
    m = self.createNode(MachO, pathname)
  File "/usr/local/Cellar/python/2.7.6/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/macholib/MachOStandalone.py", line 19, in createNode
    res = super(FilteredMachOGraph, self).createNode(cls, name)
  File "/usr/local/Cellar/python/2.7.6/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/altgraph/ObjectGraph.py", line 165, in createNode
    m = cls(name, *args, **kw)
  File "/usr/local/Cellar/python/2.7.6/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/macholib/MachO.py", line 69, in __init__
    self.load(fp)
  File "/usr/local/Cellar/python/2.7.6/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/macholib/MachO.py", line 84, in load
    self.load_header(fh, 0, size)
  File "/usr/local/Cellar/python/2.7.6/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/macholib/MachO.py", line 114, in load_header
    hdr = MachOHeader(self, fh, offset, size, magic, hdr, endian)
  File "/usr/local/Cellar/python/2.7.6/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/macholib/MachO.py", line 154, in __init__
    self.load(fh)
  File "/usr/local/Cellar/python/2.7.6/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/macholib/MachO.py", line 247, in load
    self.total_size, low_offset))

`

It's been driving me insane! I've installed macports, same error. Removed, installed homebrew versions, same error.

Here's setup.py:

from setuptools import setup

APP = ['blah.py']
DATA_FILES = ['test', 'test.htm']
OPTIONS = {'argv_emulation': False}

setup(
    name = "TestApp",
    version = "0.9.0",
    app=APP,
    data_files=DATA_FILES,
    options={'py2app': OPTIONS},
    setup_requires=['py2app'],
)
1

There are 1 best solutions below

0
On

Are you on Mavericks? I'm running into the same problem with a fresh install of py2app on Mavericks. Looks like (in MachO.py) MachO is evaluating its maximum allowable header size (low_offset) as zero, which of course makes no sense.

In my case, it was happening at this line:

                if cmd_cmd.filesize != 0 :
                    low_offset = min(low_offset, cmd_cmd.fileoff)

As a result of loading this module:

.../lib/python2.7/lib-dynload/_mysql.so

Right now my mySQLdb installation has a python version mismatch with certain libraries I'm using, which may be the culprit. I was able to work around the error by changing the above code in MachO.py to this:

                if cmd_cmd.filesize != 0 **and cmd_cmd.fileoff != 0** :
                    low_offset = min(low_offset, cmd_cmd.fileoff)

By no means a satisfactory solution, but it allowed me to deploy a needed app. When I resolve my python version mismatch, I will update with the outcome.

What worked for you?