[Pythonmac-SIG] Framework does not get copied for standalone build: 0.4.3

hari jayaram harijay at gmail.com
Fri Oct 16 09:20:01 CEST 2009


Hi Ronald.
1) python -c 'import sys; print sys.prefix'  returns

/Library/Frameworks/Python.framework/Versions/2.6

2) My Simple sayhello.py

#!/usr/bin/python
import wx
class MyFrame(wx.Frame):

        def __init__(self,*args,**kwds):
                kwds["size"] = (640,480)
                wx.Frame.__init__(self,*args,**kwds)
                self.Show()
if __name__ == "__main__":
        ma = wx.PySimpleApp()
        f = MyFrame(None,-1,title="An App:Hello world")
        ma.MainLoop()

3) setup.py I used to build
"""
This is a setup.py script generated by py2applet

Usage:
    python setup.py py2app
"""

from setuptools import setup

APP = ['sayhello.py']
DATA_FILES = []
OPTIONS = {'argv_emulation': True, 'iconfile': './gzilla_ico_fin.icns', 'semi_st
andalone': 'False'}

setup(
    app=APP,
    data_files=DATA_FILES,
    options={'py2app': OPTIONS},
    setup_requires=['py2app'],
)

4)Error when I run bundle:
A Python runtime could be located.  You may need to install a
framework build of Python, or edit the PyRuntimeLocations array in
this application's Info.plist file.

5) This seems to be because the Info.plist refers to the framework at
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN"
"http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<string>@executable_path/../Frameworks/Python.framework/Versions/2.6/Python</string>
</plist>

6) There is no framework copied to that location in the bundle

harijaymac:hello hari$ cd dist/sayhello.app/Contents/Frameworks/
harijaymac:Frameworks hari$ ls
libwx_macud-2.8.0.dylib

7) If I make the directory Python.framework/Versions/Versions/2.6
inside @executable_path/../Frameworks and copy over the framework
Python manuakly into the bundle.

so :
cp /Library/Frameworks/Python.framework/Versions/2.6/Python
/dist/sayhello.app/Contents/Frameworks/Python.framework/Versions/2.6/


Then sayhello.ap works just fine


Hope this helps
Hari


On Fri, Oct 16, 2009 at 1:02 AM, Ronald Oussoren <ronaldoussoren at mac.com> wrote:
>
> On 15 Oct, 2009, at 5:36, Chris Barker wrote:
>
>> hari jayaram wrote:
>>>
>>> In my several tests over the last few days. I can definitely say that
>>> without forcing the standalone build , when I used the python from
>>> python.org ( both 2.5.5 and 2.6.3) . py2app never created a standalone
>>> build. It bundles the required libraries but never includes the system
>>> python. That results in bundles that give a wx/_core_.so not dound
>>> error.
>>> This may be a Leopard feature with  the python downloaded from
>>> python.org but without setting semi_standalone:False I never get a
>>> standalone build withuprobably  these pythons and py2app.
>>> If I use the very basic setup.py that Chris Barker mentioned. Then not
>>> only do I not get the python built into the bundle . But the linking
>>> is all messed up and I get the error.
>>
>> I think those two are the same error -- it's trying to link relative to
>> the python exe.
>>
>> Anyway, it appears you've found a bug. What I'm not clear on is if it's
>> working OK for anyone else on a 10.6 system -- if so, then I wonder what is
>> different about yours? (sorry to question the obvious again, but are
>> absolutely sure that you are running py2app with the python you think you
>> are?)
>>
>> This is going to take a bit of debugging. I think Ronald may be the only
>> one that knows the guts of py2app at all, and I don't know if he's got the
>> time, or can even duplicate the problem, so you may need to do it yourself
>> -- or, if  you've got something working, maybe not bother!
>
> Hari: could you try to create a simple hello-world style program with a
> setup.py that has the same problem on your machine? That would make it a lot
> easier to debug the problem.
>
> Also, what's the output of of the following command:
>
>        python -c 'import sys; print sys.prefix'
>
> Run this in the same way to run setup.py.
>
> BTW. If you do resolve the issue please let us know about it, knowing what's
> wrong can help us improve py2app or its documentation. And at the very least
> this will help others that run into the same issue.
>
> Ronald


More information about the Pythonmac-SIG mailing list