Framework does not get copied for standalone build: 0.4.3

View: New views
7 Messages — Rating Filter:   Alert me  

Framework does not get copied for standalone build: 0.4.3

by harijay :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

My py2applet build_app.py script has the following line in line 911
        pydir = 'python%s'%(info['version'])

When I force a standalone build, the Frameworks directory has no
Python.Framework

The info.plist is setup correctly  with the value :
@executable_path/../Frameworks/Python.framework/Versions/2.6/Python
If I manually copy the framework to the bundle the bundle works.

SO my  questions are :
1) Is the bundle now standalone and universal i.e can I run it on
Tiger and Leopard , intel and powerpc
2) What should line 911 read to have the Framework copied over correctly


Thanks
hari


"""
This is a setup.py script generated by py2applet

Usage:
    python setup.py py2app
"""

from setuptools import setup

APP = ['GridZilla.py']
DATA_FILES = []
OPTIONS = {'argv_emulation': True,
'semi_standalone':False,
 'iconfile': './gzilla_ico_fin.icns',
 'includes': 'wx,reportlab,yaml',
'packages':('wx','reportlab','yaml'),
'site_packages': True}

setup(
    app=APP,
    data_files=DATA_FILES,
    options={'py2app': OPTIONS},
    setup_requires=['py2app'],
)
_______________________________________________
Pythonmac-SIG maillist  -  Pythonmac-SIG@...
http://mail.python.org/mailman/listinfo/pythonmac-sig

Re: Framework does not get copied for standalone build: 0.4.3

by Kevin Walzer-5 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On 10/14/09 10:45 AM, hari jayaram wrote:

> My py2applet build_app.py script has the following line in line 911
>          pydir = 'python%s'%(info['version'])
>
> When I force a standalone build, the Frameworks directory has no
> Python.Framework
>
> The info.plist is setup correctly  with the value :
> @executable_path/../Frameworks/Python.framework/Versions/2.6/Python
> If I manually copy the framework to the bundle the bundle works.
>
> SO my  questions are :
> 1) Is the bundle now standalone and universal i.e can I run it on
> Tiger and Leopard , intel and powerpc
> 2) What should line 911 read to have the Framework copied over correctly
>

I wonder if the problem is with py2applet and the build script it
generates? Writing your own setup.py script for py2app isn't very hard,
and wxPython is well-supported by py2app. Try writing your own script
and see what happens.
--
Kevin Walzer
Code by Kevin
http://www.codebykevin.com
_______________________________________________
Pythonmac-SIG maillist  -  Pythonmac-SIG@...
http://mail.python.org/mailman/listinfo/pythonmac-sig

Re: Framework does not get copied for standalone build: 0.4.3

by Christopher Barker :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Kevin Walzer wrote:
  I wonder if the problem is with py2applet and the build script it
> generates?

Maybe, you seem to be making this more  complicated than it should be.
This should do it:

from setuptools import setup

APP = ['GridZilla.py']
DATA_FILES = []
OPTIONS = {'argv_emulation': True,
            'iconfile': './gzilla_ico_fin.icns',
            }

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

i.e. If you aren't using the system python, it should build a
stand-alone, and you shouldn't need to explicitly include wx, and
certainly not as packages and includes.

I'm not totally sure about yaml or report lab, but try without first.

-Chris



--
Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR&R            (206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115       (206) 526-6317   main reception

Chris.Barker@...
_______________________________________________
Pythonmac-SIG maillist  -  Pythonmac-SIG@...
http://mail.python.org/mailman/listinfo/pythonmac-sig

Re: Framework does not get copied for standalone build: 0.4.3

by harijay :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Thanks for your emails ..

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 with 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.
"ImportError: '/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/lib-dynload/wx/_core_.so'
not found"

Inside the  bundle I see a symlinked python
python -> /Library/Frameworks/Python.framework/Versions/2.6/Resources/Python.app/Contents/MacOS/Python

So I feel something is very different and with 0.4.2 and 0.4.3 I do
not get standalone builds without explicity stating anything . The
wordy setup.py was a result of numerous trials ..which finally gave me
a app bundle into which I copied the Python Framework manually and
then the bundle worked.

Hari


On Wed, Oct 14, 2009 at 9:46 PM, Chris Barker <Chris.Barker@...> wrote:

> Kevin Walzer wrote:
>  I wonder if the problem is with py2applet and the build script it
>>
>> generates?
>
> Maybe, you seem to be making this more  complicated than it should be. This
> should do it:
>
> from setuptools import setup
>
> APP = ['GridZilla.py']
> DATA_FILES = []
> OPTIONS = {'argv_emulation': True,
>           'iconfile': './gzilla_ico_fin.icns',
>           }
>
> setup(
>    app=APP,
>    options={'py2app': OPTIONS},
>    setup_requires=['py2app'],
> )
>
> i.e. If you aren't using the system python, it should build a stand-alone,
> and you shouldn't need to explicitly include wx, and certainly not as
> packages and includes.
>
> I'm not totally sure about yaml or report lab, but try without first.
>
> -Chris
>
>
>
> --
> Christopher Barker, Ph.D.
> Oceanographer
>
> Emergency Response Division
> NOAA/NOS/OR&R            (206) 526-6959   voice
> 7600 Sand Point Way NE   (206) 526-6329   fax
> Seattle, WA  98115       (206) 526-6317   main reception
>
> Chris.Barker@...
> _______________________________________________
> Pythonmac-SIG maillist  -  Pythonmac-SIG@...
> http://mail.python.org/mailman/listinfo/pythonmac-sig
>
_______________________________________________
Pythonmac-SIG maillist  -  Pythonmac-SIG@...
http://mail.python.org/mailman/listinfo/pythonmac-sig

Re: Framework does not get copied for standalone build: 0.4.3

by Christopher Barker :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

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!

If you do, try running it in a debugger, or simply sprinkling print
statements around, and see if you can see why it's  getting confused
about when to build stand-alone -- you may try grepping the source for
"standalone" or something to find the relevant code.

Last note; even if you do need some of your tricks, you probably don't
need to explicitly include wxPython, and certainly not as both
"packages" and "includes"

good luck,

-Chris

--
Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR&R            (206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115       (206) 526-6317   main reception

Chris.Barker@...
_______________________________________________
Pythonmac-SIG maillist  -  Pythonmac-SIG@...
http://mail.python.org/mailman/listinfo/pythonmac-sig

Re: Framework does not get copied for standalone build: 0.4.3

by Ronald Oussoren :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


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

_______________________________________________
Pythonmac-SIG maillist  -  Pythonmac-SIG@...
http://mail.python.org/mailman/listinfo/pythonmac-sig

smime.p7s (4K) Download Attachment

Re: Framework does not get copied for standalone build: 0.4.3

by harijay :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

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@...> 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
_______________________________________________
Pythonmac-SIG maillist  -  Pythonmac-SIG@...
http://mail.python.org/mailman/listinfo/pythonmac-sig