[Pythonmac-SIG] py2app and Bittornado

Ronald Oussoren ronaldoussoren at mac.com
Thu Sep 1 21:36:48 CEST 2005


On 31-aug-2005, at 1:46, Brandon Sharitt wrote:

> I'm trying to get Bittornado to run on Mac OS X (10.4 with Python
> 2.3.5) but I've only ever dealt with Python at lower lever scripting
> stuff, never wxPython or another GUI stuff. py2app is supposed to be
> the tool to create Mac friendly Python applications(like py2exe on
> Windows), but the documentation for py2app doesn't seem to be much
> help. The setup.py script that comes with BitTornado doesn't run  
> when I
> type python setup.py py2app and produces the following error:
>
> usage: setup.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
>    or: setup.py --help [cmd1 cmd2 ...]
>    or: setup.py --help-commands
>    or: setup.py cmd --help
>
> error: invalid command 'py2app' (no module named
> 'distutils.command.py2app')

That's because py2app isn't part of the core distutils. You have to  
update the setup.py file (and install py2app) if you want to use  
py2app. The py2app source distribution contains a number of examples,  
including some wxPython ones. Addapting from py2exe should be fairly  
straightforward because py2app uses a simular API.

>
> When I drag the script to PackageInstaller, it creates a Mac installer
> package, but all that does is mostly copy the the sane stuff stuff to
> /usr/local/bin and when I try to run btdownloadgui.py all I get is:
>
> Traceback (most recent call last):
>   File "btdownloadgui.py", line 29, in ?
>     from BitTornado.ConfigReader import configReader
>   File "/Library/Python/2.3/site-pack ages/BitTornado/ 
> ConfigReader.p y",
> line 40, in ?
>     _CHECKINGCOLOR =
> ColorToHex(wxSystemSettings_Ge tColour(wxSYS_COLOUR_3DSHADOW) )
>   File
> "/BinaryCache/wxWidgets/wxWidg ets-2.root~174/System/Library/
> Frameworks/Python.framework/Ve rsions/2.3/Extras/lib/python/w
> x-2.5.3-mac-unicode/wx/_misc.p y",
> line 145, in SystemSettings_GetColour
> wx._core.PyNoAppError: The wx.App object must be created first!

I don't know bittornado, but this is either a bug in that program or  
btdownloadgui.py is not the main entry point of the program.

BTW. Unless btdownloadgui.py startswith '#!/usr/bin/env /usr/bin/ 
pythonw' (or ... /usr/local/bin/pythonw) it won't work anyway, the  
default python interpreter cannot start full-fledged GUI apps due to  
a "feature" of OSX.

> I also made my own setup file using the sparse documentation on
> py2app, but that just produces a broken app. Maybe I got the setup.py
> wrong.
>
> Any help would be appreciated. Either reply to this or email me.
> _______________________________________________
> Pythonmac-SIG maillist  -  Pythonmac-SIG at python.org
> http://mail.python.org/mailman/listinfo/pythonmac-sig
>



More information about the Pythonmac-SIG mailing list