Issues

Issue #23 resolved

build fails with optimize = 1 or 2 and from local eggs

Anonymous created an issue

I'm using 0.6.3.

I was running py2app with the eggs in my local dir (not installed in site-packages). This worked without optimization but if O1 or O2 then build fails with the error below.

If I install to site-packages then everything works.

==== {{{ byte compile python files writing byte-compilation script '/var/folders/fD/fD7kmk1zHSy-4wj-UI-9-U+++TU/-Tmp-/tmpPf0BB4.py' /Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python -O /var/folders/fD/fD7kmk1zHSy-4wj-UI-9-U+++TU/-Tmp-/tmpPf0BB4.py Traceback (most recent call last): File "/var/folders/fD/fD7kmk1zHSy-4wj-UI-9-U+++TU/-Tmp-/tmpPf0BB4.py", line 2, in <module> from py2app.util import byte_compile ImportError: No module named py2app.util error: command '/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python' failed with exit status 1 }}}

Comments (3)

  1. Ronald Oussoren repo owner

    py2app generates a compilation script when the optimization level for the interpreter is different than that specified with the py2app command, for example with:

        python setup.py py2app -O1
    

    or even:

       python -OO setup.py py2app -O0
    

    What py2app doesn't do is making sure that is on the PYTHONPATH of the script it runs, and that seems to cause this problems.

    There are two quick workarounds:

    1) Install py2app

    2) Use "python -O setup.py p2app -O1" to build the application bundle

    I'm working on bugfix for this.

  2. Ronald Oussoren repo owner

    I've committed a fix for this.

    Py2app still doesn't work properly when it is in an egg file, but that shouldn't cause problems because we're using 'zip_safe=False' in py2app-s setup.py file and hence setuptools will extract the egg-file before using it.

  3. Log in to comment