OSX intel and ppc
py2app does not make a working .app
there are problems loading modles/libs when the .app is double clicked.
have to watch out that py2app changes the install_name of the .so and .dylib that are packaged into the .app bundle
this is done by macholib i think.
not sure if its working properly in our case
install_names of mach-o libs inside the .app
should be changed to something like
@executable_path/../Rsources
or
@executable_path/../Frameworks
or something, depending on where they get placed,
so the .dylib and .so look inside the application bundle for each other at runtime.
Anonymous
Logged In: YES
user_id=1024930
Originator: NO
I've succesfully produced apps for mac so I guess this is kinda fixed. Need to document the steps for .app though.
on OSX 10.5 py2app is looking in the wrong place for python ITK stuff.
on 10.4 python frameworks were in /Library
on 10.5 they are in /System/Library since python got moved in to the /System
note that for VTKBXD python stuff to work on OSX 10.5 one must manually copy stuff to
/Library/Python/2.5/site-packages/vtkbxd/.
and
/Library/Python/2.5/site-packages/vtkbxd.pth
this is a problem with VTKBXD install i think,
as ITK seems to get this right by default .
(this info is entered in system as its own bug report...)
here is the output of py2app
copying Modules/XMLGUI/Number.py -> /Users/dan/Documents/BioImageXDProject/BioimageXD/svn/dist/BioImageXD.app/Contents/Resources/Modules/XMLGUI
Traceback (most recent call last):
File "/System/Library/Frameworks/Python.framework/Versions/2.5/Extras/lib/python/py2app/build_app.py", line 570, in _run
self.run_normal()
File "/System/Library/Frameworks/Python.framework/Versions/2.5/Extras/lib/python/py2app/build_app.py", line 641, in run_normal
self.create_binaries(py_files, pkgdirs, extensions, loader_files)
File "/System/Library/Frameworks/Python.framework/Versions/2.5/Extras/lib/python/py2app/build_app.py", line 736, in create_binaries
target, arcname, pkgexts, copyexts, target.script)
File "/System/Library/Frameworks/Python.framework/Versions/2.5/Extras/lib/python/py2app/build_app.py", line 1138, in build_executable
self.copy_file(src, dest)
File "/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/distutils/cmd.py", line 376, in copy_file
dry_run=self.dry_run)
File "/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/distutils/file_util.py", line 119, in copy_file
"can't copy '%s': doesn't exist or not a regular file" % src
DistutilsFileError: can't copy '/Library/Frameworks/Python.framework/Versions/2.5/lib/InsightToolkit': doesn't exist or not a regular file
svn 1505, OSX 10.5, py2aqpp makes a .app, but double clocking it results in a crash almost immediately. Running the BioImgeXD executable from with ing the bundle on the command line gives
intel-lmf-white8core:MacOS dan$ ./BioImageXD
Fatal Python error: Interpreter not initialized (version mismatch?)
Abort trap
but running the python executable that is alsong side the BioImageXD ececutable in the MacOS dir launched the command line interpreter for python 2.5 (copied from the system python 2.5) with no errors.
Maybe we are giving the python launcher bad arguments? - Dan
by the power of google i learn that this error can be caused by:
it's triggered if Py_InitModule is called (usually by an extension
module) before the interpreter itself has been initialized.
maybe there is a clue there
i upgraded my py2app to 0.3.6-py2.5 , involving installing setuptools 0.6c9-py2.5 as per instructions at the py2app webpage. ,
then modified build.py accordingly, so the setup method is from setuptools not the old distutils.core,
this is refelcted in svn 1506:
setup(
app=['BioImageXD.py'],
setup_requires=["py2app"], # added for using new py2app with setuptools
data_files = dataFiles,
options = dict( py2app = py2app_options )
)
now py2app fails during the
*** byte compile python files ***
stage. Looks like some mthod for detecting if files have been modifies or not is being passed and empty parameter or variable? :
byte-compiling /Library/Python/2.5/site-packages/py2app-0.3.6-py2.5.egg/py2app/bootstrap/argv_emulation.py to argv_emulation.pyc
byte-compiling /Library/Python/2.5/site-packages/py2app-0.3.6-py2.5.egg/py2app/bootstrap/boot_app.py to boot_app.pyc
byte-compiling /Library/Python/2.5/site-packages/py2app-0.3.6-py2.5.egg/py2app/bootstrap/chdir_resource.py to chdir_resource.pyc
byte-compiling /Library/Python/2.5/site-packages/py2app-0.3.6-py2.5.egg/py2app/bootstrap/disable_linecache.py to disable_linecache.pyc
byte-compiling /Library/Python/2.5/site-packages/py2app-0.3.6-py2.5.egg/py2app/recipes/PIL/prescript.py to prescript.pyc
Traceback (most recent call last):
File "/Library/Python/2.5/site-packages/py2app-0.3.6-py2.5.egg/py2app/build_app.py", line 548, in _run
self.run_normal()
File "/Library/Python/2.5/site-packages/py2app-0.3.6-py2.5.egg/py2app/build_app.py", line 619, in run_normal
self.create_binaries(py_files, pkgdirs, extensions, loader_files)
File "/Library/Python/2.5/site-packages/py2app-0.3.6-py2.5.egg/py2app/build_app.py", line 683, in create_binaries
dry_run=self.dry_run)
File "/Library/Python/2.5/site-packages/py2app-0.3.6-py2.5.egg/py2app/util.py", line 204, in byte_compile
if force or newer(mod.filename, cfile):
File "/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/distutils/dep_util.py", line 22, in newer
raise DistutilsFileError, "file '%s' does not exist" % source
DistutilsFileError: file '/Library/Python/2.5/site-packages/setuptools-0.6c9-py2.5.egg/pkg_resources.pyc' does not exist