[pygtk] PyGTK - py2app - Mac OS X

Arjan Molenaar gaphor at gmail.com
Thu Oct 13 22:20:35 WST 2011


Hi,

I was a bit disappointed in the capabilities of py2app in combination with PyGTK.

I wrote a blog how to package a Python app with a simple shell script.

http://blog.xebia.com/2011/03/31/bundling-a-python-application-on-mac-os-x-with-virtualenv/

Hope this helps,

Arjan

On 23 Sep 2011, at 18:15, Antoine Martin wrote:

> On 23/09/11 23:07, Shrihari Sankaran wrote:
>>>  If you want to bundle PyGTK for OSX, you should probably take a look at:
>>> 
>>> http://gtk-osx.sourceforge.net/
>>> 
>>> Which will give you a native GTK (no need for X11), and in particular:
>>> 
>>> http://sourceforge.net/apps/trac/gtk-osx/wiki/Bundle
>>> 
>>> A great step by step guide is here:
>>> 
>>> http://code.google.com/p/tryton/wiki/BuildingMacOSXInstall
>>>> Cheers
>>>> 
>>> Antoine
>>> 
>> Does this work with PyGTK? Is there a guide available specifically for
>> PyGTK?
>> 
> It does work with PyGTK, Tryton uses PyGTK and so does winswitch:
> http://winswitch.org/dev/macosx.html
> 
> Cheers
> Antoine
> 
>> 
>> Thanks,
>> Shrihari
>> 
>> 
>> On Fri, Sep 23, 2011 at 1:27 PM, Shrihari Sankaran 
>> <gfxindia at gmail.com>
>> wrote:
>> 
>> 
>>> On Fri, Sep 23, 2011 at 11:46 AM, Anders F Björklund <
>>> 
>>> afb at users.sourceforge.net
>>> > wrote:
>>> 
>>> 
>>>> Shrihari Sankaran wrote:
>>>> 
>>>> 
>>>>> Recently I managed to install PyGTK on my Mac and the app runs pretty
>>>>> 
>>>> decently on it too, but with few glitches. But, when I try to convert it
>>>> into an 'app', the build is successful. When I run the app, i get the
>>>> following errors:
>>>> 
>>>>> 22/09/11 10:10:06.791 PM
>>>>> 
>>>> [0x0-0xb43b43].org.pythonmac.unspecified.movie_monkey: <_FuncPtr object at
>>>> 0x1003d7ef0>
>>>> 
>>>>> 22/09/11 10:10:06.791 PM
>>>>> 
>>>> [0x0-0xb43b43].org.pythonmac.unspecified.movie_monkey: Traceback (most
>>>> recent call last):
>>>> 
>>>>> 22/09/11 10:10:06.791 PM
>>>>> 
>>>> [0x0-0xb43b43].org.pythonmac.unspecified.movie_monkey:   File
>>>> "/opt/gtk/bin/mm/dist/movie_monkey.app/Contents/Resources/__boot__.py", line
>>>> 179, in <module>
>>>> 
>>>>> 22/09/11 10:10:06.791 PM
>>>>> 
>>>> [0x0-0xb43b43].org.pythonmac.unspecified.movie_monkey:     _argv_emulation()
>>>> 
>>>>> 22/09/11 10:10:06.791 PM
>>>>> 
>>>> [0x0-0xb43b43].org.pythonmac.unspecified.movie_monkey:   File
>>>> "/opt/gtk/bin/mm/dist/movie_monkey.app/Contents/Resources/__boot__.py", line
>>>> 177, in _argv_emulation
>>>> 
>>>>> 22/09/11 10:10:06.791 PM
>>>>> 
>>>> [0x0-0xb43b43].org.pythonmac.unspecified.movie_monkey:
>>>> _get_argvemulator().mainloop()
>>>> 
>>>>> 22/09/11 10:10:06.791 PM
>>>>> 
>>>> [0x0-0xb43b43].org.pythonmac.unspecified.movie_monkey:   File
>>>> "/opt/gtk/bin/mm/dist/movie_monkey.app/Contents/Resources/__boot__.py", line
>>>> 101, in mainloop
>>>> 
>>>>> 22/09/11 10:10:06.791 PM
>>>>> 
>>>> [0x0-0xb43b43].org.pythonmac.unspecified.movie_monkey:     stoptime =
>>>> Evt.TickCount() + timeout
>>>> 
>>>>> 22/09/11 10:10:06.791 PM
>>>>> 
>>>> [0x0-0xb43b43].org.pythonmac.unspecified.movie_monkey: AttributeError:
>>>> 'module' object has no attribute 'TickCount'
>>>> 
>>>>> 22/09/11 10:10:06.863 PM movie_monkey: movie_monkey Error
>>>>> 22/09/11 10:10:07.790 PM com.apple.launchd.peruser.501:
>>>>> 
>>>> ([0x0-0xb43b43].org.pythonmac.unspecified.movie_monkey[8704]) Exited with
>>>> code: 255
>>>> 
>>>> This problem comes from py2app running as 64-bit, trying to use Carbon...
>>>> You need to e.g. set the environment VERSIONER_PYTHON_PREFER_32_BIT=yes
>>>> 
>>>> Or use something else to make the bundle, that is compatible with x86_64.
>>>> If you update macholib and py2app to the latest, it should be fixed too ?
>>>> 
>>>> --anders
>>>> 
>>>> 
>>>> 
>>> When Python is running in 64-bit, the build is not successful at all. So, i
>>> built it after converting to 32-bit. I get the above errors in 32-bit only.
>>> And, I installed the latest macholib and py2app via easy_install.
>>> 
>>> --
>>> Shrihari
>>> 
>>> 
>> 
>> 
>> _______________________________________________
>> pygtk mailing list   
>> pygtk at daa.com.au
>> http://www.daa.com.au/mailman/listinfo/pygtk
>> 
>> Read the PyGTK FAQ: 
>> http://faq.pygtk.org/
> 
> _______________________________________________
> pygtk mailing list   pygtk at daa.com.au
> http://www.daa.com.au/mailman/listinfo/pygtk
> Read the PyGTK FAQ: http://faq.pygtk.org/



More information about the pygtk mailing list