[Pythonmac-SIG] Py2app error

Mark Livingstone livingstonemark at gmail.com
Thu Aug 2 04:15:20 CEST 2012


Hi Guys,

OK, taking Chris' advice, I installed on a Snow Leopard machine:

cheyenne:dist marklivingstone$ ls ~/Downloads/
About Downloads.lpdf					numpy-1.6.2-py2.7-python.org-macosx10.3.dmg		wxMac-2.8.12.tar
matplotlib-1.1.0-py2.7-python.org-macosx10.3.dmg	python-2.7.3-macosx10.6.dmg				wxPython2.8-osx-docs-demos-2.8.12.1-universal-py2.7.dmg
mercurial-2.2.3_20120707-py2.7-macosx10.7		scipy-0.11.0rc1-py2.7-python.org-macosx10.6.dmg		wxPython2.8-osx-unicode-2.8.12.1-universal-py2.7.dmg

Then I went to Ronald's Bitbucket and built a current py2app setup.

I tried a build but got this:

 python ../mac-setup/setup_py2app.py py2app
Traceback (most recent call last):
  File "../mac-setup/setup_py2app.py", line 1, in <module>
    import wx
  File "/usr/local/lib/wxPython-unicode-2.8.12.1/lib/python2.7/site-packages/wx-2.8-mac-unicode/wx/__init__.py",
line 45, in <module>
    from wx._core import *
  File "/usr/local/lib/wxPython-unicode-2.8.12.1/lib/python2.7/site-packages/wx-2.8-mac-unicode/wx/_core.py",
line 4, in <module>
    import _core_
ImportError: dlopen(/usr/local/lib/wxPython-unicode-2.8.12.1/lib/python2.7/site-packages/wx-2.8-mac-unicode/wx/_core_.so,
2): no suitable image found.  Did find:
	/usr/local/lib/wxPython-unicode-2.8.12.1/lib/python2.7/site-packages/wx-2.8-mac-unicode/wx/_core_.so:
no matching architecture in universal wrapper
cheyenne:src marklivingstone$

I then did "python-32 ../mac-setup/setup_py2app.py py2app" , and built
using py2app my Salstat.app which built fine and created a
dist/Salstat.app

However, when I try to run the app, I get the following in the console log:


2/08/12 12:06:23.340 PM [0x0-0x421421].com.SalStat.SalStat:
/Users/marklivingstone/Documents/workspace/salstat-statistics-package-2/src/dist/SalStat.app/Contents/Resources/salstat.py:585:
SyntaxWarning: import * only allowed at module level
2/08/12 12:06:23.372 PM [0x0-0x421421].com.SalStat.SalStat:
argvemulator warning: fetching events failed
2/08/12 12:06:23.372 PM [0x0-0x421421].com.SalStat.SalStat: Traceback
(most recent call last):
2/08/12 12:06:23.372 PM [0x0-0x421421].com.SalStat.SalStat:   File
"/Users/marklivingstone/Documents/workspace/salstat-statistics-package-2/src/dist/SalStat.app/Contents/Resources/__boot__.py",
line 319, in <module>
2/08/12 12:06:23.373 PM [0x0-0x421421].com.SalStat.SalStat:
_run('salstat.py')
2/08/12 12:06:23.373 PM [0x0-0x421421].com.SalStat.SalStat:   File
"/Users/marklivingstone/Documents/workspace/salstat-statistics-package-2/src/dist/SalStat.app/Contents/Resources/__boot__.py",
line 311, in _run
2/08/12 12:06:23.374 PM [0x0-0x421421].com.SalStat.SalStat:
exec(compile(source, path, 'exec'), globals(), globals())
2/08/12 12:06:23.374 PM [0x0-0x421421].com.SalStat.SalStat:   File
"/Users/marklivingstone/Documents/workspace/salstat-statistics-package-2/src/dist/SalStat.app/Contents/Resources/salstat.py",
line 9, in <module>
2/08/12 12:06:23.374 PM [0x0-0x421421].com.SalStat.SalStat:     import wx
2/08/12 12:06:23.374 PM [0x0-0x421421].com.SalStat.SalStat:   File
"wx/__init__.pyc", line 45, in <module>
2/08/12 12:06:23.374 PM [0x0-0x421421].com.SalStat.SalStat:   File
"wx/_core.pyc", line 4, in <module>
2/08/12 12:06:23.375 PM [0x0-0x421421].com.SalStat.SalStat:   File
"wx/_core_.pyc", line 18, in <module>
2/08/12 12:06:23.375 PM [0x0-0x421421].com.SalStat.SalStat:   File
"wx/_core_.pyc", line 11, in __load
2/08/12 12:06:23.375 PM [0x0-0x421421].com.SalStat.SalStat:
ImportError: dlopen(/Users/marklivingstone/Documents/workspace/salstat-statistics-package-2/src/dist/SalStat.app/Contents/Resources/lib/python2.7/lib-dynload/wx/_core_.so,
2): no suitable image found.  Did find:
2/08/12 12:06:23.375 PM [0x0-0x421421].com.SalStat.SalStat:
	/Users/marklivingstone/Documents/workspace/salstat-statistics-package-2/src/dist/SalStat.app/Contents/Resources/lib/python2.7/lib-dynload/wx/_core_.so:
no matching architecture in universal wrapper
2/08/12 12:06:23.479 PM SalStat: SalStat Error
2/08/12 12:06:25.919 PM com.apple.launchd.peruser.501:
([0x0-0x421421].com.SalStat.SalStat[76293]) Exited with code: 255

Is it just not possible to use py2app to create an app for the Mac based on wx?

Also, the final result turns in at 184MB in size. Are there any common
things that may be being pulled in that I should exclude?

Thanks in advance,

MarkL



More information about the Python-list mailing list