[Pythonmac-SIG] py2app failure with framework build of 2.7

Nat Echols nathaniel.echols at gmail.com
Thu Apr 4 01:12:41 CEST 2013


Replying to my own post: after sending this, I read the section in the
documentation about "alias mode".  This seems to work fine, and
produces an app that is 50KB instead of nearly 9MB.  Since I'm running
this script as part of a complicated build and installation process,
and the path to the interpreter and all modules is frozen by the time
I need to make my app, it would seem that alias mode should work fine
for actually *deploying* my software.  Is there any drawback to doing
this?

thanks,
Nat

On Wed, Apr 3, 2013 at 3:45 PM, Nat Echols <nathaniel.echols at gmail.com> wrote:
> I'm trying to make a simple iconified Python launcher for a shell
> script, and something I'm doing isn't working, despite having used
> py2app successfully before.  The target Python program
> ("my_program_wrapper.py") consists of this:
>
> import os
> import sys
> os.environ["PYTHONPATH"] = ""
> os.spawnv(os.P_NOWAIT, "/Users/nat/bin/my_program", ["my_program"])
>
> I then run this:
>
> /path/to/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python
> Python.framework/Versions/Current/lib/python2.7/site-packages/py2app-0.7.3-py2.7.egg/py2app/script_py2applet.py
> --make-setup my_program_wrapper.py
>
> which is fine, and gives me this for setup.py:
>
> ####
> from setuptools import setup
>
> APP = ['my_program_wrapper.py']
> DATA_FILES = []
> OPTIONS = {'argv_emulation': False,
>  'iconfile': '/Users/nat/my_program.icns'}
>
> setup(
>     app=APP,
>     data_files=DATA_FILES,
>     options={'py2app': OPTIONS},
>     setup_requires=['py2app'],
> )
> ####
>
> Then I run this:
>
> /path/to/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python
> setup.py py2app
>
> and that runs for a few seconds, prints a bunch of output, then crashes here:
>
> creating /Users/nat/Desktop/py2app_tmp/py2app_tmp/dist/phenix.app/Contents/Frameworks/Python.framework
> creating /Users/nat/Desktop/py2app_tmp/py2app_tmp/dist/phenix.app/Contents/Frameworks/Python.framework/Versions
> creating /Users/nat/Desktop/py2app_tmp/py2app_tmp/dist/phenix.app/Contents/Frameworks/Python.framework/Versions/Current
> creating /Users/nat/Desktop/py2app_tmp/py2app_tmp/dist/phenix.app/Contents/Frameworks/Python.framework/Versions/Current/Resources
> error: File exists
>
> It works fine if I use /usr/bin/python instead, but that isn't an
> option because this needs to be able to run on OS 10.4, which has
> Python 2.3 (which chokes on an import in py2app).  Am I doing
> something wrong, or is this a bug?
>
> thanks,
> Nat


More information about the Pythonmac-SIG mailing list