From ronaldoussoren at mac.com Thu Jul 1 17:04:00 2010 From: ronaldoussoren at mac.com (Ronald Oussoren) Date: Thu, 01 Jul 2010 17:04:00 +0200 Subject: [Pythonmac-SIG] py2app and setuptools , import error (osx 10.6.3, system python) In-Reply-To: References: <0B23A769-FF50-460D-A810-9B780A8C2C81@mac.com> <7C866AEB-1A05-454E-8FA7-18832CD3F5CB@gmail.com> Message-ID: <19D7A12C-7184-46C0-B483-7049EA06B3E7@mac.com> A bleading edge version of py2app with a simular macholib now works for me to build a 3-way universal pyobjc application. Could you (and others on the list) please test if that works for you as well? * easy_install macholib==dev * easy_install py2app==dev This should install macholib 1.2.2 and py2app 0.5. With this combination I can build the TinyTinyEdit example in the py2app repository using a 3-way universal Python 2.7 framework (x86, i386, ppc), and that results in a working application bundle. Builds that include ppc64 code may not work. I don't have access to hardware that supports such code and therefore cannot properly develop or test such code. Ronald On 12 Jun, 2010, at 17:18, Massimo Di Stefano wrote: > > > i'll update my Py2app installation after your fix, > just ping me when a test is needed. > > Thanks! > > > > Il giorno 12/giu/2010, alle ore 17.03, Ronald Oussoren ha scritto: > >> Yikes, the 64-bit py2app bug strikes again. >> >> I'm going to fix this next week, >> >> Ronald >> >> On Jun 12, 2010, at 7:47, Massimo Di Stefano wrote: >> >>> Hi, >>> >>> i tried to run py2app on the setup.py file, >>> >>> python setup.py py2app >>> >>> i had this log : >>> >>> http://www.geofemengineering.it/data/py2app_log.txt >>> >>> it ends with a pdb shell :-/ , >>> this the results if i try to run the generated .app : >>> >>> http://www.geofemengineering.it/data/log.png >>> >>> >>> Thanks to help me. >>> >>> Massimo. >>> >>> Il giorno 12/giu/2010, alle ore 16.03, Ronald Oussoren ha scritto: >>> >>>> >>>> On 12 Jun, 2010, at 4:13, Massimo Di Stefano wrote: >>>>> >>>>> >>>>> but if i try to run the example from PyObjc : >>>>> >>>>> PyObjCExample-ImageBrowser >>>>> >>>>> i have this log : >>>>> >>>>> PyObjCExample-ImageBrowser sasha$ python main.py >>>>> /Library/Python/2.6/site-packages/pyobjc_framework_Cocoa-2.2-py2.6-macosx-10.6-universal.egg/PyObjCTools/NibClassBuilder.py:73: DeprecationWarning: PyObjCTools.NibClassBuilder is deprecated, use explicit definitions instead >>>>> 2010-06-12 13:10:41.997 Python[18759:d07] No Info.plist file in application bundle or no NSPrincipalClass in the Info.plist file, exiting >>>>> >>>>> >>>>> >>>>> any clue on what i'm doing wrong, how can i run this example? >>>> >>>> You must use py2app to create an application bundle and then run that. Almost all pyobjc examples are GUI ones that require being run in a bundle. >>>> >>>> Ronald >>>> >>> > -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 3567 bytes Desc: not available URL: From georg.seifert at gmx.de Fri Jul 2 15:14:00 2010 From: georg.seifert at gmx.de (Georg Seifert) Date: Fri, 2 Jul 2010 15:14:00 +0200 Subject: [Pythonmac-SIG] python plugins in Cocoa app. Message-ID: <88A04CB7-50C7-48DA-BFB1-B71FE0C60CCC@gmx.de> Hi, I have problems getting plugins made in python (made with py2app) to play with my app. My app needs to do two things: load plugins (bundles, mostly written in ObjC but also in python) and run scripts from within the app (uses PyRun_SimpleString). If I have a plugin loaded (it works) but it crashes on running the scripts. I make the plugin the the -A option to keep them small (16MB per plugin is too much) python setup.py py2app -A If I then run this it crashes on "PyRun_SimpleString": Py_Initialize(); PyRun_SimpleString("print \"Test\"\n"); Py_Finalize(); In my app, I week link to python through OTHER_LDFLAGS = -weak_framework Python (This was needed to support both Leopard and Snow Leopard.) Can anyone shed some light on my problem? Best Regards Georg Seifert -------------- next part -------------- An HTML attachment was scrubbed... URL: From ronaldoussoren at mac.com Fri Jul 2 15:25:49 2010 From: ronaldoussoren at mac.com (ronaldoussoren) Date: Fri, 02 Jul 2010 06:25:49 -0700 (PDT) Subject: [Pythonmac-SIG] python plugins in Cocoa app. In-Reply-To: <88A04CB7-50C7-48DA-BFB1-B71FE0C60CCC@gmx.de> Message-ID: On 02 Jul, 2010,at 03:14 PM, Georg Seifert wrote: Hi, I have problems getting plugins made in python (made with py2app) to play with my app. My app needs to do two things: load plugins (bundles, mostly written in ObjC but also in python) and run scripts from within the app (uses?PyRun_SimpleString). If I have a plugin loaded (it works) but it crashes on running the scripts. I make the plugin the the -A option to keep them small (16MB per plugin is too much) python setup.py py2app -A If I then run this it crashes on "PyRun_SimpleString": ?? ?Py_Initialize(); ?? ?PyRun_SimpleString("print \"Test\"\n"); ?? ?Py_Finalize(); In my app, I week link to python through OTHER_LDFLAGS = -weak_framework Python (This was needed to support both Leopard and Snow Leopard.) Can anyone shed some light on my problem? Best Regards Georg Seifert _______________________________________________ Pythonmac-SIG maillist - Pythonmac-SIG at python.org http://mail.python.org/mailman/listinfo/pythonmac-sig unsubscribe: http://mail.python.org/mailman/options/Pythonmac-SIG First of all: don't use Py_Initialize and Py_Finalize around the calls to to PyRun_SimpleString, the call to Py_Finalize will clean up resources that are used by the Python plugins. ? ?It is better to call Py_Initialize during program start and Py_Finalize during shutdown (to ensure that python finalizers are called). That is not what's causing your problem though. The C code in plugin bundles created using py2app ensures that Python is initialized and then runs the main module of the bundle. It then ensures that the Python GIL is released, which is needed to ensure that callbacks to Python code can happen on any thread. You will have to ensure that your code acquires the GIL before calling Python APIs. The easiest way to do that is: ?? ?PyGILState_STATE gilState = PyGILState_Ensure(); ?? ?PyRun_SimpleString("print \"Test\"\n"); ?? ?PyGILState_Release(gilState); Ronald P.S. As background: the GIL is the Global Interpreter Lock and is a lock that ensures that at most 1 C thread at a time is actively executing Python code. ? Threads running Python code will periodicly release and reacquire the GIL to ensure that all such threads can make progress. -------------- next part -------------- An HTML attachment was scrubbed... URL: From georg.seifert at gmx.de Fri Jul 2 16:22:12 2010 From: georg.seifert at gmx.de (Georg Seifert) Date: Fri, 2 Jul 2010 16:22:12 +0200 Subject: [Pythonmac-SIG] python plugins in Cocoa app. In-Reply-To: References: Message-ID: Hi, Thanks a lot. This did the trick. By the way. Is it save to use the "-A" option in my bundles if I ship the plugin to uses? Many Thanks Georg Seifert p.s. You can have a look at the app (it is an open BETA version) www.glyphsapp.com > >> Hi, >> >> I have problems getting plugins made in python (made with py2app) to play with my app. >> >> My app needs to do two things: load plugins (bundles, mostly written in ObjC but also in python) and run scripts from within the app (uses PyRun_SimpleString). If I have a plugin loaded (it works) but it crashes on running the scripts. >> >> I make the plugin the the -A option to keep them small (16MB per plugin is too much) >> >> python setup.py py2app -A >> >> If I then run this it crashes on "PyRun_SimpleString": >> Py_Initialize(); >> PyRun_SimpleString("print \"Test\"\n"); >> Py_Finalize(); >> >> In my app, I week link to python through >> >> OTHER_LDFLAGS = -weak_framework Python >> (This was needed to support both Leopard and Snow Leopard.) >> >> Can anyone shed some light on my problem? >> >> Best Regards >> Georg Seifert >> >> _______________________________________________ >> Pythonmac-SIG maillist - Pythonmac-SIG at python.org >> http://mail.python.org/mailman/listinfo/pythonmac-sig >> unsubscribe: http://mail.python.org/mailman/options/Pythonmac-SIG > > > First of all: don't use Py_Initialize and Py_Finalize around the calls to to PyRun_SimpleString, the call to Py_Finalize will clean up resources that are used by the Python plugins. It is better to call Py_Initialize during program start and Py_Finalize during shutdown (to ensure that python finalizers are called). > > That is not what's causing your problem though. The C code in plugin bundles created using py2app ensures that Python is initialized and then runs the main module of the bundle. It then ensures that the Python GIL is released, which is needed to ensure that callbacks to Python code can happen on any thread. > > You will have to ensure that your code acquires the GIL before calling Python APIs. The easiest way to do that is: > > PyGILState_STATE gilState = PyGILState_Ensure(); > PyRun_SimpleString("print \"Test\"\n"); > PyGILState_Release(gilState); > > Ronald > > P.S. As background: the GIL is the Global Interpreter Lock and is a lock that ensures that at most 1 C thread at a time is actively executing Python code. Threads running Python code will periodicly release and reacquire the GIL to ensure that all such threads can make progress. -------------- next part -------------- An HTML attachment was scrubbed... URL: From georg.seifert at gmx.de Fri Jul 2 16:41:46 2010 From: georg.seifert at gmx.de (Georg Seifert) Date: Fri, 2 Jul 2010 16:41:46 +0200 Subject: [Pythonmac-SIG] python plugins in Cocoa app. In-Reply-To: References: Message-ID: <5DFE4B2F-4FF8-418C-87CD-4EC679698830@gmx.de> > >> Hi, >> >> Thanks a lot. This did the trick. >> >> By the way. Is it save to use the "-A" option in my bundles if I ship the plugin to users? > > > That is not safe, the "-A" option creates a bundle that uses aliases to refer to the resources and source code used. That means the bundle is rather specific to your machine. > I would have replace the resource files manually... > If you use the system version of Python you can use "--site-packages" and "--excludes" to include the system site packages and to ensure that py2app doesn't copy those files into the bundle. BTW. Both options can be added to the setup.py file as well. Can you give me an example ? I can?t find anything through Google. I did this: plist = dict( NSPrincipalClass='GSToolTest', CFBundleIdentifier = "com.GlyphsTestPlugin.GlyphsExport", NSHumanReadableCopyright = "Copyright, Georg Seifert, 2010", ) setup( plugin = ['GlyphsToolTest.py'], options=dict(py2app=dict( extension='.toolPlugin', plist=plist, excludes=["python"], )), ) But I don?t know what to put in the excludes to not copy the python binaries. Georg -------------- next part -------------- An HTML attachment was scrubbed... URL: From kirell.benzi at gmail.com Mon Jul 5 17:15:21 2010 From: kirell.benzi at gmail.com (Kirell Benzi) Date: Mon, 5 Jul 2010 17:15:21 +0200 Subject: [Pythonmac-SIG] Py2App Import Error:SIP Message-ID: Hello everyone, I am very new to pyQt and python in general. I would like to make a distributed app. The alias dev mode runs fine. When I try to build even a simple example from pyQt (e.g: hellogl.py) I have the sip error. ImportError: no module named sip Qt: 4.6.3 pyQt : 4.7 python: 2.6.5 Running on snow leopard, I also use scipy, numpy, pyOpenGL. I am really stuck. Thanks for your help. Cheers. Kirell -------------- next part -------------- An HTML attachment was scrubbed... URL: From ronaldoussoren at mac.com Tue Jul 6 08:17:02 2010 From: ronaldoussoren at mac.com (Ronald Oussoren) Date: Tue, 06 Jul 2010 08:17:02 +0200 Subject: [Pythonmac-SIG] Python 2.7 is out Message-ID: <92F7A6FA-CCF3-4B35-94FE-5EDEA580C1D6@mac.com> FYI: python 2.7 is released see The Mac installers are also up, they weren't available from the start because I sent them to the wrong person :-( Ronald -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 3567 bytes Desc: not available URL: From ronaldoussoren at mac.com Wed Jul 7 12:39:02 2010 From: ronaldoussoren at mac.com (ronaldoussoren) Date: Wed, 07 Jul 2010 03:39:02 -0700 (PDT) Subject: [Pythonmac-SIG] EuroPython Message-ID: Hi, Is anyone here going to europython this year? I'll visit this year and am staying for the post-conference sprints (although I haven't decided yet what I'll sprint on). Ronald -------------- next part -------------- An HTML attachment was scrubbed... URL: From fuzzyman at voidspace.org.uk Wed Jul 7 13:50:23 2010 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Wed, 7 Jul 2010 12:50:23 +0100 Subject: [Pythonmac-SIG] EuroPython In-Reply-To: References: Message-ID: On 7 July 2010 11:39, ronaldoussoren wrote: > Hi, > > Is anyone here going to europython this year? I'll visit this year and am > staying for the post-conference sprints (although I haven't decided yet what > I'll sprint on). > > I'll be there. :-) Michael > Ronald > > _______________________________________________ > Pythonmac-SIG maillist - Pythonmac-SIG at python.org > http://mail.python.org/mailman/listinfo/pythonmac-sig > unsubscribe: http://mail.python.org/mailman/options/Pythonmac-SIG > > -- http://www.voidspace.org.uk -------------- next part -------------- An HTML attachment was scrubbed... URL: From sridharr at activestate.com Thu Jul 8 03:10:57 2010 From: sridharr at activestate.com (Sridhar Ratnakumar) Date: Wed, 07 Jul 2010 18:10:57 -0700 Subject: [Pythonmac-SIG] ANN: ActivePython 2.7.0.1 is now available (MacOSX 64-bit support) Message-ID: <4C3525A1.6090001@activestate.com> Just wanted to forward the original announcement and emphasize the following features in ActivePython 2.7 for MacOSX - 64-bit support (i386+x86_64) - readline module via Apple's editline library -srid -------- Original Message -------- Subject: ANN: ActivePython 2.7.0.1 is now available Date: Wed, 07 Jul 2010 18:08:07 -0700 From: Sridhar Ratnakumar Reply-To: python-list at python.org, activepython-feedback at activestate.com Organization: ActiveState To: python-announce-list at python.org, python-list at python.org We are pleased to announce the availability of ActivePython 2.7.0.1. http://www.activestate.com/activepython This release corresponds to the recently released Python 2.7, and, like ActivePython 2.6, includes the Python Package Manager (PyPM) with essential packages such as Distribute (a compatible fork of setuptools), virtualenv, pip and SQLAlchemy. See the release notes for full details: http://docs.activestate.com/activepython/2.7/relnotes.html#changes For a high-level overview of this release, please see our blog post: http://www.activestate.com/blog/2010/07/activepython-27-released This is also the first ActivePython release with 64-bit support on MacOSX. What is ActivePython? --------------------- ActivePython is ActiveState's binary distribution of Python. Builds for Windows, Mac OS X, Linux are made freely available. Solaris, HP-UX and AIX builds, and access to older versions are available in ActivePython Business, Enterprise and OEM editions: http://www.activestate.com/python ActivePython includes the Python core and the many core extensions: zlib and bzip2 for data compression, the Berkeley DB (bsddb) and SQLite (sqlite3) database libraries, OpenSSL bindings for HTTPS support, the Tix GUI widgets for Tkinter, ElementTree for XML processing, ctypes (on supported platforms) for low-level library access, and others. The Windows distribution ships with PyWin32 -- a suite of Windows tools developed by Mark Hammond, including bindings to the Win32 API and Windows COM. ActivePython 2.6 and 2.7 also include a binary package manager for Python (PyPM) that can be used to install packages much easily. For example: C:\>pypm install mysql-python [...] C:\>python >>> import MySQLdb >>> See this page for full details: http://docs.activestate.com/activepython/2.7/whatsincluded.html As well, ActivePython ships with a wealth of documentation for both new and experienced Python programmers. In addition to the core Python docs, ActivePython includes the "What's New in Python" series, "Dive into Python", the Python FAQs & HOWTOs, and the Python Enhancement Proposals (PEPs). An online version of the docs can be found here: http://docs.activestate.com/activepython/2.7/ We would welcome any and all feedback to: activepython-feedback at activestate.com Please file bugs against ActivePython at: http://bugs.activestate.com/enter_bug.cgi?product=ActivePython On what platforms does ActivePython run? ---------------------------------------- ActivePython includes installers for the following platforms: - Windows/x86 - Windows/x64 (aka "AMD64") - Mac OS X - Linux/x86 - Linux/x86_64 (aka "AMD64") - Solaris/SPARC (Business, Enterprise or OEM edition only) - Solaris/x86 (Business, Enterprise or OEM edition only) - HP-UX/PA-RISC (Business, Enterprise or OEM edition only) - HP-UX/IA-64 (Enterprise or OEM edition only) - AIX/PowerPC (Business, Enterprise or OEM edition only) - AIX/PowerPC 64-bit (Business, Enterprise or OEM edition only) Custom builds are available in Enterprise Edition: http://www.activestate.com/enterprise-edition Thanks, and enjoy! The Python Team -- Sridhar Ratnakumar sridharr at activestate.com From matti.lyra at gmail.com Thu Jul 8 10:56:52 2010 From: matti.lyra at gmail.com (Matti Lyra) Date: Thu, 8 Jul 2010 09:56:52 +0100 Subject: [Pythonmac-SIG] py2app ZipImportError Message-ID: I'm trying to package a small utility with py2app but am having some problems getting the .app to run. When I try to launch it it comes back with the following error: ZipImportError: can't decompress data: zlib not available I have installed python (2.6.4 - 64bit) from macports but this doesn't seem to be the problem as the same problem occurs when I switch to the System python (2.6.1 - 32bit). I've confirmed that zlib.so is in the application bundle in Contents/Resources/lib/python2.6/lib-dynload My py2app-devel is installed through macports as well, its version is 0.4.4 What's going on here, is the zlib.so somehow copied to the wrong place, or what? I also tried to a simple hello world app with just a print line, same problem. If I start the python interpreter from the command line I can import zlib without a problem. --------------------------------- Matti Lyra matti.lyra at gmail.com From vincent at vincentdavis.net Thu Jul 8 22:03:20 2010 From: vincent at vincentdavis.net (Vincent Davis) Date: Thu, 8 Jul 2010 14:03:20 -0600 Subject: [Pythonmac-SIG] uninstall python 2.7 Message-ID: Ok so my question is not only about python 2.7, and I don't necessarily want to uninstall I just want to download the svn and update. I do have numpy, scipy... and a few other things installed and I will update them at the same time. I am writing a shell script to do this so I was thinking that I could just completely remove py27 and rebuild everything but is this necessary (the completely removing part not the incremental updating :-) I guess there is just a list of files to remove but I couldn't find a list. Thanks Vincent From ronaldoussoren at mac.com Thu Jul 8 22:48:49 2010 From: ronaldoussoren at mac.com (Ronald Oussoren) Date: Thu, 08 Jul 2010 22:48:49 +0200 Subject: [Pythonmac-SIG] uninstall python 2.7 In-Reply-To: References: Message-ID: <91535A1E-DC82-4C28-B000-D13B2DAFABEB@mac.com> On 8 Jul, 2010, at 22:03, Vincent Davis wrote: > Ok so my question is not only about python 2.7, and I don't > necessarily want to uninstall I just want to download the svn and > update. I do have numpy, scipy... and a few other things installed and > I will update them at the same time. I am writing a shell script to do > this so I was thinking that I could just completely remove py27 and > rebuild everything but is this necessary (the completely removing part > not the incremental updating :-) Do you really mean to say you want to update from a 2.7 installation to a 2.7 installation from the svn repo? In that case you don't have to removing the existing installation (or even upgrade site-packages), unless you change the architectures (switch to/from a universal build, or to a different kind of universal build) If you upgrade from 2.6 to 2.7 you don't have to remove the 2.6 install, 2.6 and 2.7 can be used side-by-side (both for unix and framework installs). > I guess there is just a list of files to remove but I couldn't find a list. That depends on the type of install. For a framework install (python in /Library/Framework/Python.framework) you need to remove "/Library/Frameworks/Python.framework/Versions/2.7" and "/Applications/Python 2.7". Depending on how you installed and with what options there may also be symlinks in /usr/local/bin. Note that there are two binary installers for 2.7 on the website: one containing 32-bit binaries that work on OSX 10.3.9 or later and one containing ppc, i386 and x86_64 and works on OSX 10.5 and later. The latter has two features that might cause surprises: Tkinter doesn't work in 64-bit mode because the system version of Tk 8.4 doesn't support that and furthermore the readline extension is linked to libedit instead of the real readline. The latter means that the configuration for key-bindings uses a different syntax (see for an example of why this is problematic). Ronald > > Thanks > Vincent > _______________________________________________ > Pythonmac-SIG maillist - Pythonmac-SIG at python.org > http://mail.python.org/mailman/listinfo/pythonmac-sig > unsubscribe: http://mail.python.org/mailman/options/Pythonmac-SIG -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 3567 bytes Desc: not available URL: From vincent at vincentdavis.net Thu Jul 8 22:57:30 2010 From: vincent at vincentdavis.net (Vincent Davis) Date: Thu, 8 Jul 2010 14:57:30 -0600 Subject: [Pythonmac-SIG] uninstall python 2.7 In-Reply-To: <91535A1E-DC82-4C28-B000-D13B2DAFABEB@mac.com> References: <91535A1E-DC82-4C28-B000-D13B2DAFABEB@mac.com> Message-ID: On Thu, Jul 8, 2010 at 2:48 PM, Ronald Oussoren wrote: > > On 8 Jul, 2010, at 22:03, Vincent Davis wrote: > >> Ok so my question is not only about python 2.7, and I don't >> necessarily want to uninstall I just want to download the svn and >> update. I do have numpy, scipy... and a few other things installed and >> I will update them at the same time. I am writing a shell script to do >> this so I was thinking that I could just completely remove py27 and >> rebuild everything but is this necessary (the completely removing part >> not the incremental updating :-) > > Do you really mean to say you want to update from a 2.7 installation to a 2.7 installation from the svn repo? In that case you don't have to removing the existing installation (or even upgrade site-packages), unless you change the architectures (switch to/from a universal build, or to a different kind of universal build) > > If you upgrade from 2.6 to 2.7 you don't have to remove the 2.6 install, 2.6 and 2.7 can be used side-by-side (both for unix and framework installs). > >> I guess there is just a list of files to remove but I couldn't find a list. > > That depends on the type of install. For a framework install (python in /Library/Framework/Python.framework) you need to remove "/Library/Frameworks/Python.framework/Versions/2.7" and "/Applications/Python 2.7". Depending on how you installed and with what options there may also be symlinks in /usr/local/bin. Yes I actually mean updating from 2.7 to 2.7 from svn. I am running this install ./configure --with-universal-archs=64-bit --enable-universalsdk=/Developer/SDKs/MacOSX10.5.sdk --enable-framework Are there other options I should consider? What I mean by that, are there options you like or recommend. There is a lot I don't know about ./configure and the options. It's not that I plan to do this often, but I want a shell script that installs everything I want. I figure I need to right it down somewhere it might has well be in a script. I plan to host this on github to share with others. Thanks for you help Vincent > > Note that there are two binary installers for 2.7 on the website: one containing 32-bit binaries that work on OSX 10.3.9 or later and one containing ppc, i386 and x86_64 and works on OSX 10.5 and later. ?The latter has two features that might cause surprises: ?Tkinter doesn't work in 64-bit mode because the system version of Tk 8.4 doesn't support that and furthermore the readline extension is linked to libedit instead of the real readline. The latter means that the configuration for key-bindings uses a different syntax (see for an example of why this is problematic). > > Ronald >> >> Thanks >> Vincent >> _______________________________________________ >> Pythonmac-SIG maillist ?- ?Pythonmac-SIG at python.org >> http://mail.python.org/mailman/listinfo/pythonmac-sig >> unsubscribe: http://mail.python.org/mailman/options/Pythonmac-SIG > > From georg.seifert at gmx.de Thu Jul 8 23:00:02 2010 From: georg.seifert at gmx.de (Georg Seifert) Date: Thu, 8 Jul 2010 23:00:02 +0200 Subject: [Pythonmac-SIG] lists and accessors Message-ID: <3C078D16-A978-4094-8B21-681C55416627@gmx.de> Hi, In my app I will access my cocoa data classes from a python script (run from within the app). This works fine, I can access all the methods and properties. For some of the array properties I use dedicated getter and setter (getItemAtIndex: , setItemAtIndex: ...). I have a cocoa object: @interface myObject : NSObject { NSMutableArray *_items; } @property(retain) NSArray * items; - (void) setItem:(id) Item atIndex: (int) Index; - (id) itemAtIndex: (int) Index; @end Is it possible to access like: object.items()[i] # it would be even better to get rid of the parenthesis. or object.items.append(NewItem) Calling from python should call the cocoa accessors instead of accessing the list directly. (I need to set some values and implemented undo in the accessors.) My users are used to plain python scripting environments and don?t like the cocoa method names. Is it somehow possible to tell python what accessors to use or is there a way to supply python wrappers? Or could I build a bridgesupport file? Many Thanks Georg From ronaldoussoren at mac.com Thu Jul 8 23:06:31 2010 From: ronaldoussoren at mac.com (Ronald Oussoren) Date: Thu, 08 Jul 2010 23:06:31 +0200 Subject: [Pythonmac-SIG] uninstall python 2.7 In-Reply-To: References: <91535A1E-DC82-4C28-B000-D13B2DAFABEB@mac.com> Message-ID: <243D5121-5C04-4527-A7B1-E9C5B47FF570@mac.com> On 8 Jul, 2010, at 22:57, Vincent Davis wrote: > On Thu, Jul 8, 2010 at 2:48 PM, Ronald Oussoren wrote: >> >> On 8 Jul, 2010, at 22:03, Vincent Davis wrote: >> >>> Ok so my question is not only about python 2.7, and I don't >>> necessarily want to uninstall I just want to download the svn and >>> update. I do have numpy, scipy... and a few other things installed and >>> I will update them at the same time. I am writing a shell script to do >>> this so I was thinking that I could just completely remove py27 and >>> rebuild everything but is this necessary (the completely removing part >>> not the incremental updating :-) >> >> Do you really mean to say you want to update from a 2.7 installation to a 2.7 installation from the svn repo? In that case you don't have to removing the existing installation (or even upgrade site-packages), unless you change the architectures (switch to/from a universal build, or to a different kind of universal build) >> >> If you upgrade from 2.6 to 2.7 you don't have to remove the 2.6 install, 2.6 and 2.7 can be used side-by-side (both for unix and framework installs). >> >>> I guess there is just a list of files to remove but I couldn't find a list. >> >> That depends on the type of install. For a framework install (python in /Library/Framework/Python.framework) you need to remove "/Library/Frameworks/Python.framework/Versions/2.7" and "/Applications/Python 2.7". Depending on how you installed and with what options there may also be symlinks in /usr/local/bin. > > Yes I actually mean updating from 2.7 to 2.7 from svn. > I am running this install > ./configure --with-universal-archs=64-bit > --enable-universalsdk=/Developer/SDKs/MacOSX10.5.sdk > --enable-framework > Are there other options I should consider? What I mean by that, are > there options you like or recommend. There is a lot I don't know about > ./configure and the options. The configure flags look fine, although I on't use the 64-bit option myself. I use '--with-universal-archs=3-way --enable-universalsdk=/'. That one is usable on all systems running 10.5 or later, but doesn't support 64-bit code on PPC. Do you use ctypes? I'm pretty sure there are bugs in libffi for darwin/ppc64, although I don't know if these affect ctypes. I don't support ppc64 in PyObjC because libffi caused exception handling there (at least the last time I tried running on such a system). Another option that might be useful when you're experimenting is '--with-framework-name=NAME'. That allows you to rename 'Python.framework' to something else, which allows you to test if a new checkout results in a workable installation before you upgrade the real install. > > It's not that I plan to do this often, but I want a shell script that > installs everything I want. I figure I need to right it down somewhere > it might has well be in a script. I plan to host this on github to > share with others. I have a script that builds a lot of frameworks here: . The script builds debug builds of python for a number of architectures and python versions. Ronald -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 3567 bytes Desc: not available URL: From vincent at vincentdavis.net Thu Jul 8 23:15:55 2010 From: vincent at vincentdavis.net (Vincent Davis) Date: Thu, 8 Jul 2010 15:15:55 -0600 Subject: [Pythonmac-SIG] uninstall python 2.7 In-Reply-To: <243D5121-5C04-4527-A7B1-E9C5B47FF570@mac.com> References: <91535A1E-DC82-4C28-B000-D13B2DAFABEB@mac.com> <243D5121-5C04-4527-A7B1-E9C5B47FF570@mac.com> Message-ID: On Thu, Jul 8, 2010 at 3:06 PM, Ronald Oussoren wrote: > > On 8 Jul, 2010, at 22:57, Vincent Davis wrote: > >> On Thu, Jul 8, 2010 at 2:48 PM, Ronald Oussoren wrote: >>> >>> On 8 Jul, 2010, at 22:03, Vincent Davis wrote: >>> >>>> Ok so my question is not only about python 2.7, and I don't >>>> necessarily want to uninstall I just want to download the svn and >>>> update. I do have numpy, scipy... and a few other things installed and >>>> I will update them at the same time. I am writing a shell script to do >>>> this so I was thinking that I could just completely remove py27 and >>>> rebuild everything but is this necessary (the completely removing part >>>> not the incremental updating :-) >>> >>> Do you really mean to say you want to update from a 2.7 installation to a 2.7 installation from the svn repo? In that case you don't have to removing the existing installation (or even upgrade site-packages), unless you change the architectures (switch to/from a universal build, or to a different kind of universal build) >>> >>> If you upgrade from 2.6 to 2.7 you don't have to remove the 2.6 install, 2.6 and 2.7 can be used side-by-side (both for unix and framework installs). >>> >>>> I guess there is just a list of files to remove but I couldn't find a list. >>> >>> That depends on the type of install. For a framework install (python in /Library/Framework/Python.framework) you need to remove "/Library/Frameworks/Python.framework/Versions/2.7" and "/Applications/Python 2.7". Depending on how you installed and with what options there may also be symlinks in /usr/local/bin. >> >> Yes I actually mean updating from 2.7 to 2.7 from svn. >> I am running this install >> ./configure --with-universal-archs=64-bit >> --enable-universalsdk=/Developer/SDKs/MacOSX10.5.sdk >> --enable-framework >> Are there other options I should consider? What I mean by that, are >> there options you like or recommend. There is a lot I don't know about >> ./configure and the options. > > The configure flags look fine, although I on't use the 64-bit option myself. I use '--with-universal-archs=3-way --enable-universalsdk=/'. ?That one is usable on all systems running 10.5 or later, but doesn't support 64-bit code on PPC. > > Do you use ctypes? I'm pretty sure there are bugs in libffi for darwin/ppc64, although I don't know if these affect ctypes. I don't support ppc64 in PyObjC because libffi caused exception handling there (at least the last time I tried running on such a system). > > Another option that might be useful when you're experimenting is '--with-framework-name=NAME'. That allows you to rename 'Python.framework' to something else, which allows you to test if a new checkout results in a workable installation before you upgrade the real install. > >> >> It's not that I plan to do this often, but I want a shell script that >> installs everything I want. I figure I need to right it down somewhere >> it might has well be in a script. I plan to host this on github to >> share with others. > > I have a script that builds a lot of frameworks here: . The script builds debug builds of python for a number of architectures and python versions. Thanks again I will have a look at you scripts. I ran make test and got two errors, maybe these are documented, I am not really sure. 2 tests failed: test_ctypes test_site Thanks Vincent > > Ronald From ronaldoussoren at mac.com Thu Jul 8 23:16:10 2010 From: ronaldoussoren at mac.com (Ronald Oussoren) Date: Thu, 08 Jul 2010 23:16:10 +0200 Subject: [Pythonmac-SIG] lists and accessors In-Reply-To: <3C078D16-A978-4094-8B21-681C55416627@gmx.de> References: <3C078D16-A978-4094-8B21-681C55416627@gmx.de> Message-ID: <27741206-E460-47BB-91C1-2BC69287FB08@mac.com> On 8 Jul, 2010, at 23:00, Georg Seifert wrote: > Hi, > > In my app I will access my cocoa data classes from a python script (run from within the app). This works fine, I can access all the methods and properties. For some of the array properties I use dedicated getter and setter (getItemAtIndex: , setItemAtIndex: ...). > > I have a cocoa object: > > @interface myObject : NSObject { > NSMutableArray *_items; > } > @property(retain) NSArray * items; > - (void) setItem:(id) Item atIndex: (int) Index; > - (id) itemAtIndex: (int) Index; > @end > > Is it possible to access like: > object.items()[i] # it would be even better to get rid of the parenthesis. > or > object.items.append(NewItem) > > Calling from python should call the cocoa accessors instead of accessing the list directly. (I need to set some values and implemented undo in the accessors.) > > My users are used to plain python scripting environments and don?t like the cocoa method names. > > Is it somehow possible to tell python what accessors to use or is there a way to supply python wrappers? Or could I build a bridgesupport file? Not easily. I've implemented code for the upcoming 2.3 release of pyobjc that will generate the accessors for you when you create a property in Python, but haven't gotten around to implementing the other direction. Something that likely works (but I haven't tested this): class ItemProxy (object): def __init__(self, owner): self._ower = owner def __getitem__(self, i): return self.itemAtIndex_(i) ... del myClass.__dict__['items'] myClass.__dict__['items'] = lambda self: ItemProxy(self) A future version of PyObjC will allow you to configure ObjC properties in native classes using bridgesupport files and/or function in the objc module. Ronald P.S. I want to release PyObjC 2.3 this saturday, but need to squash a couple of bugs in the 64-bit support before I do the release. P.P.S. The major feature in PyObjC 2.3 is support for Python 3. -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 3567 bytes Desc: not available URL: From jjackson at pobox.com Sun Jul 11 01:07:29 2010 From: jjackson at pobox.com (John Jackson) Date: Sat, 10 Jul 2010 16:07:29 -0700 Subject: [Pythonmac-SIG] py-Appscript broken with FileMaker 11? Message-ID: <23714558-89AC-4505-B40D-54B5189A0590@pobox.com> I recently upgraded FileMaker to version 11, and discovered that my python-based application that relies on appscript to control a FileMaker database has broken. If I use appscript to ask FileMaker 10 to tell me about the application class, I get this: >>>> fm10.help('-t application') > ============================================================================== > Help (-t application) > > Reference: app(u'/Applications/FileMaker Pro 10 Advanced/FileMaker Pro Advanced.app') > > ------------------------------------------------------------------------------ > Terminology for application class > > Class: application -- The application > Plural: > applications > Properties: > best_type (r/o) : type_class -- The best descriptor type > class_ (r/o) : type_class -- The class > default_type (r/o) : type_class -- The default descriptor type > frontmost (r/o) : boolean -- Is this the frontmost application? > name (r/o) : international_text -- The name of the application > version (r/o) : version -- The version of the application > Elements: > documents -- by index, name > windows -- by index, name > databases -- by name, index > menus -- by name, index If I do the same with FileMaker 11, I get this: >>>> fm11.help('-t application') > > ============================================================================== > Help (-t application) > > Reference: app(u'/Applications/FileMaker Pro 11 Advanced/FileMaker Pro Advanced.app') > > ------------------------------------------------------------------------------ > Terminology for application class > > Class: application -- An application's top level scripting object. > Plural: > applications > Inherits from: > item (in Standard Suite) > Properties: > class_ (r/o) : type_class -- The class of the object. > properties : record -- All of the object's properties. > frontmost (r/o) : boolean -- Is this the frontmost (active) application? > name (r/o) : unicode_text -- The name of the application. > version (r/o) : unicode_text -- The version of the application. > Elements: > documents -- by name, index, relative, range, test > windows -- by name, index, relative, range, test, id Notice that with FileMaker 11, there are no databases or menus listed as elements for the class 'application'. (There are other differences too, with the properties.) Having no database element accessible from the application object causes my scripts to fail. It may be that the dictionary has been reorganized and these objects are somewhere else now. Some test Applescripts I wrote with the Apple ScriptEditor work, so I don't think it is a problem with the FileMaker 11 dictionary per se. Any ideas? I'm not familiar with the appscript internals to even know where to start. John Jackson John Jackson From georg.seifert at gmx.de Sun Jul 11 01:18:19 2010 From: georg.seifert at gmx.de (Georg Seifert) Date: Sun, 11 Jul 2010 01:18:19 +0200 Subject: [Pythonmac-SIG] lists and accessors In-Reply-To: <27741206-E460-47BB-91C1-2BC69287FB08@mac.com> References: <3C078D16-A978-4094-8B21-681C55416627@gmx.de> <27741206-E460-47BB-91C1-2BC69287FB08@mac.com> Message-ID: Hi Ronald, Thanks for your response. I did tried this: class PathNodesProxy (object): def __init__(self, owner): self._ower = owner def __getitem__(self, i): print "__getitem__", i return self.nodeAtIndex_(i) def __setitem__(self, i, Node): print "__setitem__", i, Node self.setNode_atIndex_(Node, i) def __delitem__(self, i): print "__delitem__", i self.removeNodeAtIndex_(i) def append(self, Node): print "append", Node self.addNode_(Node) def count(self): print "count" return self.nodes().count() del GSPath.__dict__['nodes'] GSPath.__dict__['nodes'] = lambda self: PathNodesProxy(self) the next to last line gives this error: TypeError: 'dictproxy' object does not support item deletion and the last (if I remove the first): TypeError: 'dictproxy' object does not support item assignment If I used: GSPath.nodes = lambda self: PathNodesProxy(self) It worked somehow, but it actually removed the nodes property from the cocoa object. And I still had to use the parenthesis. Best Regards Georg On 08.07.2010, at 23:16, Ronald Oussoren wrote: > > On 8 Jul, 2010, at 23:00, Georg Seifert wrote: > >> Hi, >> >> In my app I will access my cocoa data classes from a python script (run from within the app). This works fine, I can access all the methods and properties. For some of the array properties I use dedicated getter and setter (getItemAtIndex: , setItemAtIndex: ...). >> >> I have a cocoa object: >> >> @interface myObject : NSObject { >> NSMutableArray *_items; >> } >> @property(retain) NSArray * items; >> - (void) setItem:(id) Item atIndex: (int) Index; >> - (id) itemAtIndex: (int) Index; >> @end >> >> Is it possible to access like: >> object.items()[i] # it would be even better to get rid of the parenthesis. >> or >> object.items.append(NewItem) >> >> Calling from python should call the cocoa accessors instead of accessing the list directly. (I need to set some values and implemented undo in the accessors.) >> >> My users are used to plain python scripting environments and don?t like the cocoa method names. >> >> Is it somehow possible to tell python what accessors to use or is there a way to supply python wrappers? Or could I build a bridgesupport file? > > Not easily. I've implemented code for the upcoming 2.3 release of pyobjc that will generate the accessors for you when you create a property in Python, but haven't gotten around to implementing the other direction. > > Something that likely works (but I haven't tested this): > > class ItemProxy (object): > def __init__(self, owner): > self._ower = owner > > def __getitem__(self, i): > return self.itemAtIndex_(i) > > ... > > del myClass.__dict__['items'] > myClass.__dict__['items'] = lambda self: ItemProxy(self) > > A future version of PyObjC will allow you to configure ObjC properties in native classes using bridgesupport files and/or function in the objc module. > > Ronald > > P.S. I want to release PyObjC 2.3 this saturday, but need to squash a couple of bugs in the 64-bit support before I do the release. > > P.P.S. The major feature in PyObjC 2.3 is support for Python 3. From hengist.podd at virgin.net Mon Jul 12 19:19:39 2010 From: hengist.podd at virgin.net (has) Date: Mon, 12 Jul 2010 18:19:39 +0100 Subject: [Pythonmac-SIG] py-Appscript broken with FileMaker 11? In-Reply-To: References: Message-ID: <7C82E8A0-159C-41E1-8746-63315CD24728@virgin.net> John Jackson wrote: > I recently upgraded FileMaker to version 11, and discovered that my python-based application that relies on appscript to control a FileMaker database has broken. I believe that's a bug in FMP 11, where sending an ascr/gdte (get terminology) event to FMP returns the default Cocoa Scripting terminology, rather than FMP's actual dictionary. You should file a bug report with FileMaker, as this will also affect scripting FMP from AppleScript via Remote Apple Events. As a workaround, use the dump function in appscript.terminology to export the FMP dictionary to a static module and pass that module when creating app objects, like this: app('FileMaker Pro', terms=fmp11terminologymodule). Make sure you run the dump command under 32-bit Python (use 'arch -i386' followed by the path to the python interpreter in the Python.framework bundle) as it uses OSAGetAppTerminology, which isn't present in OS X's 64-bit APIs. HTH has -- Learn AppleScript, 3rd edition, Sanderson & Rosenthal: http://apress.com/book/view/9781430223610 Control AppleScriptable applications from Python, Ruby and ObjC: http://appscript.sourceforge.net From pedben at gmail.com Mon Jul 12 21:05:35 2010 From: pedben at gmail.com (Ben Pedersen) Date: Mon, 12 Jul 2010 15:05:35 -0400 Subject: [Pythonmac-SIG] AEDesc error: Unsupported Type Message-ID: Hello all, Working with py-appscript to automate testing and I'm getting an error deep in aemreference/aemcodecs. ?Following are the trace and some code to reproduce. ?The error seems to be caused by calling a separate function in a parent class that returns a reference to an appscript object - ?commenting the last line of setUp and uncommenting the 2 lines above it lead to working code. ?That's an acceptable workaround, but I'm very curious what is causing the issue ... does application object get cleaned up prematurely? Traceback (most recent call last): ??File "test_syslog.py", line 78, in ?? ?testClass.testMe() ??File "test_syslog.py", line 74, in testMe ?? ?self.testApp.menu_bars[0].menus["File"].menu_items["Show Properties"].click() ??File "build/bdist.macosx-10.6-universal/egg/appscript/reference.py", line 463, in __call__ ??File "build/bdist.macosx-10.6-universal/egg/aem/__init__.py", line 192, in event ??File "build/bdist.macosx-10.6-universal/egg/aem/aemsend.py", line 57, in __init__ ??File "build/bdist.macosx-10.6-universal/egg/appscript/reference.py", line 275, in pack ??File "build/bdist.macosx-10.6-universal/egg/aem/aemcodecs.py", line 313, in pack ??File "build/bdist.macosx-10.6-universal/egg/aem/aemreference.py", line 118, in AEM_packself ??File "build/bdist.macosx-10.6-universal/egg/aem/aemreference.py", line 177, in _packself ??File "build/bdist.macosx-10.6-universal/egg/aem/aemreference.py", line 534, in AEM_packself ??File "build/bdist.macosx-10.6-universal/egg/aem/aemreference.py", line 118, in AEM_packself ??File "build/bdist.macosx-10.6-universal/egg/aem/aemreference.py", line 177, in _packself ??File "build/bdist.macosx-10.6-universal/egg/aem/aemreference.py", line 534, in AEM_packself ??File "build/bdist.macosx-10.6-universal/egg/aem/aemreference.py", line 118, in AEM_packself ??File "build/bdist.macosx-10.6-universal/egg/aem/aemreference.py", line 177, in _packself ??File "build/bdist.macosx-10.6-universal/egg/aem/aemreference.py", line 534, in AEM_packself ??File "build/bdist.macosx-10.6-universal/egg/aem/aemreference.py", line 118, in AEM_packself ??File "build/bdist.macosx-10.6-universal/egg/aem/aemreference.py", line 176, in _packself ??File "build/bdist.macosx-10.6-universal/egg/aem/aemreference.py", line 304, in _packkey ??File "build/bdist.macosx-10.6-universal/egg/appscript/reference.py", line 275, in pack ??File "build/bdist.macosx-10.6-universal/egg/aem/aemcodecs.py", line 325, in pack ??File "build/bdist.macosx-10.6-universal/egg/aem/aemcodecs.py", line 290, in packunknown TypeError: Can't pack data into an AEDesc (unsupported type): <__main__.Test instance at 0x1007a5cb0> import appscript class SuperTest(): def getProcessHandle(procName="TextEdit"): sysEvents = appscript.app("System Events") testApp = sysEvents.application_processes[procName] return testApp class Test(SuperTest): def setUp(self): application = appscript.app("TextEdit") application.activate() #sysEvents = appscript.app("System Events") #self.testApp = sysEvents.application_processes["TextEdit"] self.testApp = self.getProcessHandle() def testMe(self): self.testApp.menu_bars[0].menus["File"].menu_items["Show Properties"].click() testClass = Test() testClass.setUp() testClass.testMe() Thanks, Ben P From rowen at uw.edu Mon Jul 12 22:39:34 2010 From: rowen at uw.edu (Russell E. Owen) Date: Mon, 12 Jul 2010 13:39:34 -0700 Subject: [Pythonmac-SIG] py2app problem: invalid matplotlib recipe Message-ID: py2app 0.4.3's matplotlib recipe includes: mf.import_hook('pytz.zoneinfo', m, ['UTC']) This has two incompatibilities with the current version of pytz: - zoneinfo is a data directory but not a package (no __init__.py) - UTC is not a python file (it is called UTC, not UTC.py) Removing the line listed above from the recipe fixes the problem -- it allows my build to complete, and the resulting application includes pytz?with its zoneinfo directory and data files). But it also loses the test for the presence of pytz, which may be a bad thing (if so, it should also test for dateutils, right?). I'm curious: is the line in question supposed to do more than test if pytz exists? If it only tests if pytz works then why does it have such detail about the internals of pytz? If it does more (e.g. add pytz files to the bundled application), then why did my fix work? -- Russell From Chris.Barker at noaa.gov Tue Jul 13 01:00:58 2010 From: Chris.Barker at noaa.gov (Christopher Barker) Date: Mon, 12 Jul 2010 16:00:58 -0700 Subject: [Pythonmac-SIG] py2app problem: invalid matplotlib recipe In-Reply-To: References: Message-ID: <4C3B9EAA.8000208@noaa.gov> Russell E. Owen wrote: > Removing the line listed above from the recipe fixes the problem -- great. > But it also loses the test for the presence of pytz, which may be a bad > thing (if so, it should also test for dateutils, right?). I don't think testing for the presence of something is py2apps job. If you don't need it, it's OK if it' snot present, and if you do, your app tests should catch it. The point of this sort of recipe is to include stuff that many people need, but which are not imported in the usual way, so py2app would otherwise miss it. I suspect that MPL imports pytz differently than it used to, and thus this recipe is not longer needed. Of course, it may still be needed for other versions of MPL, so I don't know if we should just strip it out. But I can't remember who wrote it when, so I don't know how old a version of MPL you need it for. -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 at noaa.gov From phil.stphns at gmail.com Fri Jul 9 18:39:39 2010 From: phil.stphns at gmail.com (Philip Stephens) Date: Fri, 9 Jul 2010 09:39:39 -0700 Subject: [Pythonmac-SIG] py2app hang on build Message-ID: Hello, I hope this is the appropriate place to ask for help using py2app. If not, please redirect me. I've built my app for windows using py2exe, and now trying to build a mac app. py2app appears to work until the last line in the inline message, at which point I went to bed and it was still chugging on it the next morning. All of the previous 'creating...' data messages went relatively quickly, as in less than 5 seconds. Is this an ascii/unicode issue? Thanks for any pointers you can offer. By the way, the data it hangs on are shapefiles. system: OS X 10.6.3, Intel. *** creating application bundle: toolkit *** creating /Users/stephens/code/eda08/code/toolkit/dist/toolkit.app/Contents/Resources/mpl-data creating /Users/stephens/code/eda08/code/toolkit/dist/toolkit.app/Contents/Resources/mpl-data/example creating /Users/stephens/code/eda08/code/toolkit/dist/toolkit.app/Contents/Resources/mpl-data/fonts creating /Users/stephens/code/eda08/code/toolkit/dist/toolkit.app/Contents/Resources/mpl-data/fonts/afm creating /Users/stephens/code/eda08/code/toolkit/dist/toolkit.app/Contents/Resources/mpl-data/images creating /Users/stephens/code/eda08/code/toolkit/dist/toolkit.app/Contents/Resources/mpl-data/fonts/ttf creating /Users/stephens/code/eda08/code/toolkit/dist/toolkit.app/Contents/Resources/mpl-data/fonts/pdfcorefonts creating /Users/stephens/code/eda08/code/toolkit/dist/toolkit.app/Contents/Resources/data creating /Users/stephens/code/eda08/code/toolkit/dist/toolkit.app/Contents/Resources/data/toolkit_data creating /Users/stephens/code/eda08/code/toolkit/dist/toolkit.app/Contents/Resources/data/toolkit_data/tracts1990 creating /Users/stephens/code/eda08/code/toolkit/dist/toolkit.app/Contents/Resources/data/toolkit_data/tracts2000 creating /Users/stephens/code/eda08/code/toolkit/dist/toolkit.app/Contents/Resources/data/toolkit_data/1990_dissolved_unproj creating /Users/stephens/code/eda08/code/toolkit/dist/toolkit.app/Contents/Resources/data/toolkit_data/2000_dissolved_unproj creating /Users/stephens/code/eda08/code/toolkit/dist/toolkit.app/Contents/Resources/data/toolkit_data/neighborhoods1990 creating /Users/stephens/code/eda08/code/toolkit/dist/toolkit.app/Contents/Resources/data/toolkit_data/neighborhoods2000 creating /Users/stephens/code/eda08/code/toolkit/dist/toolkit.app/Contents/Resources/data/toolkit_data/msaTracts2000polygons_unproj ^CTraceback (most recent call last): File "/Library/Frameworks/Python.framework/Versions/6.0.4/lib/python2.6/site-packages/py2app/build_app.py", line 589, in _run self.run_normal() File "/Library/Frameworks/Python.framework/Versions/6.0.4/lib/python2.6/site-packages/py2app/build_app.py", line 660, in run_normal self.create_binaries(py_files, pkgdirs, extensions, loader_files) File "/Library/Frameworks/Python.framework/Versions/6.0.4/lib/python2.6/site-packages/py2app/build_app.py", line 755, in create_binaries target, arcname, pkgexts, copyexts, target.script) File "/Library/Frameworks/Python.framework/Versions/6.0.4/lib/python2.6/site-packages/py2app/build_app.py", line 1180, in build_executable copy_resource(src, dest, dry_run=self.dry_run) File "/Library/Frameworks/Python.framework/Versions/6.0.4/lib/python2.6/site-packages/py2app/util.py", line 96, in copy_resource copy_file(source, destination, dry_run=dry_run) File "/Library/Frameworks/Python.framework/Versions/6.0.4/lib/python2.6/site-packages/py2app/util.py", line 101, in copy_file zf, zp = path_to_zip(source) File "/Library/Frameworks/Python.framework/Versions/6.0.4/lib/python2.6/site-packages/py2app/util.py", line 127, in path_to_zip while not os.path.exists(path): KeyboardInterrupt > /Library/Frameworks/Python.framework/Versions/6.0.4/lib/python2.6/site-packages/py2app/util.py(127)path_to_zip() -> while not os.path.exists(path): (Pdb) (Pdb) -- Philip Stephens Research Analyst GeoDa Center for Geospatial Analysis and Computation Arizona State University philip.stephens at asu.edu "Please do not send me Microsoft Office/Apple iWork documents. Send OpenDocument instead! http://fsf.org/campaigns/opendocument/" -------------- next part -------------- An HTML attachment was scrubbed... URL: From jjackson at pobox.com Tue Jul 13 07:18:17 2010 From: jjackson at pobox.com (John Jackson) Date: Mon, 12 Jul 2010 22:18:17 -0700 Subject: [Pythonmac-SIG] py-Appscript broken with FileMaker 11? In-Reply-To: <7C82E8A0-159C-41E1-8746-63315CD24728@virgin.net> References: <7C82E8A0-159C-41E1-8746-63315CD24728@virgin.net> Message-ID: Thanks for this. It worked in terms of getting the application to talk to FileMaker, just as you described. I've filed a bug report with FileMaker. But it appears that they have broken a lot more in the AppleScript implementation (see http://forums.filemaker.com/posts/4b2544f7a4) such that it accepts events w/o delay (in some sort of parallel manner causing database deadlocks. It doesn't wait for internal scripts to finish before accepting another applescript -- which it use to. I'm now running into so many issues that I may just have to abandon version 11 until they fix them. On Jul 12, 2010, at 10:19 AM, has wrote: > John Jackson wrote: > >> I recently upgraded FileMaker to version 11, and discovered that my python-based application that relies on appscript to control a FileMaker database has broken. > > I believe that's a bug in FMP 11, where sending an ascr/gdte (get terminology) event to FMP returns the default Cocoa Scripting terminology, rather than FMP's actual dictionary. You should file a bug report with FileMaker, as this will also affect scripting FMP from AppleScript via Remote Apple Events. > > As a workaround, use the dump function in appscript.terminology to export the FMP dictionary to a static module and pass that module when creating app objects, like this: app('FileMaker Pro', terms=fmp11terminologymodule). Make sure you run the dump command under 32-bit Python (use 'arch -i386' followed by the path to the python interpreter in the Python.framework bundle) as it uses OSAGetAppTerminology, which isn't present in OS X's 64-bit APIs. > > HTH > > has > -- > Learn AppleScript, 3rd edition, Sanderson & Rosenthal: > http://apress.com/book/view/9781430223610 > Control AppleScriptable applications from Python, Ruby and ObjC: > http://appscript.sourceforge.net > > _______________________________________________ > Pythonmac-SIG maillist - Pythonmac-SIG at python.org > http://mail.python.org/mailman/listinfo/pythonmac-sig > unsubscribe: http://mail.python.org/mailman/options/Pythonmac-SIG > From ronaldoussoren at mac.com Tue Jul 13 09:52:12 2010 From: ronaldoussoren at mac.com (Ronald Oussoren) Date: Tue, 13 Jul 2010 09:52:12 +0200 Subject: [Pythonmac-SIG] lists and accessors In-Reply-To: References: <3C078D16-A978-4094-8B21-681C55416627@gmx.de> <27741206-E460-47BB-91C1-2BC69287FB08@mac.com> Message-ID: <80F16F00-5A6B-48C4-A4E0-CB4006F4BBBB@mac.com> On 11 Jul, 2010, at 1:18, Georg Seifert wrote: > Hi Ronald, > > Thanks for your response. > > I did tried this: > > class PathNodesProxy (object): > def __init__(self, owner): > self._ower = owner > def __getitem__(self, i): > print "__getitem__", i > return self.nodeAtIndex_(i) > def __setitem__(self, i, Node): > print "__setitem__", i, Node > self.setNode_atIndex_(Node, i) > def __delitem__(self, i): > print "__delitem__", i > self.removeNodeAtIndex_(i) > def append(self, Node): > print "append", Node > self.addNode_(Node) > def count(self): > print "count" > return self.nodes().count() > > del GSPath.__dict__['nodes'] > GSPath.__dict__['nodes'] = lambda self: PathNodesProxy(self) > > the next to last line gives this error: > TypeError: 'dictproxy' object does not support item deletion > and the last (if I remove the first): > TypeError: 'dictproxy' object does not support item assignment > > If I used: > GSPath.nodes = lambda self: PathNodesProxy(self) > It worked somehow, but it actually removed the nodes property from the cocoa object. And I still had to use the parenthesis. This should work: GSPath.nodes = property(lambda self: PathNodesProxy(self)) I've tested this with the count property on an array: :>>> from Foundation import NSArray :>>> b = NSArray.arrayWithArray_([1,2]) :>>> type(b).count = property(lambda self: id(self)) :>>> b.pyobjc_instanceMethods.count() 2 :>>> b.count 4359092688 :>>> (The convoluted way to change the count property is because NSArray is a class cluster and is not relevant for your problem) Ronald -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 3567 bytes Desc: not available URL: From ronaldoussoren at mac.com Tue Jul 13 09:57:04 2010 From: ronaldoussoren at mac.com (Ronald Oussoren) Date: Tue, 13 Jul 2010 09:57:04 +0200 Subject: [Pythonmac-SIG] py2app problem: invalid matplotlib recipe In-Reply-To: References: Message-ID: On 12 Jul, 2010, at 22:39, Russell E. Owen wrote: > py2app 0.4.3's matplotlib recipe includes: > > mf.import_hook('pytz.zoneinfo', m, ['UTC']) > > This has two incompatibilities with the current version of pytz: > - zoneinfo is a data directory but not a package (no __init__.py) > - UTC is not a python file (it is called UTC, not UTC.py) > > Removing the line listed above from the recipe fixes the problem -- it > allows my build to complete, and the resulting application includes > pytz with its zoneinfo directory and data files). I'lll remove the line. > > But it also loses the test for the presence of pytz, which may be a bad > thing (if so, it should also test for dateutils, right?). > > I'm curious: is the line in question supposed to do more than test if > pytz exists? If it only tests if pytz works then why does it have such > detail about the internals of pytz? If it does more (e.g. add pytz files > to the bundled application), then why did my fix work? I have no idea. The line has the same effect as an import of pytz.zoneinfo. Maybe a previous version of matplotlib imported pytz without using an import statement (either by calling __import__ or by doing the import from C code), but that's just a guess and not based on any knowlegde about matplotlib. Ronald -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 3567 bytes Desc: not available URL: From hengist.podd at virgin.net Wed Jul 14 07:12:23 2010 From: hengist.podd at virgin.net (has) Date: Wed, 14 Jul 2010 06:12:23 +0100 Subject: [Pythonmac-SIG] Pythonmac-SIG] AEDesc error: Unsupported Type In-Reply-To: References: Message-ID: <978A8CD0-69B0-4D23-81CC-50865EC00B8C@virgin.net> Ben Pedersen wrote: > Working with py-appscript to automate testing and I'm getting an error > deep in aemreference/aemcodecs. [...] > > class SuperTest(): > def getProcessHandle(procName="TextEdit"): should read: def getProcessHandle(self, procName="TextEdit"): HTH has -- Learn AppleScript, 3rd edition, Sanderson & Rosenthal: http://apress.com/book/view/9781430223610 Control AppleScriptable applications from Python, Ruby and ObjC: http://appscript.sourceforge.net From pedben at gmail.com Wed Jul 14 14:11:02 2010 From: pedben at gmail.com (Ben Pedersen) Date: Wed, 14 Jul 2010 08:11:02 -0400 Subject: [Pythonmac-SIG] AEDesc Error Message-ID: Wow - thanks. Fixed that once, apparently failed to save it. BP On Wed, Jul 14, 2010 at 6:00 AM, wrote: > Send Pythonmac-SIG mailing list submissions to > pythonmac-sig at python.org > > To subscribe or unsubscribe via the World Wide Web, visit > http://mail.python.org/mailman/listinfo/pythonmac-sig > or, via email, send a message with subject or body 'help' to > pythonmac-sig-request at python.org > > You can reach the person managing the list at > pythonmac-sig-owner at python.org > > When replying, please edit your Subject line so it is more specific > than "Re: Contents of Pythonmac-SIG digest..." > > Today's Topics: > > 1. Re: Pythonmac-SIG] AEDesc error: Unsupported Type (has) > > > ---------- Forwarded message ---------- > From: has > To: pythonmac-sig at python.org > Date: Wed, 14 Jul 2010 06:12:23 +0100 > Subject: Re: [Pythonmac-SIG] Pythonmac-SIG] AEDesc error: Unsupported Type > Ben Pedersen wrote: > > > Working with py-appscript to automate testing and I'm getting an error > > deep in aemreference/aemcodecs. [...] > > > > class SuperTest(): > > def getProcessHandle(procName="TextEdit"): > > should read: > > def getProcessHandle(self, procName="TextEdit"): > > HTH > > has > -- > Learn AppleScript, 3rd edition, Sanderson & Rosenthal: > http://apress.com/book/view/9781430223610 > Control AppleScriptable applications from Python, Ruby and ObjC: > http://appscript.sourceforge.net > > > > unsubscribe: http://mail.python.org/mailman/options/Pythonmac-SIG > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From ronaldoussoren at mac.com Fri Jul 16 07:07:11 2010 From: ronaldoussoren at mac.com (Ronald Oussoren) Date: Fri, 16 Jul 2010 07:07:11 +0200 Subject: [Pythonmac-SIG] ANN: EuroPython MacPython sprint Message-ID: <107F1EF5-8F19-49FC-9E2D-3B8325DDFDC8@mac.com> Hi, I'll be sprinting on MacPython at EuroPython, see . Ronald -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 3567 bytes Desc: not available URL: From fuzzyman at voidspace.org.uk Fri Jul 16 12:42:21 2010 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Fri, 16 Jul 2010 11:42:21 +0100 Subject: [Pythonmac-SIG] ANN: EuroPython MacPython sprint In-Reply-To: <107F1EF5-8F19-49FC-9E2D-3B8325DDFDC8@mac.com> References: <107F1EF5-8F19-49FC-9E2D-3B8325DDFDC8@mac.com> Message-ID: On 16 July 2010 06:07, Ronald Oussoren wrote: > Hi, > > I'll be sprinting on MacPython at EuroPython, see < > http://wiki.europython.eu/Sprints/MacPython>. > That's great. There will be a whole bunch of core developers sprinting, so even if we are on different topics it would be great to be together. Hopefully with any other hackers we can persuade to join us... :-) All the best, Michael > > Ronald > _______________________________________________ > Pythonmac-SIG maillist - Pythonmac-SIG at python.org > http://mail.python.org/mailman/listinfo/pythonmac-sig > unsubscribe: http://mail.python.org/mailman/options/Pythonmac-SIG > > -- http://www.voidspace.org.uk -------------- next part -------------- An HTML attachment was scrubbed... URL: From georg.seifert at gmx.de Fri Jul 16 13:34:32 2010 From: georg.seifert at gmx.de (Georg Seifert) Date: Fri, 16 Jul 2010 13:34:32 +0200 Subject: [Pythonmac-SIG] lists and accessors In-Reply-To: <80F16F00-5A6B-48C4-A4E0-CB4006F4BBBB@mac.com> References: <3C078D16-A978-4094-8B21-681C55416627@gmx.de> <27741206-E460-47BB-91C1-2BC69287FB08@mac.com> <80F16F00-5A6B-48C4-A4E0-CB4006F4BBBB@mac.com> Message-ID: Hi Ronald, This works wonderfully. Many Thanks. Georg > > On 11 Jul, 2010, at 1:18, Georg Seifert wrote: > >> Hi Ronald, >> >> Thanks for your response. >> >> I did tried this: >> >> class PathNodesProxy (object): >> def __init__(self, owner): >> self._ower = owner >> def __getitem__(self, i): >> print "__getitem__", i >> return self.nodeAtIndex_(i) >> def __setitem__(self, i, Node): >> print "__setitem__", i, Node >> self.setNode_atIndex_(Node, i) >> def __delitem__(self, i): >> print "__delitem__", i >> self.removeNodeAtIndex_(i) >> def append(self, Node): >> print "append", Node >> self.addNode_(Node) >> def count(self): >> print "count" >> return self.nodes().count() >> >> del GSPath.__dict__['nodes'] >> GSPath.__dict__['nodes'] = lambda self: PathNodesProxy(self) >> >> the next to last line gives this error: >> TypeError: 'dictproxy' object does not support item deletion >> and the last (if I remove the first): >> TypeError: 'dictproxy' object does not support item assignment >> >> If I used: >> GSPath.nodes = lambda self: PathNodesProxy(self) >> It worked somehow, but it actually removed the nodes property from the cocoa object. And I still had to use the parenthesis. > > This should work: > > GSPath.nodes = property(lambda self: PathNodesProxy(self)) > > I've tested this with the count property on an array: > > :>>> from Foundation import NSArray > :>>> b = NSArray.arrayWithArray_([1,2]) > :>>> type(b).count = property(lambda self: id(self)) > :>>> b.pyobjc_instanceMethods.count() > 2 > :>>> b.count > 4359092688 > :>>> > > (The convoluted way to change the count property is because NSArray is a class cluster and is not relevant for your problem) > > Ronald > From ronaldoussoren at mac.com Sun Jul 18 14:59:21 2010 From: ronaldoussoren at mac.com (Ronald Oussoren) Date: Sun, 18 Jul 2010 13:59:21 +0100 Subject: [Pythonmac-SIG] python3 support for py2app Message-ID: Folks, I just committed patches to py2app and related packags that enable python3 support. You'll have to install altgraph, modulegraph, macholib and py2app from the repository. I have barely tested these changes, the only program I've tried is the TinyTinyEdit example in the py2app repository using the default options (fully standalone, no alias build). Semi-standalone should work, alias builds probably need work (I haven't done anything with that, and the code does scary thing with Carbon aliases). I'd really appreciate if people could test this version, both with python 2.x and python 3.x. If it does work I'll push a release to PyPI. Ronald -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 3567 bytes Desc: not available URL: From ronaldoussoren at mac.com Mon Jul 19 09:58:21 2010 From: ronaldoussoren at mac.com (Ronald Oussoren) Date: Mon, 19 Jul 2010 08:58:21 +0100 Subject: [Pythonmac-SIG] Future 64-bit installers Message-ID: <44F47665-6748-41BF-A4E3-64AE5D88DA39@mac.com> Hi, We had a short discussion on the 2.7-macosx10.5 installer for python 2.7 at the europython language summit due to the unfortunate problems with IDLE and Tkinter in that installer: tkinter doesn't work in 64-bit due to being linked with Tk 8.4 and for some reason IDLE.app doesn't work either (even though that worked earlier in the develpment process). The consensus at the summit was to replace the macosx10.5 installer (ppc, x86, x86_64) by a macosx10.6 (x86, x86_64) installer for future releases. That enables linking with Tk 8.5 and that would solve a number of issues other than being available in 64-bit code. Users of OSX 10.5 (or earlier) can still use the macosx10.3 installer, that would stay the same. The only difference for OSX 10.5 users is that they cannot use 64-bit code without building their own binaries. The alternative to raising the OSX requirement is to ship Tk 8.5 in the installer and that would grow the installer, and would increase my load. Ronald P.S. It should be possible to use the future macosx10.6 installer to install on 10.5 as well if you install Tk 8.5 yourself, but this won't be prominently advertised. -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 3567 bytes Desc: not available URL: From nad at acm.org Mon Jul 19 21:58:30 2010 From: nad at acm.org (Ned Deily) Date: Mon, 19 Jul 2010 12:58:30 -0700 Subject: [Pythonmac-SIG] Future 64-bit installers References: <44F47665-6748-41BF-A4E3-64AE5D88DA39@mac.com> Message-ID: In article <44F47665-6748-41BF-A4E3-64AE5D88DA39 at mac.com>, Ronald Oussoren wrote: > We had a short discussion on the 2.7-macosx10.5 installer for python 2.7 at > the europython language summit due to the unfortunate problems with IDLE and > Tkinter in that installer: tkinter doesn't work in 64-bit due to being linked > with Tk 8.4 and for some reason IDLE.app doesn't work either (even though > that worked earlier in the develpment process). > > The consensus at the summit was to replace the macosx10.5 installer (ppc, > x86, x86_64) by a macosx10.6 (x86, x86_64) installer for future releases. > That enables linking with Tk 8.5 and that would solve a number of issues > other than being available in 64-bit code. It will also solve the problem of needless compilation of PPC code on 10.6 when building extension modules and removing any requirements to build 3-way versions of 3rd-party libraries. I think this is the right solution (and the one I suggested here last fall). Due to the dropping of support of PPC machines in 10.6 and the moving to default 64-bit, it still seems to me that there is a natural gap between 10.5 and 10.6 and much more natural to draw a line between them. > Users of OSX 10.5 (or earlier) can still use the macosx10.3 installer, that > would stay the same. The only difference for OSX 10.5 users is that they > cannot use 64-bit code without building their own binaries. ... which is the way things had always been up to the 2.7 release. And clearly as time goes on, the use of 10.5 in general and 64-bit on 10.5 will continue to drop. Nothing changes for the G5 (ppc64) users who are stuck with 10.5, in any case, since the 2.7 installer doesn't include ppc64. > The alternative to raising the OSX requirement is to ship Tk 8.5 in the > installer and that would grow the installer, and would increase my load. Not a good idea! > P.S. It should be possible to use the future macosx10.6 installer to install > on 10.5 as well if you install Tk 8.5 yourself, but this won't be prominently > advertised. I'm not sure that will work unless you continue to supply other things like openssl that have been upgraded in OS X between 10.5 and 10.6. It's probably a bad idea to set any expectations of that. The message should be: "if you want Tk 8.5 or 64-bit on 10.5, build it yourself. Or use MacPorts." Keep it simple! -- Ned Deily, nad at acm.org From Chris.Barker at noaa.gov Mon Jul 19 22:05:08 2010 From: Chris.Barker at noaa.gov (Christopher Barker) Date: Mon, 19 Jul 2010 13:05:08 -0700 Subject: [Pythonmac-SIG] Future 64-bit installers In-Reply-To: <44F47665-6748-41BF-A4E3-64AE5D88DA39@mac.com> References: <44F47665-6748-41BF-A4E3-64AE5D88DA39@mac.com> Message-ID: <4C44AFF4.1080600@noaa.gov> Ronald Oussoren wrote: > The consensus at the summit was to replace the macosx10.5 installer > (ppc, x86, x86_64) by a macosx10.6 (x86, x86_64) installer for future > releases. That enables linking with Tk 8.5 and that would solve a number > of issues other than being available in 64-bit code. > > Users of OSX 10.5 (or earlier) can still use the macosx10.3 > installer, that would stay the same. So there will be two: one for 10.6 one for 10.3.9 -- 10.5? The later will be same as it's been for ages? If so, sounds good to me. Thanks again for all your work on this, Ronald. -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 at noaa.gov From grubert at users.sourceforge.net Tue Jul 20 11:57:12 2010 From: grubert at users.sourceforge.net (engelbert gruber) Date: Tue, 20 Jul 2010 11:57:12 +0200 Subject: [Pythonmac-SIG] py2app status Message-ID: hi i am struggling with py2app see http://wiki.python.org/moin/MacPython/py2app could it be that modulegraph.py is missing :: from itertools import ifilter how about a new release of py2app on pypi ? cheers From ronaldoussoren at mac.com Tue Jul 20 16:45:20 2010 From: ronaldoussoren at mac.com (Ronald Oussoren) Date: Tue, 20 Jul 2010 15:45:20 +0100 Subject: [Pythonmac-SIG] py2app status In-Reply-To: References: Message-ID: <9F13C076-169B-4FEF-9772-594DA9C00D4D@mac.com> Does the version in the repository work for you? I'm currently at europython and have awful connectivity on my laptop. I'll release once I have done some more testing and have a working Internet connection Ronald (on an iPad that does have connectivity) On Jul 20, 2010, at 10:57, engelbert gruber wrote: > hi > > i am struggling with py2app see http://wiki.python.org/moin/MacPython/py2app > > could it be that modulegraph.py is missing :: > > from itertools import ifilter > > how about a new release of py2app on pypi ? > > cheers > _______________________________________________ > Pythonmac-SIG maillist - Pythonmac-SIG at python.org > http://mail.python.org/mailman/listinfo/pythonmac-sig > unsubscribe: http://mail.python.org/mailman/options/Pythonmac-SIG From rowen at uw.edu Tue Jul 20 21:15:46 2010 From: rowen at uw.edu (Russell E. Owen) Date: Tue, 20 Jul 2010 12:15:46 -0700 Subject: [Pythonmac-SIG] Future 64-bit installers References: <44F47665-6748-41BF-A4E3-64AE5D88DA39@mac.com> Message-ID: In article <44F47665-6748-41BF-A4E3-64AE5D88DA39 at mac.com>, Ronald Oussoren wrote: > Hi, > > We had a short discussion on the 2.7-macosx10.5 installer for python 2.7 at > the europython language summit due to the unfortunate problems with IDLE and > Tkinter in that installer: tkinter doesn't work in 64-bit due to being linked > with Tk 8.4 and for some reason IDLE.app doesn't work either (even though > that worked earlier in the develpment process). > > The consensus at the summit was to replace the macosx10.5 installer (ppc, > x86, x86_64) by a macosx10.6 (x86, x86_64) installer for future releases. > That enables linking with Tk 8.5 and that would solve a number of issues > other than being available in 64-bit code. > > Users of OSX 10.5 (or earlier) can still use the macosx10.3 installer, that > would stay the same. The only difference for OSX 10.5 users is that they > cannot use 64-bit code without building their own binaries. > > The alternative to raising the OSX requirement is to ship Tk 8.5 in the > installer and that would grow the installer, and would increase my load. > > Ronald > > P.S. It should be possible to use the future macosx10.6 installer to install > on 10.5 as well if you install Tk 8.5 yourself, but this won't be prominently > advertised.------------------------------------------------------------------- > -- I assume users of 106 can also use the 10.3.9 version if they wish -- e.g. for people building applications that need to run on a wide range of Macs. If so, this sounds fine to me. Users who need maximum compatibility can use the 10.3.9 version. Users who want 64-bit can install the 10.6-only version. -- Russell From ronaldoussoren at mac.com Wed Jul 21 09:47:02 2010 From: ronaldoussoren at mac.com (Ronald Oussoren) Date: Wed, 21 Jul 2010 08:47:02 +0100 Subject: [Pythonmac-SIG] Future 64-bit installers In-Reply-To: <4C44AFF4.1080600@noaa.gov> References: <44F47665-6748-41BF-A4E3-64AE5D88DA39@mac.com> <4C44AFF4.1080600@noaa.gov> Message-ID: <835E8E65-6AAF-4A30-8A12-188BF28194FB@mac.com> On 19 Jul, 2010, at 21:05, Christopher Barker wrote: > Ronald Oussoren wrote: > >> The consensus at the summit was to replace the macosx10.5 installer >> (ppc, x86, x86_64) by a macosx10.6 (x86, x86_64) installer for future >> releases. That enables linking with Tk 8.5 and that would solve a number >> of issues other than being available in 64-bit code. >> Users of OSX 10.5 (or earlier) can still use the macosx10.3 >> installer, that would stay the same. > > So there will be two: > > one for 10.6 Yes, supporting intel processors in 32-bit and 64-bit mode > > one for 10.3.9 -- 10.5? Actually, for 10.3.9 and later, it will work just fine on 10.6. > > The later will be same as it's been for ages? Yes. Ronald -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 3567 bytes Desc: not available URL: From grubert at users.sourceforge.net Wed Jul 21 10:24:38 2010 From: grubert at users.sourceforge.net (engelbert gruber) Date: Wed, 21 Jul 2010 10:24:38 +0200 Subject: [Pythonmac-SIG] py2app testing modulegraph Message-ID: hi modulegraph.py os_listdir hangs on none existing dirs (strange) :: def os_listdir(path): """ os.listdir with support for zipfiles """ try: return os.listdir(path) except os.error: info = sys.exc_info() rest = '' while not os.path.exists(path): path, r = os.path.split(path) rest = os.path.join(r, rest) workaround :: rest = '' prev_rest = None while not os.path.exists(path) and prev_rest != rest: prev_rest = rest path, r = os.path.split(path) rest = os.path.join(r, rest) is there a unittest function to verify endless loops ? cheers REPEATED message from correct list account: i am trying to setup a modulegraph test that triggers missing import for ifilter, imap some hurdles * i am not at a mac currently. a good thing, this results in cross platform tests * altgraph must be installed because pkg_resource require does not find it otherwise this is not so good, as i prefer not to install things but just copy/symlink especially while developing * modulegraph.util uses :: if sys.version_info[0] != 2: import re cookie_re = re.compile(b"coding[:=]\s*([-\w.]+)") it is correct, that this wont be executed for python versions 2.*, but it will be compiled and the syntax ``b"something"`` works only from 2.6 up cheers From ronaldoussoren at mac.com Wed Jul 21 10:55:52 2010 From: ronaldoussoren at mac.com (Ronald Oussoren) Date: Wed, 21 Jul 2010 09:55:52 +0100 Subject: [Pythonmac-SIG] Future 64-bit installers In-Reply-To: References: <44F47665-6748-41BF-A4E3-64AE5D88DA39@mac.com> Message-ID: <132DEC3B-CC44-4D1C-B79F-6D7BAB296313@mac.com> On 19 Jul, 2010, at 20:58, Ned Deily wrote: > > >> P.S. It should be possible to use the future macosx10.6 installer to install >> on 10.5 as well if you install Tk 8.5 yourself, but this won't be prominently >> advertised. > > I'm not sure that will work unless you continue to supply other things > like openssl that have been upgraded in OS X between 10.5 and 10.6. > It's probably a bad idea to set any expectations of that. The message > should be: "if you want Tk 8.5 or 64-bit on 10.5, build it yourself. Or > use MacPorts." Keep it simple! You're right, compatibility isn't as easy as I had hoped, although that could be worked around of course. But, better not do that to get a clean path to the future. Ronald -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 3567 bytes Desc: not available URL: From ronaldoussoren at mac.com Wed Jul 21 11:01:02 2010 From: ronaldoussoren at mac.com (Ronald Oussoren) Date: Wed, 21 Jul 2010 10:01:02 +0100 Subject: [Pythonmac-SIG] py2app testing modulegraph In-Reply-To: References: Message-ID: On 21 Jul, 2010, at 9:24, engelbert gruber wrote: > hi > > modulegraph.py os_listdir hangs on none existing dirs (strange) :: I'll look into this at the europython sprints. > > is there a unittest function to verify endless loops ? No. Sadly enough py2app and its dependencies hardly have tests at all (although some are hidden in the source code). Adding unittests is on my todo-list, but writing tests for already existing code is no fun. > > cheers > > > REPEATED message from correct list account: > > i am trying to setup a modulegraph test that triggers missing import > for ifilter, imap > > some hurdles > > * i am not at a mac currently. > > a good thing, this results in cross platform tests modulegraph should be platform independent, although I'm not 100% sure about interaction with macholib without looking at the code. > > * altgraph must be installed because pkg_resource require does not > find it otherwise > > this is not so good, as i prefer not to install things but just > copy/symlink especially > while developing This won't be changed, you obviously have to install dependencies before using a packages. I'd advise you to look into virtualenv to create sandboxes for development. > > * modulegraph.util uses :: > > if sys.version_info[0] != 2: > import re > cookie_re = re.compile(b"coding[:=]\s*([-\w.]+)") > > it is correct, that this wont be executed for python versions 2.*, > but it will be compiled and the syntax ``b"something"`` works > only from 2.6 up The b"..." is a bug and will get fixed. Ronald -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 3567 bytes Desc: not available URL: From Chris.Barker at noaa.gov Wed Jul 21 19:54:07 2010 From: Chris.Barker at noaa.gov (Christopher Barker) Date: Wed, 21 Jul 2010 10:54:07 -0700 Subject: [Pythonmac-SIG] py2app testing modulegraph In-Reply-To: References: Message-ID: <4C47343F.20706@noaa.gov> Ronald Oussoren wrote: > modulegraph should be platform independent indeed -- it's used by bbfreeze: http://pypi.python.org/pypi/bbfreeze/0.96.5 Though I think he's forked it. But it might be good to get in touch and see if he's got patches to integrate. -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 at noaa.gov From rowen at uw.edu Wed Jul 21 23:24:13 2010 From: rowen at uw.edu (Russell E. Owen) Date: Wed, 21 Jul 2010 14:24:13 -0700 Subject: [Pythonmac-SIG] py2app not happy with zope.interface Message-ID: A py2app-built application stopped building properly recently after various upgrades. It would fail immediately on startup complaining that it could not find zope.interface. The app uses Twisted, which is why it needs zope.interface. I tried adding "zope" or "zope.interface" to "packages", but neither worked (in particular, the latter resulted in a traceback during the build). What did work was to add a blank __init__.py file to the "zope" directory in site-packages. But I don't know why that was useful. (I realize it makes zope into a package, but I don't know why that was necessary because zope.interface can already be imported from the command line -- presumably due to a pth file). Details are given below. -- Russell Details Python 2.6, py2app 0.4.3, zope.interface 3.6.1 and Twisted 10.0.0. zope.interface is installed as follows (contents of site-packages): zope/ zope/interface/ zope.interface-3.6.1-py2.6-nspkg.pth zope.interface-3.6.1-py2.6.egg-info/ If I add a blank zope/__init__.py then the py2app-built application runs properly. zope.interface-3.6.1-py2.6-nspkg.pth contains: import sys,new,os; p = os.path.join(sys._getframe(1).f_locals['sitedir'], *('zope',)); ie = os.path.exists(os.path.join(p,'__init__.py')); m = not ie and sys.modules.setdefault('zope',new.module('zope')); mp = (m or []) and m.__dict__.setdefault('__path__',[]); (p not in mp) and mp.append(p) I don't use easy_install (I installed zope.interface with pip), so easy_install.pth doesn't contain any zope info. For completeness, here is what it has: import sys; sys.__plen = len(sys.path) import sys; new=sys.path[sys.__plen:]; del sys.path[sys.__plen:]; p=getattr(sys,'__egginsert',0); sys.path[p:p]=new; sys.__egginsert = p+len(new) From ronaldoussoren at mac.com Thu Jul 22 16:05:28 2010 From: ronaldoussoren at mac.com (Ronald Oussoren) Date: Thu, 22 Jul 2010 15:05:28 +0100 Subject: [Pythonmac-SIG] py2app not happy with zope.interface In-Reply-To: References: Message-ID: <793A2D4F-E7F2-4285-9D8E-6C75882511F7@mac.com> On 21 Jul, 2010, at 22:24, Russell E. Owen wrote: > A py2app-built application stopped building properly recently after > various upgrades. It would fail immediately on startup complaining that > it could not find zope.interface. The app uses Twisted, which is why it > needs zope.interface. > > I tried adding "zope" or "zope.interface" to "packages", but neither > worked (in particular, the latter resulted in a traceback during the > build). > > What did work was to add a blank __init__.py file to the "zope" > directory in site-packages. But I don't know why that was useful. (I > realize it makes zope into a package, but I don't know why that was > necessary because zope.interface can already be imported from the > command line -- presumably due to a pth file). How did you install zope.interface? Basically which easy_install or pip command-line did you use to install? I guess the nspkg.pth ensures that zope.interface can be imported without an __init__ file and py2app doesn't parse those files (or doesn't understand how to do so). If I can reproduce the problem I can (and will) fix it. Ronald -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 3567 bytes Desc: not available URL: From ronaldoussoren at mac.com Thu Jul 22 16:11:33 2010 From: ronaldoussoren at mac.com (Ronald Oussoren) Date: Thu, 22 Jul 2010 15:11:33 +0100 Subject: [Pythonmac-SIG] py2app testing modulegraph In-Reply-To: <4C47343F.20706@noaa.gov> References: <4C47343F.20706@noaa.gov> Message-ID: <3945E10D-BDBB-41FF-A9AB-BC933BC8E6D8@mac.com> On 21 Jul, 2010, at 18:54, Christopher Barker wrote: > Ronald Oussoren wrote: >> modulegraph should be platform independent > > indeed -- it's used by bbfreeze: > > http://pypi.python.org/pypi/bbfreeze/0.96.5 > > Though I think he's forked it. But it might be good to get in touch and see if he's got patches to integrate. I really don't understand why people think it is a good idea to fork opensource packages unless the original author is completely unresponsive and/or moves the project in a different direction. Even then I'd let the original author know about that. Ronald -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 3567 bytes Desc: not available URL: From ronaldoussoren at mac.com Thu Jul 22 16:45:24 2010 From: ronaldoussoren at mac.com (Ronald Oussoren) Date: Thu, 22 Jul 2010 15:45:24 +0100 Subject: [Pythonmac-SIG] py2app testing modulegraph In-Reply-To: <3945E10D-BDBB-41FF-A9AB-BC933BC8E6D8@mac.com> References: <4C47343F.20706@noaa.gov> <3945E10D-BDBB-41FF-A9AB-BC933BC8E6D8@mac.com> Message-ID: <6B5AD13A-A3FF-4EDB-8F10-B97D9C631E76@mac.com> On 22 Jul, 2010, at 15:11, Ronald Oussoren wrote: > > On 21 Jul, 2010, at 18:54, Christopher Barker wrote: > >> Ronald Oussoren wrote: >>> modulegraph should be platform independent >> >> indeed -- it's used by bbfreeze: >> >> http://pypi.python.org/pypi/bbfreeze/0.96.5 >> >> Though I think he's forked it. But it might be good to get in touch and see if he's got patches to integrate. > > I really don't understand why people think it is a good idea to fork opensource packages unless the original author is completely unresponsive and/or moves the project in a different direction. Even then I'd let the original author know about that. And they very helpfully even didn't bother to document what they changed, or which version they forked. That makes comparing the two unnecessarily hard, and hence I won't bother to do so. Ronald -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 3567 bytes Desc: not available URL: From robin at reportlab.com Thu Jul 22 17:15:13 2010 From: robin at reportlab.com (Robin Becker) Date: Thu, 22 Jul 2010 16:15:13 +0100 Subject: [Pythonmac-SIG] OS 10.6 tkinter Message-ID: <4C486081.70700@chamonix.reportlab.co.uk> After a bit of a struggle I managed to get PIL, reportlab and its extensions all built and surviving their tests. This is on Intel OS 10.6.2 with the original python 2.6.1. Now I want to make use of a simple Tkinter+Pmw application which is running fine under windows and linux, but segfaults on 10.6.2 First off what kind of debugging can I expect to accomplish with 10.6.2? Does it do core dumps etc etc? I have a giant textual dump of threads etc etc, but that doesn't seem immediately useful to me as a non-mac person ......... > Interval Since Last Report: 34009 sec > Crashes Since Last Report: 2 > Per-App Interval Since Last Report: 154 sec > Per-App Crashes Since Last Report: 2 > Anonymous UUID: 05E43603-6DF7-49A2-87E8-BBF461A66996 > > Exception Type: EXC_BAD_ACCESS (SIGSEGV) > Exception Codes: 0x000000000000000d, 0x0000000000000000 > Crashed Thread: 0 Dispatch queue: com.apple.main-thread > > Application Specific Information: > objc_msgSend() selector name: release > > > Thread 0 Crashed: Dispatch queue: com.apple.main-thread > 0 libobjc.A.dylib 0x00007fff80645120 objc_msgSend + 44 > 1 com.apple.CoreFoundation 0x00007fff875b7246 _CFAutoreleasePoolPop + 230 > 2 com.apple.Foundation 0x00007fff80dcb2f8 -[NSAutoreleasePool drain] + 158 > 3 com.tcltk.tklibrary 0x00000001012f7a4f XQueryPointer + 2425 > 4 com.tcltk.tklibrary 0x00000001012f7d3f Tk_MacOSXSetupTkNotifier + 614 > 5 com.tcltk.tcllibrary 0x00000001011b52ae Tcl_DoOneEvent + 297 > 6 _tkinter.so 0x00000001001f1be9 init_tkinter + 1132 > 7 org.python.python 0x00000001000891df PyEval_EvalFrameEx + 15001 > ....... presumably this is some Tkinter/tk/tcl problem; any one have any ideas? -- Robin Becker From rowen at uw.edu Thu Jul 22 18:15:15 2010 From: rowen at uw.edu (Russell Owen) Date: Thu, 22 Jul 2010 09:15:15 -0700 Subject: [Pythonmac-SIG] py2app not happy with zope.interface In-Reply-To: <793A2D4F-E7F2-4285-9D8E-6C75882511F7@mac.com> References: <793A2D4F-E7F2-4285-9D8E-6C75882511F7@mac.com> Message-ID: <46249056-94A6-4C5A-8577-6AD6DA363527@uw.edu> I used "pip install zope.interface". -- Russell On Jul 22, 2010, at 7:05 AM, Ronald Oussoren wrote: > > On 21 Jul, 2010, at 22:24, Russell E. Owen wrote: > >> A py2app-built application stopped building properly recently after >> various upgrades. It would fail immediately on startup complaining >> that >> it could not find zope.interface. The app uses Twisted, which is >> why it >> needs zope.interface. >> >> I tried adding "zope" or "zope.interface" to "packages", but neither >> worked (in particular, the latter resulted in a traceback during the >> build). >> >> What did work was to add a blank __init__.py file to the "zope" >> directory in site-packages. But I don't know why that was useful. (I >> realize it makes zope into a package, but I don't know why that was >> necessary because zope.interface can already be imported from the >> command line -- presumably due to a pth file). > > How did you install zope.interface? Basically which easy_install or > pip command-line did you use to install? > > I guess the nspkg.pth ensures that zope.interface can be imported > without an __init__ file and py2app doesn't parse those files (or > doesn't understand how to do so). If I can reproduce the problem I > can (and will) fix it. > > Ronald > From rowen at uw.edu Thu Jul 22 19:06:24 2010 From: rowen at uw.edu (Russell E. Owen) Date: Thu, 22 Jul 2010 10:06:24 -0700 Subject: [Pythonmac-SIG] py2app not happy with zope.interface References: <793A2D4F-E7F2-4285-9D8E-6C75882511F7@mac.com> Message-ID: In article <793A2D4F-E7F2-4285-9D8E-6C75882511F7 at mac.com>, Ronald Oussoren wrote: > On 21 Jul, 2010, at 22:24, Russell E. Owen wrote: > > > A py2app-built application stopped building properly recently after > > various upgrades. It would fail immediately on startup complaining that > > it could not find zope.interface. The app uses Twisted, which is why it > > needs zope.interface. > > > > I tried adding "zope" or "zope.interface" to "packages", but neither > > worked (in particular, the latter resulted in a traceback during the > > build). > > > > What did work was to add a blank __init__.py file to the "zope" > > directory in site-packages. But I don't know why that was useful. (I > > realize it makes zope into a package, but I don't know why that was > > necessary because zope.interface can already be imported from the > > command line -- presumably due to a pth file). > > How did you install zope.interface? Basically which easy_install or pip > command-line did you use to install? I used "pip install zope.interface". > I guess the nspkg.pth ensures that zope.interface can be imported without an > __init__ file and py2app doesn't parse those files (or doesn't understand how > to do so). If I can reproduce the problem I can (and will) fix it. That would be much appreciated (though the workaround is clearly not too bad). Regards, -- Russell From moctodliamg at gmail.com Thu Jul 22 23:39:12 2010 From: moctodliamg at gmail.com (Seth Frey) Date: Thu, 22 Jul 2010 17:39:12 -0400 Subject: [Pythonmac-SIG] MacPorts+"make; make install": Etiquette and Sanitation Message-ID: I've been using *nix variants long enough (OS X 10.6 right now) to be totally reliant on the command line, but not long enough that I've got my head around managing dependencies. As a beginner, I started using my system's built in version of python, and if I needed a package, I installed ports, and if it wasn't there, I went through MacPython and tried again, and if I needed something that didn't work on those platforms, I used easy_install, or pip or fink or compiled myself, or messed with my path or changed some flags and when none of that worked I installed a newer or older version of Python (2.4 or 2.5 or 2.6 or 2.7 or 3) and tried everything again. Needless to say, using anything with more than a single dependency has been a nightmare, with lots of unprincipled trial and error, and only precarious peace. Two days ago I removed all Pythons except MacPorts 2.6 and Apple's built-in 2.5. No more MacPython. Then I uninstalled, cleaned and reinstalled every Python 2.6 package. I cleaned up my $PATH and $PYTHONPATH, and the latter just uses /opt. Great. One system. Very nice. I did this all to get Some Random Package working (SRP for short, you can perhaps insert igraph, cairo, matplotlib, num/sci/i/py), but after all that, the SRP still didn't work. After a day of trying everything, I uninstalled SRP and py26-SRP from ports, downloaded the most recent source, compiled and installed both myself. And this particular SRP works now. There was a small celebration, but this approach has a downside. In particular, if I ever have a port that depends on the SRP, than I will have to reinstall the troublesome ports. I expect to have to deal with conflicts when this happens. This is already happening in my currently stalled attempts to get pycairo working again. These downsides became apparent when I continued on to try and get SRP2 (cairo) working. Lots of other libraries depend on it, so I can't just uninstall it. I'm in the middle of this, and looking at another day of hacking away. Right now I've deactivated the SRP2 and py26-SRP2 ports. I didn't favor deactivation to uninstallation because I fully understand the consequences of deactivation, but because MacPorts let me. This is a good example of the unprincipled approach. With SRP2 deactivated, have I accidentally broken its dependents? Are those dependents using the SRP2 I compiled instead of the deactivated one that ports intended them for? Will this lead to problems? Recognizing that these questions as a warning sign, I'm worried that I'm not working towards peace. I figured that before I do more the wrong way, I should just ask the people who know about the right way. There are so many little decisions involved in keeping a sanitary, easy-to-maintain ecosystem of libraries: *I figure that I will inevitably have to go to source every now and then. I need a way to gingerly navigate any potential conflicts with an existing port of the same library. How do I walk the line, getting a port's dependents to only use it, while getting my scripts to only use the self-compiled new version. Is that even what I want? I suspect that the answer to this and all my other questions is at http://guide.macports.org/, but too much of it was over my head. I don't speak that language yet. *When I have different versions of a library to choose from, I can select one during compilation with ./configure, I can prefer one in my .profile, or even keep multiple eggs in different locations and prefer one by extending python's sys.path in each script I write. Which of these is considered kludge and what are the best practices and rules of thumb. I realize that "it depends," a lot, but if any heuristics pop to mind, I'd be very grateful. *Since MacPort's python has trumps, every homemade egg now installs itself in opt (the crazy /opt/.../Python.framework/.../site-packages path). Is that unsanitary since it wasn't from ports? Am I setting myself up for headaches? These little things are exactly the little incremental procedural specs that pile up and eventually make everything go to hell. I'm not so interested in advice for this or that library, but an approach that will serve me well forever as a kludge-prone *NIX user who is tired of getting into trouble. Is there some article about managing libraries that I should have read years ago? Is this suffering simply a part of life? Are there best practices, or does everyone have their own special approach with its own special problems? Sorry this was so long-winded. Thank you for your help. Hopefully I'm not alone here. Best, seth. From Chris.Barker at noaa.gov Fri Jul 23 01:21:22 2010 From: Chris.Barker at noaa.gov (Christopher Barker) Date: Thu, 22 Jul 2010 16:21:22 -0700 Subject: [Pythonmac-SIG] py2app testing modulegraph In-Reply-To: <3945E10D-BDBB-41FF-A9AB-BC933BC8E6D8@mac.com> References: <4C47343F.20706@noaa.gov> <3945E10D-BDBB-41FF-A9AB-BC933BC8E6D8@mac.com> Message-ID: <4C48D272.9010304@noaa.gov> Ronald Oussoren wrote: >> Ronald Oussoren wrote: >>> modulegraph should be platform independent >> indeed -- it's used by bbfreeze: >> >> http://pypi.python.org/pypi/bbfreeze/0.96.5 >> >> Though I think he's forked it. But it might be good to get in touch and see if he's got patches to integrate. > > I really don't understand why people think it is a good idea to fork opensource packages unless the original author is completely unresponsive and/or moves the project in a different direction. Even then I'd let the original author know about that. Neither do I -- indeed I specifically recommended that he report back to this list, and maybe even share more code with Py2app, as he was interested in making bb-freeze Mac-compatible at one point. But if he was interested in working more collaboratively, he probably wouldn't have started a brand new python bundling project in the first place! Ronald Oussoren wrote: > And they very helpfully even didn't bother to document what they > changed, or which version they forked. That makes comparing the two > unnecessarily hard, and hence I won't bother to do so. Darn -- what a pain! Have you tried asking him? He's been pretty responsive on his list. By the way -- he did post on this list at one point looking for volunteers to work on the Mac version of bb-freeze, and I don't think he got any takers. -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 at noaa.gov From lemoine.nathan at gmail.com Fri Jul 23 07:46:14 2010 From: lemoine.nathan at gmail.com (Nathan Lemoine) Date: Fri, 23 Jul 2010 01:46:14 -0400 Subject: [Pythonmac-SIG] python and py2app help Message-ID: Hi, I was wondering if someone could help me with a problem I'm having bundling my python script (originally built with the 2.5 version of Python that ships with OS X 10.5) with py2app. I've basically run through all the online help I can find on how to make it work (several times) and nothing has worked out. First, I tried running py2app following the Tutorial here: http://svn.pythonmac.org/py2app/py2app/trunk/doc/index.html . I received this error message: Traceback (most recent call last): File "/usr/local/bin/py2applet", line 5, in from pkg_resources import load_entry_point File "/System/Library/Frameworks/Python.framework/Versions/2.5/ Extras/lib/python/pkg_resources.py", line 2607, in File "/System/Library/Frameworks/Python.framework/Versions/2.5/ Extras/lib/python/pkg_resources.py", line 565, in resolve pkg_resources.DistributionNotFound: macholib>=1.3 So I figured the macholib library wasn't installed, so after some looking around i found this tutorial: http://aralbalkan.com/1675 so I followed it to the letter and received an error message that py2app couldn't find the modulegraph package >= 0.7.3, but I know I had installed a higher version. So things got even more confusing (for me), because I went into the python.org website and downloaded the 2.7 version of MacPython (thinking that might help). As soon as I did that, my script would no longer run from the shell, as it could not find any of the modules I had installed. After calling sys.path, I could see that it wasn't searching the proper paths for any of my 2.5 frameworks. In fact, searching my computer, I couldn't find the 2.5 frameworks anywhere. So then I uninstalled macports, reinstalled the modules (wxPython, PIL, pyglet, and others), reinstalled macports, etc. etc. Unfortunately, pyglet installed itself somewhere odd (and I have no idea why) and I haven't figured out how to get the new version of python (2.7) to permanently add its new path to sys.path. I've tried sys.path.append, but that doesn't seem to be a permanent fix. The other modules (wx, PIL) seem to have installed fine. Moreover, running the 'which python' command used to get me /usr/bin/python and now returns '/Library/Frameworks/Python.framework/Versions/2.7/bin/python'. So it gets stranger (to me). Following the py2app tutorial stills nets me an error message about macholib. Manually creating the setup.py file and calling py2app from within the python interpreter (per Aral Balkan's guide) doesn't get me any error messages about py2app, and the app actually does get built. Except it doesn't run because when I click on it, I get an error message about not being able to import the pyglet module. Also, I use TextWrangler for writing my scripts, and whenever I execute the script from within TextWrangler (via the program itself or by Terminal via TextWrangler), the script works great! So clearly TextWrangler is calling a different version of python (likely the original version 2.5 from \usr\bin\python?) that actually has the modules I need, but I could never get py2app to work in version 2.5, and when I installed MacPython, it seems to have overwritten 2.5 because now I can only initiate 2.7 in the shell, which then gets me error messages about importing modules. So my computer (and myself) is very confused about what version of Python is actually installed and operating from the shell or from TextWrangler. Additionally, regardless of version, I've never been able to get py2app to actually function. I have no idea where my 2.5 frameworks went, but they are still there, clearly, because TextWrangler calls them. I don't know how to force Terminal to open the \usr\bin\python version of python instead of the new version. I'm very new to programming and working with python and modules, etc (less than a week). I've written a pretty nice GUI program for having less than a week of experience, and all I'm trying to do is bundle it into an app. So I've learned what I could by following tutorials and instructions online, but now I feel that I've installed so many things following these tutorials that it's sort of confusing the whole system. Is there a way to basically just revert on back to a clean install of python and starting over? Or can someone help me get py2app to actually work from version 2.7/get version 2.7 to find my pyglet module. I feel like if I can solve that one problem it may actually build OK, despite the rather large mess I seem to have made of installs. I'm also very confused as to why TextWrangler can operate my script, or open termina (again, likely using the \usr\bin\python versionl, which then operates my script, whereas manually running the script from Terminal via python script.py gets me error messages about importing modules. From ronaldoussoren at mac.com Fri Jul 23 15:48:33 2010 From: ronaldoussoren at mac.com (Ronald Oussoren) Date: Fri, 23 Jul 2010 14:48:33 +0100 Subject: [Pythonmac-SIG] py2app testing modulegraph In-Reply-To: <4C48D272.9010304@noaa.gov> References: <4C47343F.20706@noaa.gov> <3945E10D-BDBB-41FF-A9AB-BC933BC8E6D8@mac.com> <4C48D272.9010304@noaa.gov> Message-ID: On 23 Jul, 2010, at 0:21, Christopher Barker wrote: > Ronald Oussoren wrote: >>> Ronald Oussoren wrote: >>>> modulegraph should be platform independent >>> indeed -- it's used by bbfreeze: >>> >>> http://pypi.python.org/pypi/bbfreeze/0.96.5 >>> >>> Though I think he's forked it. But it might be good to get in touch and see if he's got patches to integrate. >> I really don't understand why people think it is a good idea to fork opensource packages unless the original author is completely unresponsive and/or moves the project in a different direction. Even then I'd let the original author know about that. > > Neither do I -- indeed I specifically recommended that he report back to this list, and maybe even share more code with Py2app, as he was interested in making bb-freeze Mac-compatible at one point. > > But if he was interested in working more collaboratively, he probably wouldn't have started a brand new python bundling project in the first place! That depends, maybe he just wants to have one project that works everywhere, and then trying to merge py2exe, py2app and other projects is probably way much more work than just writing something from scratch. > > Ronald Oussoren wrote: >> And they very helpfully even didn't bother to document what they >> changed, or which version they forked. That makes comparing the two >> unnecessarily hard, and hence I won't bother to do so. > > Darn -- what a pain! Have you tried asking him? He's been pretty responsive on his list. No. > > By the way -- he did post on this list at one point looking for volunteers to work on the Mac version of bb-freeze, and I don't think he got any takers. I won't volunteer either, py2app works for me and works on python3. Ronald -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 3567 bytes Desc: not available URL: From Chris.Barker at noaa.gov Fri Jul 23 21:24:58 2010 From: Chris.Barker at noaa.gov (Christopher Barker) Date: Fri, 23 Jul 2010 12:24:58 -0700 Subject: [Pythonmac-SIG] py2app updates Message-ID: <4C49EC8A.5070900@noaa.gov> HI folks, I'm trying to test the latest py2app updates. However, easy_install is failing in a number of places. I'm trying: easy_install py2app==dev but get errors in the modulegraph dependency. When I install modulegraph==dev, I get errors in the altgraph dependency. If I install altgraph, then modulegraph, then py2app, the first two go OK, but I get: No local packages or download links found for modulegraph>=0.8 and, indeed, the modulegraph that installed with modulegraph==dev is: >>> modulegraph.__version__ '0.7.1' I'll keep plugging away, and maybe do a straight non-setuptools install, but it would be nice if this could get cleaned up. I'm a bit lost when it comes to setuptools, so I'm not sure I can work out a patch. -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 at noaa.gov From Chris.Barker at noaa.gov Fri Jul 23 21:51:16 2010 From: Chris.Barker at noaa.gov (Christopher Barker) Date: Fri, 23 Jul 2010 12:51:16 -0700 Subject: [Pythonmac-SIG] py2app updates In-Reply-To: <4C49EC8A.5070900@noaa.gov> References: <4C49EC8A.5070900@noaa.gov> Message-ID: <4C49F2B4.7010804@noaa.gov> Christopher Barker wrote: > Hi folks, > > I'm trying to test the latest py2app updates. However, easy_install is > failing in a number of places. I'm trying: > > easy_install py2app==dev > > but get errors in the modulegraph dependency. It looks like somehow pypi doesn't know about modulegraph svn (or has the wrong info). Anyway, I got it all from svn, and it built and installed fine. However, now I get the following error from py2app: Not much time to poke into this now, but it reminded my of how we need a set of py2app simple test applications. I'll try to make a few of those as I poke into this. -Chris *** creating application bundle: Maproom *** Traceback (most recent call last): File "/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/py2app-0.4.2-py2.6.egg/py2app/build_app.py", line 589, in _run self.run_normal() File "/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/py2app-0.4.2-py2.6.egg/py2app/build_app.py", line 660, in run_normal self.create_binaries(py_files, pkgdirs, extensions, loader_files) File "/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/py2app-0.4.2-py2.6.egg/py2app/build_app.py", line 755, in create_binaries target, arcname, pkgexts, copyexts, target.script) File "/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/py2app-0.4.2-py2.6.egg/py2app/build_app.py", line 1177, in build_executable for src, dest in self.iter_data_files(): File "/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/py2app-0.4.2-py2.6.egg/py2app/build_app.py", line 475, in iter_data_files allres = chain(getattr(dist, 'data_files', ()) or (), self.resources) NameError: global name 'chain' is not defined > /Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/py2app-0.4.2-py2.6.egg/py2app/build_app.py(475)iter_data_files() -> allres = chain(getattr(dist, 'data_files', ()) or (), self.resources) > > When I install modulegraph==dev, I get errors in the altgraph dependency. > > If I install altgraph, then modulegraph, then py2app, the first two go > OK, but I get: > > No local packages or download links found for modulegraph>=0.8 > > and, indeed, the modulegraph that installed with modulegraph==dev is: > > >>> modulegraph.__version__ > '0.7.1' > > > I'll keep plugging away, and maybe do a straight non-setuptools install, > but it would be nice if this could get cleaned up. > > I'm a bit lost when it comes to setuptools, so I'm not sure I can work > out a patch. > > -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 at noaa.gov From Chris.Barker at noaa.gov Fri Jul 23 22:45:49 2010 From: Chris.Barker at noaa.gov (Christopher Barker) Date: Fri, 23 Jul 2010 13:45:49 -0700 Subject: [Pythonmac-SIG] py2app trunk buglet Message-ID: <4C49FF7D.7010309@noaa.gov> Ronald, I found the following tiny bug in py2app/build_app.py: near line 475, there is: allres = chain(getattr(dist, 'data_files', ()) or (), self.resources) but "chain" was never defined. A simple: from itertools import chain At the top of the file seems to have fixed it. -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 at noaa.gov -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: py2app_chain_patch.diff URL: From engelbert.gruber at gmail.com Wed Jul 21 09:08:18 2010 From: engelbert.gruber at gmail.com (engelbert gruber) Date: Wed, 21 Jul 2010 09:08:18 +0200 Subject: [Pythonmac-SIG] py2app testing modulegraph Message-ID: hi i am trying to setup a modulegraph test that triggers missing import for ifilter, imap some hurdles * i am not at a mac currently. a good thing, this results in cross platform tests * altgraph must be installed because pkg_resource require does not find it otherwise this is not so good, as i prefer not to install things but just copy/symlink especially while developing * modulegraph.util uses :: if sys.version_info[0] != 2: import re cookie_re = re.compile(b"coding[:=]\s*([-\w.]+)") it is correct, that this wont be executed for python versions 2.*, but it will be compiled and the syntax ``b"something"`` works only from 2.6 up cheers From ronaldoussoren at mac.com Sat Jul 24 10:38:44 2010 From: ronaldoussoren at mac.com (Ronald Oussoren) Date: Sat, 24 Jul 2010 09:38:44 +0100 Subject: [Pythonmac-SIG] py2app trunk buglet In-Reply-To: <4C49FF7D.7010309@noaa.gov> References: <4C49FF7D.7010309@noaa.gov> Message-ID: <6B387DB6-6240-4284-984A-67161BC0A6B5@mac.com> On 23 Jul, 2010, at 21:45, Christopher Barker wrote: > Ronald, > > I found the following tiny bug in py2app/build_app.py: > > near line 475, there is: > > allres = chain(getattr(dist, 'data_files', ()) or (), self.resources) > > but "chain" was never defined. > > A simple: > > from itertools import chain > > At the top of the file seems to have fixed it. That's odd, it should have been their. It is in my checkout (Revision: 93), and I didn't just check in. Ronald > ) > -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 at noaa.gov > Index: py2app/build_app.py > =================================================================== > --- py2app/build_app.py (revision 80) > +++ py2app/build_app.py (working copy) > @@ -14,6 +14,7 @@ > import shlex > import shutil > from cStringIO import StringIO > +from itertools import chain > > from setuptools import Command > from distutils.util import convert_path > _______________________________________________ > Pythonmac-SIG maillist - Pythonmac-SIG at python.org > http://mail.python.org/mailman/listinfo/pythonmac-sig > unsubscribe: http://mail.python.org/mailman/options/Pythonmac-SIG -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 3567 bytes Desc: not available URL: From ronaldoussoren at mac.com Sat Jul 24 10:40:17 2010 From: ronaldoussoren at mac.com (Ronald Oussoren) Date: Sat, 24 Jul 2010 09:40:17 +0100 Subject: [Pythonmac-SIG] py2app updates In-Reply-To: <4C49EC8A.5070900@noaa.gov> References: <4C49EC8A.5070900@noaa.gov> Message-ID: <037CABA7-1007-46C5-A799-1009CD487D00@mac.com> On 23 Jul, 2010, at 20:24, Christopher Barker wrote: > HI folks, > > I'm trying to test the latest py2app updates. However, easy_install is failing in a number of places. I'm trying: > > easy_install py2app==dev > > but get errors in the modulegraph dependency. > > When I install modulegraph==dev, I get errors in the altgraph dependency. > > If I install altgraph, then modulegraph, then py2app, the first two go OK, but I get: > > No local packages or download links found for modulegraph>=0.8 > > and, indeed, the modulegraph that installed with modulegraph==dev is: > > >>> modulegraph.__version__ > '0.7.1' I always install by install altgraph, modulegraph, macholib and then py2app manually from a checkout. The easy_install problem will go away with the next release, and I'll see what's needed to get 'easy_install py2app==dev' working again after the release. Ronald -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 3567 bytes Desc: not available URL: From ronaldoussoren at mac.com Sun Jul 25 16:10:25 2010 From: ronaldoussoren at mac.com (Ronald Oussoren) Date: Sun, 25 Jul 2010 15:10:25 +0100 Subject: [Pythonmac-SIG] py2app and python versions Message-ID: <4DEADFB9-6AAB-43BC-9D18-2568F864B93D@mac.com> Hi, What is the minimal python version that peoply actually use py2app with? I want to do some development on py2app and related package later this year to make it fully support python eggs and may want to modernize the code while doing that. The amount of modernization that is possible depends in part on the minimaly required python version. That said, if I start doing serious development it is pretty likely that I accidently break support for versions before 2.6, as that is the minimal version I test PyObjC with. Python 2.6 would also allow me to rip out all compatibility cruft, including the cruft needed to annotate byte literals without using the byte-literal syntax. Ronald P.S. I'm typing this at the airport on the way back from europython. AFAIK py2app on my machine currently works with both python2.7 and python3.2, I'll therefore push out releases after committing some small fixes (which will happen once I have Internet access) -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 3567 bytes Desc: not available URL: From ronaldoussoren at mac.com Sun Jul 25 16:41:33 2010 From: ronaldoussoren at mac.com (Ronald Oussoren) Date: Sun, 25 Jul 2010 15:41:33 +0100 Subject: [Pythonmac-SIG] py2app call for help Message-ID: Hi, Py2app needs some work to get up to the times. Is anyone interested in helping out. I'm using py2app as a handy shortcut for py2app, macholib, modulegraph and altgraph here. Some pretty easy tasks: * Rewrite the documentation using sphinx (cross-package links can assume that the documenation will be published on the documentation site associated with PyPI) * Add unittests and API documentation (modulegraph and altgraph are the easiest, macholib requires knowledge of C and the MachO format, py2app is hardest thanks to distutils) * Add functional tests for py2app Py2app really needs functional tests that create virtualenvs with packages and then build application bundles with various options and check that those are correct. The functional tests should in the long run have testcases for all kinds of libraries that people use and commonly cause problems. It should at least contain test cases for the major GUI libraries (Tkinter, PyObjC, wxWidgets and PyQt). The easy bit here is building the test framework itself, building a sufficiently large suite of tests is more work, but the test suite can be enhanced later on (I'd focus on the libraries I actually use, and ask others to supply tests for other libraries). Open bugs: * py2app doesn't like how pip installs namespace packages pip doesn't install an __init__.py file for namespace packages but uses pth-file trickery to get things to work. modulegraph needs to learn about this mechanism to detect packages * modulegraph might need code to deal with absolute/relative imports (from __future__ import absolute_import) New features: * include egg metadata into the application bundle * optionally bundle entire eggs (I don't know yet if this should default to on or off, but it is likely that it should be possible to disable including whole eggs) * design a public API for py2app recipes, preferably using setuptools entry points and preferable one that is not mac-specific This would allow others to maintain recipes for libraries like PyQt that require recipes, but where the py2app developers (that would be me) don't have time to keep up with development of the external library. I'd still prefer to keep recipes locally to py2app where possible * it would be nice to have a "py2app_standalone" command that uses the python files in an already existing application bundle to determine what should be added. The primary use case for this is Xcode projects, users of Xcode currently either have to add all libraries manually or maintain both the Xcode project and a setup.py file. Implementation of all of this should work with both python 2.x and python 3.x, and we should keep an eye on distutils2 to ensure that we'll work properly with that as well. Py2app would preferably work both with easy_installed packages and packages installed using pip (which uses a slightly different installation format). Ronald (Still typing at the airport, although this mail will only get out once I'm back home) -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 3567 bytes Desc: not available URL: From tom at developmentseed.org Mon Jul 26 03:04:36 2010 From: tom at developmentseed.org (Tom MacWright) Date: Sun, 25 Jul 2010 21:04:36 -0400 Subject: [Pythonmac-SIG] py2app architecture problem and System Python question Message-ID: Hi all, It's great to see that there's somewhere that py2app is actually developed and discussed (although it's kind of hard to find this place! the documentation should refer to it or something). Anyway, I'm having two large problems with py2app. For reference, I'm running 10.6 and system Python 2.6.1. I've read in one place that, in order to deploy to platforms without Python entirely, one must be using the python.org version of Python instead of system? Is this true? I'm very hesitant to switch from system, because very complex modules (certain C extensions) and version hell are no strangers here. Okay, but the jist of the problem: When installing my current version of py2app - SVN head, with the absolute head versions of modulegraph, altgraph, and macholib, I was confronted with the problem that the prebuilt binary with the path: /Library/Python/2.6/site-packages/py2app-0.5-py2.6.egg/py2app/apptemplate/prebuilt/main-i386 was missing. As a result, I tried symlinking main-universal to this location, and the py2app build runs, but with many C warnings and errors (generally refering to CF_ functions being undeclared), and finally ending with the error lipo: can't figure out the architecture type of: /var/folders/4v/4vu09+KXFWi9RadPbQZPvk+++TI/-Tmp-//ccSC6vWf.out I think that this is the cause of the current issue that I'm finding with the (fully built, it seems) app bundle that, on other systems, is producing the error that the 'os' module is not found. So - questions: how does one get this combination of OSX version and Python version to actually work with py2app? Does it? What should be done about this missing main-i386 problem? And how do I test these distributions quickly, as running OSX within VirtualBox isn't supported and I don't have infinite computers to play around with? Thanks for any help! I'm looking forward to contributing to the push on development. I'm starting to crack through the code now, and will definitely have budgeted time down the road to spend here. Tom MacWright -------------- next part -------------- An HTML attachment was scrubbed... URL: From tom at developmentseed.org Mon Jul 26 03:51:42 2010 From: tom at developmentseed.org (Tom MacWright) Date: Sun, 25 Jul 2010 21:51:42 -0400 Subject: [Pythonmac-SIG] Unit testing altgraph Message-ID: Here's a patch that converts the freerange tests in altgraph into unit tests: http://dl.dropbox.com/u/68059/patches/altgraph_unittest.patch It's rather simple and doesn't add any new tests. There isn't test coverage of Dot, etc., and I'd like to add it. I'm happy to see that there are solid plans for the future of these modules, but in order to make these happen, is there going to be any kind of development infrastructure? Even putting these on GitHub or setting up a Trac somewhere would do a tremendous amount of good: right now, for people who want to contribute (this guy), it seems like there's absolutely no way to get involved, relative to other projects. Tom -------------- next part -------------- An HTML attachment was scrubbed... URL: From tom at developmentseed.org Mon Jul 26 05:35:04 2010 From: tom at developmentseed.org (Tom MacWright) Date: Sun, 25 Jul 2010 23:35:04 -0400 Subject: [Pythonmac-SIG] py2app problems with spawn Message-ID: Hi all, I've switched to the Python.org 2.7 distribution after figuring out that you can't do a standalone py2app application with system python (I evidently wasn't reading through -h and it's not noted in documentation). However, I'm running into another problem: is spawn() not supported by py2app-generated applications? When running this application (which doesn't contain a frontend, but does contain a web server based off of the Flask microframework), the mac application quickly quits, and running it from the terminal gives: (mapsonastick_env)~/Code/python/mapsonastick_env/mapsonastick/dist/moas.app/Contents/MacOS$ ./moas * Running on http://127.0.0.1:5000/ * Restarting with reloader... python: posix_spawn: /Users/tmcw/Code/python/mapsonastick_env/mapsonastick/dist/moas.app/Contents/MacOS/../Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python: Unknown error: 0 This is odd because neither flask, its base library werkzeug, nor my application, use spawn directly, and running simply ./python in the directory gives the same error: python: posix_spawn: /Users/tmcw/Code/python/mapsonastick_env/mapsonastick/dist/moas.app/Contents/MacOS/./../Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python: Unknown error: 0 Any idea what's going on here? Or if there's a different route I can take that might bring this a bit closer to something resembling success? Tom MacWright -------------- next part -------------- An HTML attachment was scrubbed... URL: From tom at developmentseed.org Mon Jul 26 06:24:37 2010 From: tom at developmentseed.org (Tom MacWright) Date: Mon, 26 Jul 2010 00:24:37 -0400 Subject: [Pythonmac-SIG] py2app 32-bit vs 64-bit datetime Message-ID: Sorry for loading so much on this list - if there's a bug tracker or IRC or something, that might be a place to put these things that doesn't disrupt communication. Anyway: so I got an app bundle created and ran into the ZipImportError (earlier referenced here http://web.archiveorange.com/archive/v/zm9PCtmeKQ9Md5x1csmw by Matt Lyra). This could be evaded by simply unzipping site-packages.zip into site-packages/. But, upon running the executable, I get the error: 7/26/10 12:17:55 AM [0x0-0x974573c].org.pythonmac.unspecified.moas[32911] ImportError: /Users/tmcw/Code/python/mapsonastick_env/mapsonastick/dist/moas.app/Contents/Resources/lib/python2.6/lib-dynload/datetime.so: no appropriate 64-bit architecture (see "man python" for running in 32-bit mode) Which is, of course, rather confusing. How is one to fix this? Is there another, 64-bit version that I can use? Or can I build the executable as a 32-bit? Setting the magic com variable: defaults write com.apple.versioner.python Prefer-32-Bit -bool yes Has no effect on this bug that I can find. Any ideas here? Tom -------------- next part -------------- An HTML attachment was scrubbed... URL: From brendan.simon at etrix.com.au Mon Jul 26 09:46:15 2010 From: brendan.simon at etrix.com.au (Brendan Simon (eTRIX)) Date: Mon, 26 Jul 2010 17:46:15 +1000 Subject: [Pythonmac-SIG] py2app and python versions In-Reply-To: References: Message-ID: <4C4D3D47.2010601@etrix.com.au> I use py2app with Python 2.5. Even though I'm keen to move to 2.6 (and then 2.7), I would _guess_ that quite a few people are still using Python 2.5. Cheers, Brendan. On 26/07/10 11:04 AM, pythonmac-sig-request at python.org wrote: > Subject: > [Pythonmac-SIG] py2app and python versions > From: > Ronald Oussoren > Date: > Sun, 25 Jul 2010 15:10:25 +0100 > > To: > "pythonmac-sig at python.org mac" > > > Hi, > > What is the minimal python version that peoply actually use py2app with? > > I want to do some development on py2app and related package later this year to make it fully support python eggs and may want to modernize the code while doing that. The amount of modernization that is possible depends in part on the minimaly required python version. > > That said, if I start doing serious development it is pretty likely that I accidently break support for versions before 2.6, as that is the minimal version I test PyObjC with. Python 2.6 would also allow me to rip out all compatibility cruft, including the cruft needed to annotate byte literals without using the byte-literal syntax. > > Ronald -------------- next part -------------- An HTML attachment was scrubbed... URL: From ronaldoussoren at mac.com Mon Jul 26 11:17:31 2010 From: ronaldoussoren at mac.com (Ronald Oussoren) Date: Mon, 26 Jul 2010 02:17:31 -0700 (PDT) Subject: [Pythonmac-SIG] Unit testing altgraph In-Reply-To: Message-ID: <899ae018-631c-cdd4-bc2f-99f6568e72d4@me.com> On 26 Jul, 2010,at 03:51 AM, Tom MacWright wrote: Here's a patch that converts the freerange tests in altgraph into unit tests: http://dl.dropbox.com/u/68059/patches/altgraph_unittest.patch It's rather simple and doesn't add any new tests. There isn't test coverage of Dot, etc., and I'd like to add it. I'm happy to see that there are solid plans for the future of these modules, but in order to make these happen, is there going to be any kind of development infrastructure? Even putting these on GitHub or setting up a Trac somewhere would do a tremendous amount of good: right now, for people who want to contribute (this guy), it seems like there's absolutely no way to get involved, relative to other projects. ? I have an account at bitbucket and intend to migrate the repositories there, mostly because bitbucket has a tracker and other infrastructure. ?W.r.t. picking mercurial instead of git: CPython is moving to mercurial as well and I prefer to keep the number of version management systems that I actively use as small as possible. I need to check with Bob if he minds, but I don't expect problems there as he's not doing any work on py2app anymore. Ronald -------------- next part -------------- An HTML attachment was scrubbed... URL: From ronaldoussoren at mac.com Mon Jul 26 11:25:21 2010 From: ronaldoussoren at mac.com (Ronald Oussoren) Date: Mon, 26 Jul 2010 02:25:21 -0700 (PDT) Subject: [Pythonmac-SIG] py2app architecture problem and System Python question In-Reply-To: Message-ID: <45ec7360-f459-68f1-b345-9f9aee798b52@me.com> On 26 Jul, 2010,at 03:04 AM, Tom MacWright wrote: Hi all, It's great to see that there's somewhere that py2app is actually developed and discussed (although it's kind of hard to find this place! the documentation should refer to it or something). ? The next release will have this list in the information that is published on PyPI. Anyway, I'm having two large problems with py2app. For reference, I'm running 10.6 and system Python 2.6.1. I've read in one place that, in order to deploy to platforms without Python entirely, one must be using the python.org version of Python instead of system? Is this true? I'm very hesitant to switch from system, because very complex modules (certain C extensions) and version hell are no strangers here. ? The only way to build application bundles that run on other releases of OSX is to use a non-system install of Python. The reason for that is that py2app will not bundle /usr/bin/python into the application bundles it creates, to avoid legal problems with shipping parts of OSX in an application. Okay, but the jist of the problem: When installing my current version of py2app - SVN head, with the absolute head versions of modulegraph, altgraph, and macholib, I was confronted with the problem that the prebuilt binary with the path: /Library/Python/2.6/site-packages/py2app-0.5-py26.egg/py2app/apptemplate/prebuilt/main-i386 ? That's not good. I'll have to see what I can do about this, /usr/bin/python basicly lies about its architecture: it should clean to be fat3 instead of 'i386'. was missing. As a result, I tried symlinking main-universal to this location, and the py2app build runs, but with many C warnings and errors (generally refering to CF_ functions being undeclared), and finally ending with the error lipo: can't figure out the architecture type of: /var/folders/4v/4vu09+KXFWi9RadPbQZPvk+++TI/-Tmp-//ccSC6vWf.out I think that this is the cause of the current issue that I'm finding with the (fully built, it seems) app bundle that, on other systems, is producing the error that the 'os' module is not found. So - questions: how does one get this combination of OSX version and Python version to actually work with py2app? Does it? What should be done about this missing main-i386 problem? And how do I test these distributions quickly, as running OSX within VirtualBox isn't supported and I don't have infinite computers to play around with? ? I use OSX 10.5 Server in a Parallels VM to test cross-release support. Thanks for any help! I'm looking forward to contributing to the push on development. I'm starting to crack through the code now, and will definitely have budgeted time down the road to spend here. ? Ronald -------------- next part -------------- An HTML attachment was scrubbed... URL: From brendan.simon at etrix.com.au Mon Jul 26 12:27:50 2010 From: brendan.simon at etrix.com.au (Brendan Simon (eTRIX)) Date: Mon, 26 Jul 2010 20:27:50 +1000 Subject: [Pythonmac-SIG] py2app architecture problem and System Python question In-Reply-To: References: Message-ID: <4C4D6326.4020208@etrix.com.au> > Subject: > Re: [Pythonmac-SIG] py2app architecture problem and System Python > question > From: > Ronald Oussoren > Date: > Mon, 26 Jul 2010 02:25:21 -0700 (PDT) > > To: > Tom MacWright > CC: > pythonmac-sig at python.org > >> And how do I test these distributions quickly, as running OSX within >> VirtualBox isn't supported and I don't have infinite computers to >> play around with? > > I use OSX 10.5 Server in a Parallels VM to test cross-release support. Does "OSX within VirtualBox isn't supported" mean :- * It doesn't work ?? * or, Apple don't allow you to run OS X in VB ?? I'm running OS X 10.6, and I would like to test my Python app bundle on an OS X 10.5 box, so being able to have a VirtualBox install of OS X 10.5 would be very handy :) Any idea why it "isn't supported" ?? Thanks, Brendan. -------------- next part -------------- An HTML attachment was scrubbed... URL: From ronaldoussoren at mac.com Mon Jul 26 12:44:40 2010 From: ronaldoussoren at mac.com (Ronald Oussoren) Date: Mon, 26 Jul 2010 03:44:40 -0700 (PDT) Subject: [Pythonmac-SIG] py2app architecture problem and System Python question In-Reply-To: <4C4D6326.4020208@etrix.com.au> Message-ID: On 26 Jul, 2010,at 12:27 PM, "Brendan Simon (eTRIX)" wrote: Subject: Re: [Pythonmac-SIG] py2app architecture problem and System Python question From: Ronald Oussoren Date: Mon, 26 Jul 2010 02:25:21 -0700 (PDT) To: Tom MacWright CC: pythonmac-sig at python.org And how do I test these distributions quickly, as running OSX within VirtualBox isn't supported and I don't have infinite computers to play around with? ? I use OSX 10.5 Server in a Parallels VM to test cross-release support. Does "OSX within VirtualBox isn't supported" mean :- It doesn't work ?? or, Apple don't allow you to run OS X in VB ?? I'm running OS X 10.6, and I would like to test my Python app bundle on an OS X 10.5 box, so being able to have a VirtualBox install of OS X 10.5 would be very handy :) Any idea why it "isn't supported" ?? ? I haven't used virtualbox, but the OSX license only allows you to run the server editions of OSX 10.5 or 10.6 in a virtual environment (and then only if the underlying physical server is an Apple machine). ? Parallels enforces these restrictions, other tools may or may not do the same. Ronald Thanks, Brendan. _______________________________________________ Pythonmac-SIG maillist - Pythonmac-SIG at python.org http://mail.python.org/mailman/listinfo/pythonmac-sig unsubscribe: http://mail.python.org/mailman/options/Pythonmac-SIG -------------- next part -------------- An HTML attachment was scrubbed... URL: From tom at developmentseed.org Mon Jul 26 14:11:45 2010 From: tom at developmentseed.org (Tom MacWright) Date: Mon, 26 Jul 2010 08:11:45 -0400 Subject: [Pythonmac-SIG] Unit testing altgraph In-Reply-To: <899ae018-631c-cdd4-bc2f-99f6568e72d4@me.com> References: <899ae018-631c-cdd4-bc2f-99f6568e72d4@me.com> Message-ID: Cool - I didn't mean to imply that GitHub was the only choice, and Mercurial is certainly more popular with the Python crowd. As long as there's something that'll make it possible to patch and document bugs, it'll be a great improvement. On Mon, Jul 26, 2010 at 5:17 AM, Ronald Oussoren wrote: > > > On 26 Jul, 2010,at 03:51 AM, Tom MacWright > wrote: > > Here's a patch that converts the freerange tests in altgraph into unit > tests: > > http://dl.dropbox.com/u/68059/patches/altgraph_unittest.patch > > It's rather simple and doesn't add any new tests. There isn't test coverage > of Dot, etc., and I'd like to add it. I'm happy to see that there are solid > plans for the future of these modules, but in order to make these happen, is > there going to be any kind of development infrastructure? Even putting these > on GitHub or setting up a Trac somewhere would do a tremendous amount of > good: right now, for people who want to contribute (this guy), it seems like > there's absolutely no way to get involved, relative to other projects. > > > I have an account at bitbucket and intend to migrate the repositories > there, mostly because bitbucket has a tracker and other infrastructure. > W.r.t. picking mercurial instead of git: CPython is moving to mercurial as > well and I prefer to keep the number of version management systems that I > actively use as small as possible. > > I need to check with Bob if he minds, but I don't expect problems there as > he's not doing any work on py2app anymore. > > Ronald > -------------- next part -------------- An HTML attachment was scrubbed... URL: From tom at developmentseed.org Mon Jul 26 14:27:45 2010 From: tom at developmentseed.org (Tom MacWright) Date: Mon, 26 Jul 2010 08:27:45 -0400 Subject: [Pythonmac-SIG] py2app architecture problem and System Python question In-Reply-To: References: <4C4D6326.4020208@etrix.com.au> Message-ID: Not being able to redistribute parts of system python is totally understandable - it's not a very well-documented limitation, however. Here's a patch applied to head that describes this in the 'Building for deployment' section, and also corrects a misspelling in build_app.py that appears in py2app -h help pages. > http://dl.dropbox.com/u/68059/patches/standalone_doc_spelling.patch On Mon, Jul 26, 2010 at 6:44 AM, Ronald Oussoren wrote: > > > On 26 Jul, 2010,at 12:27 PM, "Brendan Simon (eTRIX)" < > brendan.simon at etrix.com.au> wrote: > > > Subject: > Re: [Pythonmac-SIG] py2app architecture problem and System Python question > From: > Ronald Oussoren > Date: > Mon, 26 Jul 2010 02:25:21 -0700 (PDT) > To: > Tom MacWright > CC: > pythonmac-sig at python.org > > > And how do I test these distributions quickly, as running OSX within > VirtualBox isn't supported and I don't have infinite computers to play > around with? > > > I use OSX 10.5 Server in a Parallels VM to test cross-release support. > > > Does "OSX within VirtualBox isn't supported" mean :- > > - It doesn't work ?? > - or, Apple don't allow you to run OS X in VB ?? > > > I'm running OS X 10.6, and I would like to test my Python app bundle on an > OS X 10.5 box, so being able to have a VirtualBox install of OS X 10.5 would > be very handy :) > Any idea why it "isn't supported" ?? > > > > I haven't used virtualbox, but the OSX license only allows you to run the > server editions of OSX 10.5 or 10.6 in a virtual environment (and then only > if the underlying physical server is an Apple machine). > > Parallels enforces these restrictions, other tools may or may not do the > same. > > Ronald > > > > Thanks, Brendan. > > _______________________________________________ > Pythonmac-SIG maillist - Pythonmac-SIG at python.org > > http://mail.python.org/mailman/listinfo/pythonmac-sig > unsubscribe: http://mail.python.org/mailman/options/Pythonmac-SIG > > > _______________________________________________ > Pythonmac-SIG maillist - Pythonmac-SIG at python.org > http://mail.python.org/mailman/listinfo/pythonmac-sig > unsubscribe: http://mail.python.org/mailman/options/Pythonmac-SIG > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From tom at developmentseed.org Mon Jul 26 14:45:00 2010 From: tom at developmentseed.org (Tom MacWright) Date: Mon, 26 Jul 2010 08:45:00 -0400 Subject: [Pythonmac-SIG] Built application not compatible with packaged .so files. Message-ID: So, I'm running into the familiar zlib not available problem (with the error message 7/26/10 8:37:21 AM [0x0-0x980c803].org.pythonmac.unspecified.moas[34233] zipimport.ZipImportError: can't decompress data; zlib not available And I realized that, like the rest of the errors that I was running into, zlib was provided as a .so file in lib-dynload. And, go figure, copying the 'system' version of zlib into the application, like so: cp /System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/lib-dynload/zlib.so . Moves the application past this error. So, the question remains - why is py2app packaging an application with 32-bit libraries that runs as 64-bit? Or how can one get it to package universal libraries? Or a 32-bit application? Or run the universal application as 32-bit? Because after this workaround, I'm confronted by the error 7/26/10 8:39:02 AM [0x0-0x9812809].org.pythonmac.unspecified.moas[34257] ImportError: /Users/tmcw/Code/python/mapsonastick_env/mapsonastick/dist/moas.app/Contents/Resources/lib/python2.6/lib-dynload/datetime.so: no appropriate 64-bit architecture (see "man python" for running in 32-bit mode) Copying all .so files over eventually just leads to python version hell - because between the version of Python that comes with Snow Leopard and the one from Python.org, a new library file was added - _scproxy in Python 2.6.3 ( http://www.mail-archive.com/python-dev at python.org/msg42295.html ). Thanks for any help, Tom MacWright -------------- next part -------------- An HTML attachment was scrubbed... URL: From ronaldoussoren at mac.com Mon Jul 26 16:23:32 2010 From: ronaldoussoren at mac.com (Ronald Oussoren) Date: Mon, 26 Jul 2010 07:23:32 -0700 (PDT) Subject: [Pythonmac-SIG] Built application not compatible with packaged .so files. In-Reply-To: Message-ID: <697afa08-e678-ce22-e448-917dea81925f@me.com> On 26 Jul, 2010,at 02:45 PM, Tom MacWright wrote: So, I'm running into the familiar zlib not available problem (with the error message 7/26/10 8:37:21 AM [0x0-0x980c803].org.pythonmac.unspecified.moas[34233] zipimport.ZipImportError: can't decompress data; zlib not available ? To be pedantic: the error is not familiar to me, which probably explains why it still exists.? Ronald -------------- next part -------------- An HTML attachment was scrubbed... URL: From tom at developmentseed.org Mon Jul 26 16:32:36 2010 From: tom at developmentseed.org (Tom MacWright) Date: Mon, 26 Jul 2010 10:32:36 -0400 Subject: [Pythonmac-SIG] Built application not compatible with packaged .so files. In-Reply-To: <697afa08-e678-ce22-e448-917dea81925f@me.com> References: <697afa08-e678-ce22-e448-917dea81925f@me.com> Message-ID: For reference, which Python distribution, OS, etc, are you using? I'd be perfectly happy to change any part of my setup if there's something that's known to work. As it stands, I'm using Python 2.6 from Python.org, Snow Leopard, and running into a ton of problems. The Python installer doesn't mess with .zshrc, so I've added the python binary dir to my path to make sure that the python executable that I'm using is that version. Is there anything else it does to ones bashrc or something else that could be involved here? On Mon, Jul 26, 2010 at 10:23 AM, Ronald Oussoren wrote: > > > On 26 Jul, 2010,at 02:45 PM, Tom MacWright > wrote: > > So, I'm running into the familiar zlib not available problem (with the > error message > > 7/26/10 8:37:21 AM [0x0-0x980c803].org.pythonmac.unspecified.moas[34233] zipimport.ZipImportError: > can't decompress data; zlib not available > > > > To be pedantic: the error is not familiar to me, which probably explains > why it still exists. > > Ronald > -------------- next part -------------- An HTML attachment was scrubbed... URL: From tom at developmentseed.org Mon Jul 26 16:41:29 2010 From: tom at developmentseed.org (Tom MacWright) Date: Mon, 26 Jul 2010 10:41:29 -0400 Subject: [Pythonmac-SIG] py2app problems with spawn In-Reply-To: <20100726144014.GA2685@illinois.edu> References: <20100726144014.GA2685@illinois.edu> Message-ID: This error is happening even just running the 'python' executable, so I think it's pretty safe to say that it's not related to Flask? On Mon, Jul 26, 2010 at 10:40 AM, Nicholas Riley wrote: > On Sun, Jul 25, 2010 at 11:35:04PM -0400, Tom MacWright wrote: > > * Restarting with reloader... > > python: posix_spawn: > > > /Users/tmcw/Code/python/mapsonastick_env/mapsonastick/dist/moas.app/Contents/MacOS/../Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python: > > Unknown error: 0 > > > > Any idea what's going on here? Or if there's a different route I can take > > that might bring this a bit closer to something resembling success? > > I imagine with the source code packaged inside an app wrapper you do > not need to use Flask's reloader. Just disable it. > > -- > Nicholas Riley > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From njriley at illinois.edu Mon Jul 26 16:47:43 2010 From: njriley at illinois.edu (Nicholas Riley) Date: Mon, 26 Jul 2010 09:47:43 -0500 Subject: [Pythonmac-SIG] py2app problems with spawn In-Reply-To: References: <20100726144014.GA2685@illinois.edu> Message-ID: <20100726144742.GA4210@illinois.edu> On Mon, Jul 26, 2010 at 10:41:29AM -0400, Tom MacWright wrote: > This error is happening even just running the 'python' executable, so I > think it's pretty safe to say that it's not related to Flask? Flask restarts the Python interpreter when it detects changes to its source files - that's how the reloader works. I imagine it's doing something that is not safe for Mac apps. -- Nicholas Riley From njriley at illinois.edu Mon Jul 26 16:40:14 2010 From: njriley at illinois.edu (Nicholas Riley) Date: Mon, 26 Jul 2010 09:40:14 -0500 Subject: [Pythonmac-SIG] py2app problems with spawn In-Reply-To: References: Message-ID: <20100726144014.GA2685@illinois.edu> On Sun, Jul 25, 2010 at 11:35:04PM -0400, Tom MacWright wrote: > * Restarting with reloader... > python: posix_spawn: > /Users/tmcw/Code/python/mapsonastick_env/mapsonastick/dist/moas.app/Contents/MacOS/../Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python: > Unknown error: 0 > > Any idea what's going on here? Or if there's a different route I can take > that might bring this a bit closer to something resembling success? I imagine with the source code packaged inside an app wrapper you do not need to use Flask's reloader. Just disable it. -- Nicholas Riley From ronaldoussoren at mac.com Mon Jul 26 17:16:48 2010 From: ronaldoussoren at mac.com (Ronald Oussoren) Date: Mon, 26 Jul 2010 08:16:48 -0700 (PDT) Subject: [Pythonmac-SIG] Built application not compatible with packaged .so files. In-Reply-To: Message-ID: <6ad61653-d021-cb63-daed-d3a2bb33fe81@me.com> On 26 Jul, 2010,at 04:32 PM, Tom MacWright wrote: For reference, which Python distribution, OS, etc, are you using? I'd be perfectly happy to change any part of my setup if there's something that's known to work. As it stands, I'm using Python 2.6 from Pythonorg, Snow Leopard, and running into a ton of problems. The Python installer doesn't mess with .zshrc, so I've added the python binary dir to my path to make sure that the python executable that I'm using is that version. Is there anything else it does to ones bashrc or something else that could be involved here? ? ?I'm using 2.6, 2.7 and 3.2, both using custom builds and the python.org installer; I'm also trying to migrate to virtualenv (although I'll probably end up forking it to get a proper python3 port and to get rid of some annoying behaviour). Ronald (P.S. Sorry about any quoting issues, mobile me webmail crapped out on me) On Mon, Jul 26, 2010 at 10:23 AM, Ronald Oussoren??wrote: On 26 Jul, 2010,at 02:45 PM, Tom MacWright wrote: So, I'm running into the familiar zlib not available problem (with the error message 7/26/10 8:37:21 AM [0x0-0x980c803].org.pythonmac.unspecified.moas[34233] zipimport.ZipImportError: can't decompress data; zlib not available ? To be pedantic: the error is not familiar to me, which probably explains why it still exists.? Ronald -------------- next part -------------- An HTML attachment was scrubbed... URL: From tom at developmentseed.org Mon Jul 26 18:11:07 2010 From: tom at developmentseed.org (Tom MacWright) Date: Mon, 26 Jul 2010 12:11:07 -0400 Subject: [Pythonmac-SIG] Built application not compatible with packaged .so files. In-Reply-To: <6ad61653-d021-cb63-daed-d3a2bb33fe81@me.com> References: <6ad61653-d021-cb63-daed-d3a2bb33fe81@me.com> Message-ID: Okay, so the error, which has only become familiar in the past 24 hours :/ is: I switch to Python.org-distributed 2.6 by putting the Library Python bins in my path, before system python. I run py2app the first time, and it fails with this traceback: http://dpaste.com/222043/ As a result, I've tried copying the other prebuilt binaries into the place of the missing main-fat binary. This allows py2app to run without reporting any problems, but when I try to run the application that is built, it results in this line of errors: http://dpaste.com/222044/ By copying .so files from the System installation of Python, it's clear that the problem here is that, somehow, the binaries copied from Framework Python are incompatible with the produced binary - copying zlib resolves this problem, but each other .so, in turn, fails because a 'suitable 64-bit' version can't be found. On Mon, Jul 26, 2010 at 11:16 AM, Ronald Oussoren wrote: > > > On 26 Jul, 2010,at 04:32 PM, Tom MacWright > wrote: > > For reference, which Python distribution, OS, etc, are you using? I'd be > perfectly happy to change any part of my setup if there's something that's > known to work. As it stands, I'm using Python 2.6 from Python.org, Snow > Leopard, and running into a ton of problems. The Python installer doesn't > mess with .zshrc, so I've added the python binary dir to my path to make > sure that the python executable that I'm using is that version. Is there > anything else it does to ones bashrc or something else that could be > involved here? > > > > I'm using 2.6, 2.7 and 3.2, both using custom builds and the python.orginstaller; I'm also trying to migrate to virtualenv (although I'll probably > end up forking it to get a proper python3 port and to get rid of some > annoying behaviour). > > Ronald > > (P.S. Sorry about any quoting issues, mobile me webmail crapped out on me) > > > > > On Mon, Jul 26, 2010 at 10:23 AM, Ronald Oussoren > wrote: > >> >> >> On 26 Jul, 2010,at 02:45 PM, Tom MacWright >> wrote: >> >> So, I'm running into the familiar zlib not available problem (with the >> error message >> >> 7/26/10 8:37:21 AM [0x0-0x980c803].org.pythonmac.unspecified.moas[34233] zipimport.ZipImportError: >> can't decompress data; zlib not available >> >> >> >> To be pedantic: the error is not familiar to me, which probably explains >> why it still exists. >> >> Ronald >> > >> -------------- next part -------------- An HTML attachment was scrubbed... URL: From Chris.Barker at noaa.gov Mon Jul 26 21:33:05 2010 From: Chris.Barker at noaa.gov (Christopher Barker) Date: Mon, 26 Jul 2010 12:33:05 -0700 Subject: [Pythonmac-SIG] py2app and python versions In-Reply-To: <4DEADFB9-6AAB-43BC-9D18-2568F864B93D@mac.com> References: <4DEADFB9-6AAB-43BC-9D18-2568F864B93D@mac.com> Message-ID: <4C4DE2F1.6050302@noaa.gov> Ronald Oussoren wrote: > Hi, > > What is the minimal python version that peoply actually use py2app with? 2.6.* for me -- I have some older stuff still on 2.5.*, but I'm perfectly happy to port that when I need to update. Backward compatibility is nice, but if it gets in the way of getting things done, it shouldn't be too big a deal to do it -- it's easier to port code to a newer python than an older one. Thanks so much for working on this. -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 at noaa.gov From mathew.oakes at aad.gov.au Tue Jul 27 09:35:48 2010 From: mathew.oakes at aad.gov.au (Mathew Oakes) Date: Tue, 27 Jul 2010 17:35:48 +1000 Subject: [Pythonmac-SIG] py2app or macholib error[Sec=Unclassified] Message-ID: <1280216148.1231.24.camel@karma> Can anyone help me with this? snow leopard system python, easy_install for extra stuff. > creating /Users/mathew_oak/Documents/My Applications/ShotChopper/dist/TkClipper.app/Contents/Resources/lib/python2.6/lib-dynload/aem > Traceback (most recent call last): > File "/Library/Python/2.6/site-packages/py2app-0.4.3-py2.6.egg/py2app/build_app.py", line 589, in _run > self.run_normal() > File "/Library/Python/2.6/site-packages/py2app-0.4.3-py2.6.egg/py2app/build_app.py", line 660, in run_normal > self.create_binaries(py_files, pkgdirs, extensions, loader_files) > File "/Library/Python/2.6/site-packages/py2app-0.4.3-py2.6.egg/py2app/build_app.py", line 777, in create_binaries > platfiles = mm.run() > File "build/bdist.macosx-10.6-universal/egg/macholib/MachOStandalone.py", line 101, in run > for fn in platfiles: > File "build/bdist.macosx-10.6-universal/egg/macholib/util.py", line 227, in iter_platform_files > if is_platform_file(fn): > File "build/bdist.macosx-10.6-universal/egg/macholib/util.py", line 206, in is_platform_file > header = mach_o.fat_header.from_fileobj(fileobj, _endian_='>') > File "build/bdist.macosx-10.6-universal/egg/macholib/ptypes.py", line 44, in from_fileobj > return cls.from_str(f.read(cls._size_), **kw) > File "build/bdist.macosx-10.6-universal/egg/macholib/ptypes.py", line 48, in from_str > return cls.from_tuple(struct.unpack(endian + cls._format_, s), **kw) > error: unpack requires a string argument of length 8 > > /Users/mathew_oak/Documents/My Applications/ShotChopper/build/bdist.macosx-10.6-universal/egg/macholib/ptypes.py(48)from_str() > (Pdb) interrupted ___________________________________________________________________________ Australian Antarctic Division - Commonwealth of Australia IMPORTANT: This transmission is intended for the addressee only. If you are not the intended recipient, you are notified that use or dissemination of this communication is strictly prohibited by Commonwealth law. If you have received this transmission in error, please notify the sender immediately by e-mail or by telephoning +61 3 6232 3209 and DELETE the message. Visit our web site at http://www.antarctica.gov.au/ ___________________________________________________________________________ From ronaldoussoren at mac.com Tue Jul 27 13:02:03 2010 From: ronaldoussoren at mac.com (Ronald Oussoren) Date: Tue, 27 Jul 2010 13:02:03 +0200 Subject: [Pythonmac-SIG] py2app or macholib error[Sec=Unclassified] In-Reply-To: <1280216148.1231.24.camel@karma> References: <1280216148.1231.24.camel@karma> Message-ID: <8CFF0B43-7E3B-4DC6-BE99-702D6D3C51B3@mac.com> On 27 Jul, 2010, at 9:35, Mathew Oakes wrote: > Can anyone help me with this? I'm pushing out a new release of py2app and related modules later today (CET). That should fix this problem. Ronald > > snow leopard system python, easy_install for extra stuff. > >> creating /Users/mathew_oak/Documents/My Applications/ShotChopper/dist/TkClipper.app/Contents/Resources/lib/python2.6/lib-dynload/aem >> Traceback (most recent call last): >> File "/Library/Python/2.6/site-packages/py2app-0.4.3-py2.6.egg/py2app/build_app.py", line 589, in _run >> self.run_normal() >> File "/Library/Python/2.6/site-packages/py2app-0.4.3-py2.6.egg/py2app/build_app.py", line 660, in run_normal >> self.create_binaries(py_files, pkgdirs, extensions, loader_files) >> File "/Library/Python/2.6/site-packages/py2app-0.4.3-py2.6.egg/py2app/build_app.py", line 777, in create_binaries >> platfiles = mm.run() >> File "build/bdist.macosx-10.6-universal/egg/macholib/MachOStandalone.py", line 101, in run >> for fn in platfiles: >> File "build/bdist.macosx-10.6-universal/egg/macholib/util.py", line 227, in iter_platform_files >> if is_platform_file(fn): >> File "build/bdist.macosx-10.6-universal/egg/macholib/util.py", line 206, in is_platform_file >> header = mach_o.fat_header.from_fileobj(fileobj, _endian_='>') >> File "build/bdist.macosx-10.6-universal/egg/macholib/ptypes.py", line 44, in from_fileobj >> return cls.from_str(f.read(cls._size_), **kw) >> File "build/bdist.macosx-10.6-universal/egg/macholib/ptypes.py", line 48, in from_str >> return cls.from_tuple(struct.unpack(endian + cls._format_, s), **kw) >> error: unpack requires a string argument of length 8 >>> /Users/mathew_oak/Documents/My Applications/ShotChopper/build/bdist.macosx-10.6-universal/egg/macholib/ptypes.py(48)from_str() >> (Pdb) interrupted > > > > ___________________________________________________________________________ > > Australian Antarctic Division - Commonwealth of Australia > IMPORTANT: This transmission is intended for the addressee only. If you are not the > intended recipient, you are notified that use or dissemination of this communication is > strictly prohibited by Commonwealth law. If you have received this transmission in error, > please notify the sender immediately by e-mail or by telephoning +61 3 6232 3209 and > DELETE the message. > Visit our web site at http://www.antarctica.gov.au/ > ___________________________________________________________________________ > _______________________________________________ > Pythonmac-SIG maillist - Pythonmac-SIG at python.org > http://mail.python.org/mailman/listinfo/pythonmac-sig > unsubscribe: http://mail.python.org/mailman/options/Pythonmac-SIG -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 3567 bytes Desc: not available URL: From ronaldoussoren at mac.com Tue Jul 27 13:21:23 2010 From: ronaldoussoren at mac.com (Ronald Oussoren) Date: Tue, 27 Jul 2010 13:21:23 +0200 Subject: [Pythonmac-SIG] py2app problems with spawn In-Reply-To: References: Message-ID: <79143BED-30D3-4B94-A4F6-BAF4AFB313C1@mac.com> On 26 Jul, 2010, at 5:35, Tom MacWright wrote: > Hi all, > > I've switched to the Python.org 2.7 distribution after figuring out that you can't do a standalone py2app application with system python (I evidently wasn't reading through -h and it's not noted in documentation). > > However, I'm running into another problem: is spawn() not supported by py2app-generated applications? When running this application (which doesn't contain a frontend, but does contain a web server based off of the Flask microframework), the mac application quickly quits, and running it from the terminal gives: > > (mapsonastick_env)~/Code/python/mapsonastick_env/mapsonastick/dist/moas.app/Contents/MacOS$ ./moas > * Running on http://127.0.0.1:5000/ > * Restarting with reloader... > python: posix_spawn: /Users/tmcw/Code/python/mapsonastick_env/mapsonastick/dist/moas.app/Contents/MacOS/../Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python: Unknown error: 0 > > This is odd because neither flask, its base library werkzeug, nor my application, use spawn directly, and running simply ./python in the directory gives the same error: posix_spawn is used by the default python/pythonw executable inside the python framework in Python 2.7. Do you use virtualenv or something like that? I use virtualenv for pyobjc development, but have a local patched version that fixes a number of issues. Ronald -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 3567 bytes Desc: not available URL: From rowen at uw.edu Tue Jul 27 20:59:19 2010 From: rowen at uw.edu (Russell E. Owen) Date: Tue, 27 Jul 2010 11:59:19 -0700 Subject: [Pythonmac-SIG] py2app and python versions References: <4DEADFB9-6AAB-43BC-9D18-2568F864B93D@mac.com> Message-ID: I'm flexible: I'll use what py2app requires. I hope most other developers are in the same situation. Python 2.6 sounds like an excellent choice to me. There are binary installers for most common 3rd party packages, so it's easy to adopt (unlike Python 2.7). -- Russell In article <4DEADFB9-6AAB-43BC-9D18-2568F864B93D at mac.com>, Ronald Oussoren wrote: > Hi, > > What is the minimal python version that peoply actually use py2app with? > > I want to do some development on py2app and related package later this year > to make it fully support python eggs and may want to modernize the code while > doing that. The amount of modernization that is possible depends in part on > the minimaly required python version. > > That said, if I start doing serious development it is pretty likely that I > accidently break support for versions before 2.6, as that is the minimal > version I test PyObjC with. Python 2.6 would also allow me to rip out all > compatibility cruft, including the cruft needed to annotate byte literals > without using the byte-literal syntax. > > Ronald > > P.S. I'm typing this at the airport on the way back from europython. AFAIK > py2app on my machine currently works with both python2.7 and python3.2, I'll > therefore push out releases after committing some small fixes (which will > happen once I have Internet > access)--------------------------------------------------------------------- From ronaldoussoren at mac.com Tue Jul 27 21:13:34 2010 From: ronaldoussoren at mac.com (Ronald Oussoren) Date: Tue, 27 Jul 2010 21:13:34 +0200 Subject: [Pythonmac-SIG] ANN: py2app 0.5 Message-ID: <2E51FD64-BD00-4BD6-BCA8-89E48A672FA7@mac.com> Hi, I've just uploaded py2app 0.5 and new versions of altgraph, modulegraph and macholib. I hope this solves most issues with py2app. "easy_install-X.Y -U py2app" should install the software for you (where X.Y is your favorite version of Python) There is one new feature in this release: experimental support for python 3. This basicly means that I managed to build a single application as a standalone application bundle, without much testing. Alias builds and plugin bundles almost certainly don't work (the first because alias builds use the Carbon module which isn't available in python 3, the latter because I had to rewrite the C code in the application bundles and probably have to do the same for plugin bundles). Ronald -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 3567 bytes Desc: not available URL: From cohar at conncoll.edu Wed Jul 28 00:08:26 2010 From: cohar at conncoll.edu (Charles Hartman) Date: Tue, 27 Jul 2010 18:08:26 -0400 Subject: [Pythonmac-SIG] ANN: py2app 0.5 In-Reply-To: <2E51FD64-BD00-4BD6-BCA8-89E48A672FA7@mac.com> References: <2E51FD64-BD00-4BD6-BCA8-89E48A672FA7@mac.com> Message-ID: Ronald, like everyone else, I'm very grateful to you for taking up py2app, which is crucial to making/keeping Python popular on the Mac. Using Python 2.6.5, I did the easy_install you just specified. Trying it for the first time, I'm getting an error because /Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/py2app-0.5-py2.6.egg/py2app/apptemplate/prebuilt/main-fat doesn't exist. The ...../prebuilt/ directory is empty. I'm sure I'm doing something dumb and probably simple. Charles Hartman -------------- next part -------------- An HTML attachment was scrubbed... URL: From ronaldoussoren at mac.com Wed Jul 28 09:00:54 2010 From: ronaldoussoren at mac.com (Ronald Oussoren) Date: Wed, 28 Jul 2010 00:00:54 -0700 (PDT) Subject: [Pythonmac-SIG] ANN: py2app 0.5 In-Reply-To: Message-ID: <160ff53b-8f13-4499-ee93-aa8e0fec8232@me.com> On 28 Jul, 2010,at 12:08 AM, Charles Hartman wrote: Ronald, like everyone else, I'm very grateful to you for taking up py2app, which is crucial to making/keeping Python popular on the Mac. Using Python 2.6.5, I did the easy_install you just specified. ?Trying it for the first time, I'm getting an error because? /Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/py2app-05-py2.6.egg/py2app/apptemplate/prebuilt/main-fat doesn't exist. ?The ...../prebuilt/ directory is empty. I'm sure I'm doing something dumb and probably simple. ? It seems that the prebuilt files aren't included in the egg files. I don't have time to look into this today, but will do so as soon as I can. Ronald Charles Hartman _______________________________________________ Pythonmac-SIG maillist - Pythonmac-SIG at python.org http://mail.python.org/mailman/listinfo/pythonmac-sig unsubscribe: http://mail.python.org/mailman/options/Pythonmac-SIG -------------- next part -------------- An HTML attachment was scrubbed... URL: From matti.lyra at gmail.com Wed Jul 28 13:20:19 2010 From: matti.lyra at gmail.com (Matti Lyra) Date: Wed, 28 Jul 2010 12:20:19 +0100 Subject: [Pythonmac-SIG] PyQwt and PyInstaller Message-ID: <3F47157D-5D1B-4BBE-920F-BE6DC104A58E@gmail.com> Hello. Does someone have experience on OS X on creating an app bundle with PyInstaller of a project that contains a PyQwt plot. I've installed PyQt, Qt and PyQwt from MacPorts and it seems that there is some linker error related to libLAPACK.dylib. When I run the application from the command line everything is fine but when I make an app bundle with PyInstaller the app fails with an error saying that PyQt4.QtCore.so can't load library libLAPACK.dylib (referenced from vecLib) because an incompatible libarary version - libLAPACK provides version 0.0.0 (this would be the libLAPACK that comes with Atlas and is installed by MacPorts). Here is the script that I'm using import sys from PyQt4.QtGui import * from PyQt4.QtCore import * from PyQt4.Qwt5 import * class MyApp (QMainWindow): def __init__(self, parent = None): QMainWindow.__init__(self, parent) self.setGeometry(300, 300, 250, 150) app = QApplication(sys.argv) ui = MyApp() ui.show() ui.raise_() sys.exit(app.exec_()) The error message is as follows: .Mactest dlopen(/path/to/Mactest.app/Contents/MacOS/PyQt4.QtCore.so, 2): Library not loaded: /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libLAPACK.dylib .Mactest Referenced from: /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/vecLib .Mactest Reason: Incompatible library version: vecLib requires version 1.0.0 or later, but libLAPACK.dylib provides version 0.0.0 From grubert at users.sourceforge.net Wed Jul 28 14:22:13 2010 From: grubert at users.sourceforge.net (engelbert gruber) Date: Wed, 28 Jul 2010 14:22:13 +0200 Subject: [Pythonmac-SIG] ANN: py2app 0.5 In-Reply-To: <160ff53b-8f13-4499-ee93-aa8e0fec8232@me.com> References: <160ff53b-8f13-4499-ee93-aa8e0fec8232@me.com> Message-ID: maybe that is the reason why i needed to call "sudo python build py2app" On Wed, Jul 28, 2010 at 9:00 AM, Ronald Oussoren wrote: > > > On 28 Jul, 2010,at 12:08 AM, Charles Hartman wrote: > > Ronald, like everyone else, I'm very grateful to you for taking up py2app, > which is crucial to making/keeping Python popular on the Mac. > Using Python 2.6.5, I did the easy_install you just specified. ?Trying it > for the first time, I'm getting an error because > /Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/py2app-0.5-py2.6.egg/py2app/apptemplate/prebuilt/main-fat > doesn't exist. ?The ...../prebuilt/ directory is empty. > > I'm sure I'm doing something dumb and probably simple. > > > It seems that the prebuilt files aren't included in the egg files. I don't > have time to look into this today, but will do so as soon as I can. > Ronald > > Charles Hartman > _______________________________________________ > Pythonmac-SIG maillist - Pythonmac-SIG at python.org > http://mail.python.org/mailman/listinfo/pythonmac-sig > unsubscribe: http://mail.python.org/mailman/options/Pythonmac-SIG > > _______________________________________________ > Pythonmac-SIG maillist ?- ?Pythonmac-SIG at python.org > http://mail.python.org/mailman/listinfo/pythonmac-sig > unsubscribe: http://mail.python.org/mailman/options/Pythonmac-SIG > > From tom at developmentseed.org Wed Jul 28 16:30:08 2010 From: tom at developmentseed.org (Tom MacWright) Date: Wed, 28 Jul 2010 10:30:08 -0400 Subject: [Pythonmac-SIG] ANN: py2app 0.5 In-Reply-To: <2E51FD64-BD00-4BD6-BCA8-89E48A672FA7@mac.com> References: <2E51FD64-BD00-4BD6-BCA8-89E48A672FA7@mac.com> Message-ID: Hey, I'd just like to say thanks - it's incredibly great to have some movement and leadership here (plus this'll make the installation process of py2app way less annoying - I got used to installing macholib, altgraph, modulegraph, and py2app separately in their dependency order) Tom On Tue, Jul 27, 2010 at 3:13 PM, Ronald Oussoren wrote: > Hi, > > I've just uploaded py2app 0.5 and new versions of altgraph, modulegraph and > macholib. I hope this solves most issues with py2app. "easy_install-X.Y -U > py2app" should install the software for you (where X.Y is your favorite > version of Python) > > There is one new feature in this release: experimental support for python > 3. This basicly means that I managed to build a single application as a > standalone application bundle, without much testing. Alias builds and > plugin bundles almost certainly don't work (the first because alias builds > use the Carbon module which isn't available in python 3, the latter because > I had to rewrite the C code in the application bundles and probably have to > do the same for plugin bundles). > > Ronald > _______________________________________________ > Pythonmac-SIG maillist - Pythonmac-SIG at python.org > http://mail.python.org/mailman/listinfo/pythonmac-sig > unsubscribe: http://mail.python.org/mailman/options/Pythonmac-SIG > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From lemoine.nathan at gmail.com Wed Jul 28 18:38:07 2010 From: lemoine.nathan at gmail.com (Nathan Lemoine) Date: Wed, 28 Jul 2010 12:38:07 -0400 Subject: [Pythonmac-SIG] py2app error Message-ID: <4DD5585D-1E8F-4D26-955A-43BCF01F50FF@gmail.com> Hey everyone, I've been trying to bundle my script into a standalone Mac application using the most updated version of py2app and Python 2.5 on OSX 10.5.8. I'm getting error messages during the compile procedure and I haven't come across a way to fix it. So I can run the py2applet and generate the setup.py file easily. Here's the output when I attempt python setup.py py2app: Traceback (most recent call last): File "/Library/Python/2.5/site-packages/py2app-0.5-py2.5.egg/py2app/ build_app.py", line 604, in _run self.run_normal() File "/Library/Python/2.5/site-packages/py2app-0.5-py2.5.egg/py2app/ build_app.py", line 675, in run_normal self.create_binaries(py_files, pkgdirs, extensions, loader_files) File "/Library/Python/2.5/site-packages/py2app-0.5-py2.5.egg/py2app/ build_app.py", line 739, in create_binaries dry_run=self.dry_run) File "/Library/Python/2.5/site-packages/py2app-0.5-py2.5.egg/py2app/ util.py", line 376, in byte_compile if force or newer(mod.filename, cfile): File "/Library/Python/2.5/site-packages/py2app-0.5-py2.5.egg/py2app/ util.py", line 172, in newer msource = get_mtime(source) File "/Library/Python/2.5/site-packages/py2app-0.5-py2.5.egg/py2app/ util.py", line 164, in get_mtime info = zf.getinfo(rest) File "/System/Library/Frameworks/Python.framework/Versions/2.5/lib/ python2.5/zipfile.py", line 462, in getinfo return self.NameToInfo[name] KeyError: 'pyglet/__init__.pyc' > /System/Library/Frameworks/Python.framework/Versions/2.5/lib/ python2.5/zipfile.py(462)getinfo() -> return self.NameToInfo[name] So the KeyError would tell me that py2app does not have pyglet in its dictionary, so that it doesn't know where to search to find pyglet, correct? When I go into Python and find the path for the pyglet module (pyglet.__path__), I receive ['/Library/Python/2.5/site-packages/ pyglet-1.1.4-py2.5.egg/pyglet']. Do I have to tell py2app specifically where to find the pyglet module? If so, how do I do that. Also, whenever I run py2app in alias mode, I get a completely different error: sudo python py2app setup.py -A (sudo is run because I get a permission denied error if I don't use it( Traceback (most recent call last): File "/Library/Python/2.5/site-packages/py2app-0.5-py2.5.egg/py2app/ build_app.py", line 602, in _run self.run_alias() File "/Library/Python/2.5/site-packages/py2app-0.5-py2.5.egg/py2app/ build_app.py", line 548, in run_alias dst = self.build_alias_executable(target, target.script) File "/Library/Python/2.5/site-packages/py2app-0.5-py2.5.egg/py2app/ build_app.py", line 1145, in build_alias_executable appdir, resdir, plist = self.create_bundle(target, script) File "/Library/Python/2.5/site-packages/py2app-0.5-py2.5.egg/py2app/ build_app.py", line 1131, in create_bundle use_runtime_preference=use_runtime_preference File "/Library/Python/2.5/site-packages/py2app-0.5-py2.5.egg/py2app/ build_app.py", line 1120, in create_appbundle extension=self.extension, File "/Library/Python/2.5/site-packages/py2app-0.5-py2.5.egg/py2app/ create_appbundle.py", line 34, in create_appbundle copy(srcmain, destmain) File "/Library/Python/2.5/site-packages/py2app-0.5-py2.5.egg/py2app/ util.py", line 233, in mergecopy return macholib.util.mergecopy(src, dest) File "build/bdist.macosx-10.5-i386/egg/macholib/util.py", line 111, in mergecopy copy2(src, dest) File "build/bdist.macosx-10.5-i386/egg/macholib/util.py", line 43, in copy2 shutil.copy2(fsencoding(src), fsencoding(dst)) File "/System/Library/Frameworks/Python.framework/Versions/2.5/lib/ python2.5/shutil.py", line 91, in copy2 copyfile(src, dst) File "/System/Library/Frameworks/Python.framework/Versions/2.5/lib/ python2.5/shutil.py", line 46, in copyfile fsrc = open(src, 'rb') IOError: [Errno 2] No such file or directory: '/Library/Python/2.5/ site-packages/py2app-0.5-py2.5.egg/py2app/apptemplate/prebuilt/main- i386' > /System/Library/Frameworks/Python.framework/Versions/2.5/lib/ python2.5/shutil.py(53)copyfile() -> fsrc.close() I went into the Python Framework folder and the only prebuilt executeable in there is 32bit one, there isn't a main-i386 file. Am I missing a file? Any help is appreciated Nathan Lemoine From ronaldoussoren at mac.com Thu Jul 29 07:56:58 2010 From: ronaldoussoren at mac.com (Ronald Oussoren) Date: Thu, 29 Jul 2010 07:56:58 +0200 Subject: [Pythonmac-SIG] ANN: py2app 0.5 In-Reply-To: <160ff53b-8f13-4499-ee93-aa8e0fec8232@me.com> References: <160ff53b-8f13-4499-ee93-aa8e0fec8232@me.com> Message-ID: On 28 Jul, 2010, at 9:00, Ronald Oussoren wrote: > > > On 28 Jul, 2010,at 12:08 AM, Charles Hartman wrote: > >> Ronald, like everyone else, I'm very grateful to you for taking up py2app, which is crucial to making/keeping Python popular on the Mac. >> >> Using Python 2.6.5, I did the easy_install you just specified. Trying it for the first time, I'm getting an error because >> >> /Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/py2app-0.5-py2.6.egg/py2app/apptemplate/prebuilt/main-fat >> >> doesn't exist. The ...../prebuilt/ directory is empty. > >> >> I'm sure I'm doing something dumb and probably simple. > > It seems that the prebuilt files aren't included in the egg files. I don't have time to look into this today, but will do so as soon as I can. py2app 0.5.1 should fix that and is up on pypi. Ronald -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 3567 bytes Desc: not available URL: From ronaldoussoren at mac.com Thu Jul 29 08:09:07 2010 From: ronaldoussoren at mac.com (Ronald Oussoren) Date: Thu, 29 Jul 2010 08:09:07 +0200 Subject: [Pythonmac-SIG] py2app error In-Reply-To: <4DD5585D-1E8F-4D26-955A-43BCF01F50FF@gmail.com> References: <4DD5585D-1E8F-4D26-955A-43BCF01F50FF@gmail.com> Message-ID: On 28 Jul, 2010, at 18:38, Nathan Lemoine wrote: > Hey everyone, > > I've been trying to bundle my script into a standalone Mac application using the most updated version of py2app and Python 2.5 on OSX 10.5.8. I'm getting error messages during the compile procedure and I haven't come across a way to fix it. So I can run the py2applet and generate the setup.py file easily. > > Here's the output when I attempt python setup.py py2app: > > Traceback (most recent call last): > File "/Library/Python/2.5/site-packages/py2app-0.5-py2.5.egg/py2app/build_app.py", line 604, in _run > self.run_normal() > File "/Library/Python/2.5/site-packages/py2app-0.5-py2.5.egg/py2app/build_app.py", line 675, in run_normal > self.create_binaries(py_files, pkgdirs, extensions, loader_files) > File "/Library/Python/2.5/site-packages/py2app-0.5-py2.5.egg/py2app/build_app.py", line 739, in create_binaries > dry_run=self.dry_run) > File "/Library/Python/2.5/site-packages/py2app-0.5-py2.5.egg/py2app/util.py", line 376, in byte_compile > if force or newer(mod.filename, cfile): > File "/Library/Python/2.5/site-packages/py2app-0.5-py2.5.egg/py2app/util.py", line 172, in newer > msource = get_mtime(source) > File "/Library/Python/2.5/site-packages/py2app-0.5-py2.5.egg/py2app/util.py", line 164, in get_mtime > info = zf.getinfo(rest) > File "/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/zipfile.py", line 462, in getinfo > return self.NameToInfo[name] > KeyError: 'pyglet/__init__.pyc' > > /System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/zipfile.py(462)getinfo() > -> return self.NameToInfo[name] Could you create a small pyglet program with a setup.py that demonstrates the problem? py2app should be able to find packages used by your script, and even if it didn't find pyglet it shouldn't fail in this way. Is "/Library/Python/2.5/site-packages/pyglet-1.1.4-py2.5.egg" a file or a directory (both should work, but you never know)? > > > So the KeyError would tell me that py2app does not have pyglet in its dictionary, so that it doesn't know where to search to find pyglet, correct? When I go into Python and find the path for the pyglet module (pyglet.__path__), I receive ['/Library/Python/2.5/site-packages/pyglet-1.1.4-py2.5.egg/pyglet']. > > Do I have to tell py2app specifically where to find the pyglet module? If so, how do I do that. > > Also, whenever I run py2app in alias mode, I get a completely different error: > > sudo python py2app setup.py -A (sudo is run because I get a permission denied error if I don't use it( > > Traceback (most recent call last): > File "/Library/Python/2.5/site-packages/py2app-0.5-py2.5.egg/py2app/build_app.py", line 602, in _run > self.run_alias() > File "/Library/Python/2.5/site-packages/py2app-0.5-py2.5.egg/py2app/build_app.py", line 548, in run_alias > dst = self.build_alias_executable(target, target.script) > File "/Library/Python/2.5/site-packages/py2app-0.5-py2.5.egg/py2app/build_app.py", line 1145, in build_alias_executable > appdir, resdir, plist = self.create_bundle(target, script) > File "/Library/Python/2.5/site-packages/py2app-0.5-py2.5.egg/py2app/build_app.py", line 1131, in create_bundle > use_runtime_preference=use_runtime_preference > File "/Library/Python/2.5/site-packages/py2app-0.5-py2.5.egg/py2app/build_app.py", line 1120, in create_appbundle > extension=self.extension, > File "/Library/Python/2.5/site-packages/py2app-0.5-py2.5.egg/py2app/create_appbundle.py", line 34, in create_appbundle > copy(srcmain, destmain) > File "/Library/Python/2.5/site-packages/py2app-0.5-py2.5.egg/py2app/util.py", line 233, in mergecopy > return macholib.util.mergecopy(src, dest) > File "build/bdist.macosx-10.5-i386/egg/macholib/util.py", line 111, in mergecopy > copy2(src, dest) > File "build/bdist.macosx-10.5-i386/egg/macholib/util.py", line 43, in copy2 > shutil.copy2(fsencoding(src), fsencoding(dst)) > File "/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/shutil.py", line 91, in copy2 > copyfile(src, dst) > File "/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/shutil.py", line 46, in copyfile > fsrc = open(src, 'rb') > IOError: [Errno 2] No such file or directory: '/Library/Python/2.5/site-packages/py2app-0.5-py2.5.egg/py2app/apptemplate/prebuilt/main-i386' > > /System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/shutil.py(53)copyfile() > -> fsrc.close() > > I went into the Python Framework folder and the only prebuilt executeable in there is 32bit one, there isn't a main-i386 file. Am I missing a file? You aren't missing a file, py2app doesn't have a main-i386 file. As a quick workaround you can copy /Library/Python/2.5/site-packages/py2app-0.5-py2.5.egg/py2app/apptemplate/prebuilt/main-fat to /Library/Python/2.5/site-packages/py2app-0.5-py2.5.egg/py2app/apptemplate/prebuilt/main-i386. I will tweak py2app to better handle this, that will be in the next release (0.5.2, hopefully later this week). Ronald -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 3567 bytes Desc: not available URL: From ronaldoussoren at mac.com Thu Jul 29 08:34:17 2010 From: ronaldoussoren at mac.com (Ronald Oussoren) Date: Thu, 29 Jul 2010 08:34:17 +0200 Subject: [Pythonmac-SIG] py2app error In-Reply-To: References: <4DD5585D-1E8F-4D26-955A-43BCF01F50FF@gmail.com> Message-ID: <53F2A68A-9415-474D-88EB-78A2F3E986A2@mac.com> On 29 Jul, 2010, at 8:09, Ronald Oussoren wrote: > > On 28 Jul, 2010, at 18:38, Nathan Lemoine wrote: > >> >> Traceback (most recent call last): >> File "/Library/Python/2.5/site-packages/py2app-0.5-py2.5.egg/py2app/build_app.py", line 602, in _run >> self.run_alias() >> File "/Library/Python/2.5/site-packages/py2app-0.5-py2.5.egg/py2app/build_app.py", line 548, in run_alias >> dst = self.build_alias_executable(target, target.script) >> File "/Library/Python/2.5/site-packages/py2app-0.5-py2.5.egg/py2app/build_app.py", line 1145, in build_alias_executable >> appdir, resdir, plist = self.create_bundle(target, script) >> File "/Library/Python/2.5/site-packages/py2app-0.5-py2.5.egg/py2app/build_app.py", line 1131, in create_bundle >> use_runtime_preference=use_runtime_preference >> File "/Library/Python/2.5/site-packages/py2app-0.5-py2.5.egg/py2app/build_app.py", line 1120, in create_appbundle >> extension=self.extension, >> File "/Library/Python/2.5/site-packages/py2app-0.5-py2.5.egg/py2app/create_appbundle.py", line 34, in create_appbundle >> copy(srcmain, destmain) >> File "/Library/Python/2.5/site-packages/py2app-0.5-py2.5.egg/py2app/util.py", line 233, in mergecopy >> return macholib.util.mergecopy(src, dest) >> File "build/bdist.macosx-10.5-i386/egg/macholib/util.py", line 111, in mergecopy >> copy2(src, dest) >> File "build/bdist.macosx-10.5-i386/egg/macholib/util.py", line 43, in copy2 >> shutil.copy2(fsencoding(src), fsencoding(dst)) >> File "/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/shutil.py", line 91, in copy2 >> copyfile(src, dst) >> File "/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/shutil.py", line 46, in copyfile >> fsrc = open(src, 'rb') >> IOError: [Errno 2] No such file or directory: '/Library/Python/2.5/site-packages/py2app-0.5-py2.5.egg/py2app/apptemplate/prebuilt/main-i386' >>> /System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/shutil.py(53)copyfile() >> -> fsrc.close() >> >> I went into the Python Framework folder and the only prebuilt executeable in there is 32bit one, there isn't a main-i386 file. Am I missing a file? > > You aren't missing a file, py2app doesn't have a main-i386 file. As a quick workaround you can copy /Library/Python/2.5/site-packages/py2app-0.5-py2.5.egg/py2app/apptemplate/prebuilt/main-fat to /Library/Python/2.5/site-packages/py2app-0.5-py2.5.egg/py2app/apptemplate/prebuilt/main-i386. > > I will tweak py2app to better handle this, that will be in the next release (0.5.2, hopefully later this week). I've upload py2app 0.5.2. With this version I can build a pyobjc application using python 2.5 (without the IOError exception), the pyglet error is not yet fixed. Ronald -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 3567 bytes Desc: not available URL: From dan.odonovan+nabble at gmail.com Thu Jul 29 14:30:25 2010 From: dan.odonovan+nabble at gmail.com (danodonovan) Date: Thu, 29 Jul 2010 05:30:25 -0700 (PDT) Subject: [Pythonmac-SIG] py2app x86_64 patch and question Message-ID: <29295418.post@talk.nabble.com> Hi Ronald, I hope the Euro Python conference went well. I think py2app is a great idea, thanks for your hard work. I've been using py2app 0.5.2 (from SVN) to build a non-native X11 python app. I tweaked setup.py in testing/apptemplate to include: { 'name': 'main-x86_64', 'target': '10.5', 'cflags': '-isysroot /Developer/SDKs/MacOSX10.5.sdk -arch x86_64', 'cc': 'gcc-4.2', }, as my non-native X11 python isn't fat (or intel etc). Distutils builds everything in build/bdist.macosx-10.6-x86_64 (and so I needed a main-x86_64 prebuilt exe) This works fine for me (and I imagine could be done for main-i386 as someone else mentioned). But leads to my question: For whatever reason, py2app or distutils isn't including my C .so files in the dist/app - could this be because they reside in build/bdist.macosx-10.6-x86_64 rather than build/bdist.macosx-10.6-intel etc. as would be expected in a native build? Is there any way to force py2app to include the binaries from here? (or is this a distutils issue?) Thanks for your help, Dan -- View this message in context: http://old.nabble.com/py2app-x86_64-patch-and-question-tp29295418p29295418.html Sent from the Python - pythonmac-sig mailing list archive at Nabble.com. From ronaldoussoren at mac.com Thu Jul 29 15:29:41 2010 From: ronaldoussoren at mac.com (Ronald Oussoren) Date: Thu, 29 Jul 2010 15:29:41 +0200 Subject: [Pythonmac-SIG] py2app x86_64 patch and question In-Reply-To: <29295418.post@talk.nabble.com> References: <29295418.post@talk.nabble.com> Message-ID: On 29 Jul, 2010, at 14:30, danodonovan wrote: > > Hi Ronald, I hope the Euro Python conference went well. I think py2app is a > great idea, thanks for your hard work. > > I've been using py2app 0.5.2 (from SVN) to build a non-native X11 python > app. I tweaked setup.py in testing/apptemplate to include: > > { > 'name': 'main-x86_64', > 'target': '10.5', > 'cflags': '-isysroot /Developer/SDKs/MacOSX10.5.sdk -arch x86_64', > 'cc': 'gcc-4.2', > }, I'll add this and the other 3 single-architecture variants in the next release. > > as my non-native X11 python isn't fat (or intel etc). Distutils builds > everything in build/bdist.macosx-10.6-x86_64 (and so I needed a main-x86_64 > prebuilt exe) > > This works fine for me (and I imagine could be done for main-i386 as someone > else mentioned). But leads to my question: > > For whatever reason, py2app or distutils isn't including my C .so files in > the dist/app - could this be because they reside in > build/bdist.macosx-10.6-x86_64 rather than build/bdist.macosx-10.6-intel > etc. as would be expected in a native build? Is there any way to force > py2app to include the binaries from here? (or is this a distutils issue?) py2app should not cause about the architecture string. You'll probably see warnings in the py2app output of it not being able to find your extension when building the module graph (those should be burried in the rather verbose output of py2app, another thing that should be fixed in the future). Do you have a setup.py where you build extensions and run py2app as well? If so, could you try creating a setup.cfg file with this contents: [build_ext] inplace = 1 That instructes build_ext to copy extensions into the source tree, and I wonder if that would solve your problem. If that works it is merely a workaround, py2app and/or modulegraph should then be fixed to work when this setting is not present. Ronald > > Thanks for your help, > > Dan > > > -- > View this message in context: http://old.nabble.com/py2app-x86_64-patch-and-question-tp29295418p29295418.html > Sent from the Python - pythonmac-sig mailing list archive at Nabble.com. > > _______________________________________________ > Pythonmac-SIG maillist - Pythonmac-SIG at python.org > http://mail.python.org/mailman/listinfo/pythonmac-sig > unsubscribe: http://mail.python.org/mailman/options/Pythonmac-SIG -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 3567 bytes Desc: not available URL: From christian at prinoth.name Thu Jul 29 15:43:44 2010 From: christian at prinoth.name (Christian Prinoth) Date: Thu, 29 Jul 2010 15:43:44 +0200 Subject: [Pythonmac-SIG] Possible bug with AppScript and Excel? Message-ID: Hi, I am having some problems handling axes in Excel charts via python and appscript. I am using apple's stock python 2.6.1, appscript 0.21.1 and Excel 12.2.5 on Snow Leopard 10.6.4 Here is how I am trying to get hold of an axis: *c=app('Microsoft Excel').get_axis(app.active_sheet.chart_objects[1].chart,axis_type=k.value_axis) * now c contains *app(u'/Applications/Microsoft Office 2008/Microsoft Excel.app').active_sheet.chart_objects[1].chart.axes.ID(131073)* but if I do: *c2=app('Microsoft Excel').get_axis(app.active_chart,axis_type=k.value_axis) * apparently I get the same result, in fact c==c2 returns true. Yet, if I try to access c, I get an error, eg *In [16]: c.maximum_scale()* *------------------------------------------------------------* *Traceback (most recent call last):* * File "", line 1, in * * File "build/bdist.macosx-10.6-universal/egg/appscript/reference.py", line 643, in __call__* * return self.get(*args, **kargs)* * File "build/bdist.macosx-10.6-universal/egg/appscript/reference.py", line 499, in __call__* * raise CommandError(self, (args, kargs), e, self.AS_appdata)* *CommandError: Command failed:* * * *OSERROR: -1728* * * *MESSAGE: The object you are trying to access does not exist* * * *COMMAND: app(u'/Applications/Microsoft Office 2008/Microsoft Excel.app').active_sheet.chart_objects[1].chart.axes.ID(131073). maximum_scale.ge*t() but c2 works perfectly: *In [17]: c2.maximum_scale()* *Out[17]: 0.080000000000000016* Does anyone know what I am doing wrong or if there is a bug somewhere? -------------- next part -------------- An HTML attachment was scrubbed... URL: From cohar at conncoll.edu Thu Jul 29 17:56:39 2010 From: cohar at conncoll.edu (Charles Hartman) Date: Thu, 29 Jul 2010 11:56:39 -0400 Subject: [Pythonmac-SIG] ANN: py2app 0.5 In-Reply-To: References: <160ff53b-8f13-4499-ee93-aa8e0fec8232@me.com> Message-ID: py2app 0.5.2 fixes everything for me -- 1,002 thanks, Ronald! Charles Hartman On Thu, Jul 29, 2010 at 1:56 AM, Ronald Oussoren wrote: > > On 28 Jul, 2010, at 9:00, Ronald Oussoren wrote: > > > > > > > On 28 Jul, 2010,at 12:08 AM, Charles Hartman wrote: > > > >> Ronald, like everyone else, I'm very grateful to you for taking up > py2app, which is crucial to making/keeping Python popular on the Mac. > >> > >> Using Python 2.6.5, I did the easy_install you just specified. Trying > it for the first time, I'm getting an error because > >> > >> > /Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/py2app-0.5-py2.6.egg/py2app/apptemplate/prebuilt/main-fat > >> > >> doesn't exist. The ...../prebuilt/ directory is empty. > > > >> > >> I'm sure I'm doing something dumb and probably simple. > > > > It seems that the prebuilt files aren't included in the egg files. I > don't have time to look into this today, but will do so as soon as I can. > > py2app 0.5.1 should fix that and is up on pypi. > > Ronald > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From lemoine.nathan at gmail.com Fri Jul 30 02:59:50 2010 From: lemoine.nathan at gmail.com (Nathan Lemoine) Date: Thu, 29 Jul 2010 20:59:50 -0400 Subject: [Pythonmac-SIG] py2app error In-Reply-To: <53F2A68A-9415-474D-88EB-78A2F3E986A2@mac.com> References: <4DD5585D-1E8F-4D26-955A-43BCF01F50FF@gmail.com> <53F2A68A-9415-474D-88EB-78A2F3E986A2@mac.com> Message-ID: <32CA16F6-27E7-45A8-9808-C58688D96A85@gmail.com> I installed the 0.5.2 update, and I've tried making just a very simple pyglet app to play a movie file so that you all could try it if you want on your python distributions: import pyglet vidPath="video.avi" ##put the path to a video file here window = pyglet.window.Window() source = pyglet.media.StreamingSource() MediaLoad = pyglet.media.load(vidPath) player = pyglet.media.Player() player.queue(MediaLoad) player.play() @window.event def on_draw(): player.get_texture().blit(0,0) pyglet.app.run() Executing python setup.py py2app still gives me the same error: Traceback (most recent call last): File "/Library/Python/2.5/site-packages/py2app-0.5.2-py2.5.egg/ py2app/build_app.py", line 604, in _run self.run_normal() File "/Library/Python/2.5/site-packages/py2app-0.5.2-py2.5.egg/ py2app/build_app.py", line 675, in run_normal self.create_binaries(py_files, pkgdirs, extensions, loader_files) File "/Library/Python/2.5/site-packages/py2app-0.5.2-py2.5.egg/ py2app/build_app.py", line 739, in create_binaries dry_run=self.dry_run) File "/Library/Python/2.5/site-packages/py2app-0.5.2-py2.5.egg/ py2app/util.py", line 376, in byte_compile if force or newer(mod.filename, cfile): File "/Library/Python/2.5/site-packages/py2app-0.5.2-py2.5.egg/ py2app/util.py", line 172, in newer msource = get_mtime(source) File "/Library/Python/2.5/site-packages/py2app-0.5.2-py2.5.egg/ py2app/util.py", line 164, in get_mtime info = zf.getinfo(rest) File "/System/Library/Frameworks/Python.framework/Versions/2.5/lib/ python2.5/zipfile.py", line 462, in getinfo return self.NameToInfo[name] KeyError: 'pyglet/__init__.pyc' > /System/Library/Frameworks/Python.framework/Versions/2.5/lib/ python2.5/zipfile.py(462)getinfo() -> return self.NameToInfo[name] (Pdb) I ran it in alias mode as well and it bundled 'tester.app' successfully. When I attempted to run the bundle, I just got a dialog box that said 'tester Error' and brought me to the MacPython website. I'm not sure how to find out what the issue is with the aliased bundle. Thanks for the help so far! I really appreciate it. I don't think I could figure this out on my own On Jul 29, 2010, at 2:34 AM, Ronald Oussoren wrote: > > On 29 Jul, 2010, at 8:09, Ronald Oussoren wrote: > >> >> On 28 Jul, 2010, at 18:38, Nathan Lemoine wrote: >> >>> >>> Traceback (most recent call last): >>> File "/Library/Python/2.5/site-packages/py2app-0.5-py2.5.egg/ >>> py2app/build_app.py", line 602, in _run >>> self.run_alias() >>> File "/Library/Python/2.5/site-packages/py2app-0.5-py2.5.egg/ >>> py2app/build_app.py", line 548, in run_alias >>> dst = self.build_alias_executable(target, target.script) >>> File "/Library/Python/2.5/site-packages/py2app-0.5-py2.5.egg/ >>> py2app/build_app.py", line 1145, in build_alias_executable >>> appdir, resdir, plist = self.create_bundle(target, script) >>> File "/Library/Python/2.5/site-packages/py2app-0.5-py2.5.egg/ >>> py2app/build_app.py", line 1131, in create_bundle >>> use_runtime_preference=use_runtime_preference >>> File "/Library/Python/2.5/site-packages/py2app-0.5-py2.5.egg/ >>> py2app/build_app.py", line 1120, in create_appbundle >>> extension=self.extension, >>> File "/Library/Python/2.5/site-packages/py2app-0.5-py2.5.egg/ >>> py2app/create_appbundle.py", line 34, in create_appbundle >>> copy(srcmain, destmain) >>> File "/Library/Python/2.5/site-packages/py2app-0.5-py2.5.egg/ >>> py2app/util.py", line 233, in mergecopy >>> return macholib.util.mergecopy(src, dest) >>> File "build/bdist.macosx-10.5-i386/egg/macholib/util.py", line >>> 111, in mergecopy >>> copy2(src, dest) >>> File "build/bdist.macosx-10.5-i386/egg/macholib/util.py", line 43, >>> in copy2 >>> shutil.copy2(fsencoding(src), fsencoding(dst)) >>> File "/System/Library/Frameworks/Python.framework/Versions/2.5/lib/ >>> python2.5/shutil.py", line 91, in copy2 >>> copyfile(src, dst) >>> File "/System/Library/Frameworks/Python.framework/Versions/2.5/lib/ >>> python2.5/shutil.py", line 46, in copyfile >>> fsrc = open(src, 'rb') >>> IOError: [Errno 2] No such file or directory: '/Library/Python/2.5/ >>> site-packages/py2app-0.5-py2.5.egg/py2app/apptemplate/prebuilt/ >>> main-i386' >>>> /System/Library/Frameworks/Python.framework/Versions/2.5/lib/ >>>> python2.5/shutil.py(53)copyfile() >>> -> fsrc.close() >>> >>> I went into the Python Framework folder and the only prebuilt >>> executeable in there is 32bit one, there isn't a main-i386 file. >>> Am I missing a file? >> >> You aren't missing a file, py2app doesn't have a main-i386 file. >> As a quick workaround you can copy /Library/Python/2.5/site- >> packages/py2app-0.5-py2.5.egg/py2app/apptemplate/prebuilt/main-fat >> to /Library/Python/2.5/site-packages/py2app-0.5-py2.5.egg/py2app/ >> apptemplate/prebuilt/main-i386. >> >> I will tweak py2app to better handle this, that will be in the next >> release (0.5.2, hopefully later this week). > > I've upload py2app 0.5.2. With this version I can build a pyobjc > application using python 2.5 (without the IOError exception), the > pyglet error is not yet fixed. > > Ronald > From ronaldoussoren at mac.com Fri Jul 30 07:54:08 2010 From: ronaldoussoren at mac.com (Ronald Oussoren) Date: Fri, 30 Jul 2010 07:54:08 +0200 Subject: [Pythonmac-SIG] py2app error In-Reply-To: <32CA16F6-27E7-45A8-9808-C58688D96A85@gmail.com> References: <4DD5585D-1E8F-4D26-955A-43BCF01F50FF@gmail.com> <53F2A68A-9415-474D-88EB-78A2F3E986A2@mac.com> <32CA16F6-27E7-45A8-9808-C58688D96A85@gmail.com> Message-ID: On 30 Jul, 2010, at 2:59, Nathan Lemoine wrote: > I installed the 0.5.2 update, and I've tried making just a very simple pyglet app to play a movie file so that you all could try it if you want on your python distributions: > > import pyglet > > vidPath="video.avi" ##put the path to a video file here > window = pyglet.window.Window() > source = pyglet.media.StreamingSource() > MediaLoad = pyglet.media.load(vidPath) > player = pyglet.media.Player() > player.queue(MediaLoad) > player.play() > > @window.event > def on_draw(): > player.get_texture().blit(0,0) > > pyglet.app.run() Thanks for the demo, that will definitly help in reproducing and fixing the problem. > > Executing python setup.py py2app still gives me the same error: > > Traceback (most recent call last): > File "/Library/Python/2.5/site-packages/py2app-0.5.2-py2.5.egg/py2app/build_app.py", line 604, in _run > self.run_normal() > File "/Library/Python/2.5/site-packages/py2app-0.5.2-py2.5.egg/py2app/build_app.py", line 675, in run_normal > self.create_binaries(py_files, pkgdirs, extensions, loader_files) > File "/Library/Python/2.5/site-packages/py2app-0.5.2-py2.5.egg/py2app/build_app.py", line 739, in create_binaries > dry_run=self.dry_run) > File "/Library/Python/2.5/site-packages/py2app-0.5.2-py2.5.egg/py2app/util.py", line 376, in byte_compile > if force or newer(mod.filename, cfile): > File "/Library/Python/2.5/site-packages/py2app-0.5.2-py2.5.egg/py2app/util.py", line 172, in newer > msource = get_mtime(source) > File "/Library/Python/2.5/site-packages/py2app-0.5.2-py2.5.egg/py2app/util.py", line 164, in get_mtime > info = zf.getinfo(rest) > File "/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/zipfile.py", line 462, in getinfo > return self.NameToInfo[name] > KeyError: 'pyglet/__init__.pyc' > > /System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/zipfile.py(462)getinfo() > -> return self.NameToInfo[name] > (Pdb) > > I ran it in alias mode as well and it bundled 'tester.app' successfully. When I attempted to run the bundle, I just got a dialog box that said 'tester Error' and brought me to the MacPython website. I'm not sure how to find out what the issue is with the aliased bundle. You can run the app from the command-line: test.app/Contents/MacOS/tester When you do that you'll get error messages in your terminal window, and those should explain what's going on. I expect that pyglet cannot be found. > > Thanks for the help so far! I really appreciate it. I don't think I could figure this out on my own I haven't had time to look into this issue specifically, I'll do so in the near future. Ronald > > > > On Jul 29, 2010, at 2:34 AM, Ronald Oussoren wrote: > >> >> On 29 Jul, 2010, at 8:09, Ronald Oussoren wrote: >> >>> >>> On 28 Jul, 2010, at 18:38, Nathan Lemoine wrote: >>> >>>> >>>> Traceback (most recent call last): >>>> File "/Library/Python/2.5/site-packages/py2app-0.5-py2.5.egg/py2app/build_app.py", line 602, in _run >>>> self.run_alias() >>>> File "/Library/Python/2.5/site-packages/py2app-0.5-py2.5.egg/py2app/build_app.py", line 548, in run_alias >>>> dst = self.build_alias_executable(target, target.script) >>>> File "/Library/Python/2.5/site-packages/py2app-0.5-py2.5.egg/py2app/build_app.py", line 1145, in build_alias_executable >>>> appdir, resdir, plist = self.create_bundle(target, script) >>>> File "/Library/Python/2.5/site-packages/py2app-0.5-py2.5.egg/py2app/build_app.py", line 1131, in create_bundle >>>> use_runtime_preference=use_runtime_preference >>>> File "/Library/Python/2.5/site-packages/py2app-0.5-py2.5.egg/py2app/build_app.py", line 1120, in create_appbundle >>>> extension=self.extension, >>>> File "/Library/Python/2.5/site-packages/py2app-0.5-py2.5.egg/py2app/create_appbundle.py", line 34, in create_appbundle >>>> copy(srcmain, destmain) >>>> File "/Library/Python/2.5/site-packages/py2app-0.5-py2.5.egg/py2app/util.py", line 233, in mergecopy >>>> return macholib.util.mergecopy(src, dest) >>>> File "build/bdist.macosx-10.5-i386/egg/macholib/util.py", line 111, in mergecopy >>>> copy2(src, dest) >>>> File "build/bdist.macosx-10.5-i386/egg/macholib/util.py", line 43, in copy2 >>>> shutil.copy2(fsencoding(src), fsencoding(dst)) >>>> File "/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/shutil.py", line 91, in copy2 >>>> copyfile(src, dst) >>>> File "/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/shutil.py", line 46, in copyfile >>>> fsrc = open(src, 'rb') >>>> IOError: [Errno 2] No such file or directory: '/Library/Python/2.5/site-packages/py2app-0.5-py2.5.egg/py2app/apptemplate/prebuilt/main-i386' >>>>> /System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/shutil.py(53)copyfile() >>>> -> fsrc.close() >>>> >>>> I went into the Python Framework folder and the only prebuilt executeable in there is 32bit one, there isn't a main-i386 file. Am I missing a file? >>> >>> You aren't missing a file, py2app doesn't have a main-i386 file. As a quick workaround you can copy /Library/Python/2.5/site-packages/py2app-0.5-py2.5.egg/py2app/apptemplate/prebuilt/main-fat to /Library/Python/2.5/site-packages/py2app-0.5-py2.5.egg/py2app/apptemplate/prebuilt/main-i386. >>> >>> I will tweak py2app to better handle this, that will be in the next release (0.5.2, hopefully later this week). >> >> I've upload py2app 0.5.2. With this version I can build a pyobjc application using python 2.5 (without the IOError exception), the pyglet error is not yet fixed. >> >> Ronald >> > -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 3567 bytes Desc: not available URL: From ronaldoussoren at mac.com Fri Jul 30 08:06:45 2010 From: ronaldoussoren at mac.com (Ronald Oussoren) Date: Fri, 30 Jul 2010 08:06:45 +0200 Subject: [Pythonmac-SIG] py2app not happy with zope.interface In-Reply-To: References: <793A2D4F-E7F2-4285-9D8E-6C75882511F7@mac.com> Message-ID: On 22 Jul, 2010, at 19:06, Russell E. Owen wrote: >>> >> >> How did you install zope.interface? Basically which easy_install or pip >> command-line did you use to install? > > I used "pip install zope.interface". When you use "pip install" to install packages namespace packages get installed in an odd way: the __init__.py file in the namespace package is not installed, and pth file is installed to fakes having a real package, for zope.interface the following tet installed: * zope * zope.interface-3.6.1-py2.7-nspkg.pth * zope.interface-3.6.1-py2.7.egg-info The nspkg.pth file is very ugly: import sys,types,os; p = os.path.join(sys._getframe(1).f_locals['sitedir'], *('zope',)); ie = os.path.exists(os.path.join(p,'__init__.py')); m = not ie and sys.modules.setdefault('zope',types.ModuleType('zope')); mp = (m or []) and m.__dict__.setdefault('__path__',[]); (p not in mp) and mp.append(p) It should be easy enough to teach modulegraph about this and insert and empty __init__.py file insite the zip file in the app bundle. Increasinly-hating-setuptools[*], Ronald -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 3567 bytes Desc: not available URL: From hsoft at hardcoded.net Fri Jul 30 11:42:09 2010 From: hsoft at hardcoded.net (Virgil Dupras) Date: Fri, 30 Jul 2010 11:42:09 +0200 Subject: [Pythonmac-SIG] [Pyobjc-dev] ANN: py2app 0.5 In-Reply-To: <2E51FD64-BD00-4BD6-BCA8-89E48A672FA7@mac.com> References: <2E51FD64-BD00-4BD6-BCA8-89E48A672FA7@mac.com> Message-ID: On Tue, Jul 27, 2010 at 9:13 PM, Ronald Oussoren wrote: > Hi, > > I've just uploaded py2app 0.5 and new versions of altgraph, modulegraph and macholib. I hope this solves most issues with py2app. ? "easy_install-X.Y -U py2app" should install the software for you (where X.Y is your favorite version of Python) > > There is one new feature in this release: experimental support for python 3. ? This basicly means that I managed to build a single application as a standalone application bundle, without much testing. ? Alias builds and plugin bundles almost certainly don't work (the first because alias builds use the Carbon module which isn't available in python 3, the latter because I had to rewrite the C code in the application bundles and probably have to do the same for plugin bundles). > > Ronald > ------------------------------------------------------------------------------ > The Palm PDK Hot Apps Program offers developers who use the > Plug-In Development Kit to bring their C/C++ apps to Palm for a share > of $1 Million in cash or HP Products. Visit us here for more details: > http://ad.doubleclick.net/clk;226879339;13503038;l? > http://clk.atdmt.com/CRS/go/247765532/direct/01/ > _______________________________________________ > Pyobjc-dev mailing list > Pyobjc-dev at lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/pyobjc-dev > > Thanks a bunch Ronald, your work is very very much appreciated. I tried to build my app on a whole spanking new stack (Python 2.7, pyobjc 2.3 and py2app 0.5.2) and it worked (I use the plugin feature). I had, however, to erase the prebuilt files and re-build them. This brings a question: I noticed that you added several new prebuilt for each architecture combination. I ask: why using prebuilt at all? Why not simply have the setup build the thing on the user machine upon install? This way the user gets binaries that exactly correspond to the cflags he used when building python. Are there cases where a py2app user would want any other cflags? I only recently discovered the pythonmac-sig and I saw your call for help. It's sad that nobody answered yet, but I can't say I'm surprised. Like I told you at EuroPython, I'd like to help but I have a very hard time understanding py2app's convoluted code base (distutils is probably to blame for that, god I hate distutils/setuptools). I guess it's the same thing for other users. I also had an interesting discussion with Alex Morega. He was asking me why I used py2app at all. He gave me a link (http://github.com/alex-morega/tinymail and http://github.com/alex-morega/WhizbangPlugin ) to his Python/Cocoa apps which don't use any packaging. It turns out the reason he can get away without py2app or bundlebuilder is because he uses the system Python and doesn't have other dependencies, but it still raises questions: Is it possible that py2app is a little too complex for what it does? I was thinking maybe it would be a good idea to go toward code simplification in py2app and that a good way to start would be to get rid of distutils. In any case, if nobody's on it, I'd gladly take care of the documentation modernization. Virgil Dupras From ronaldoussoren at mac.com Fri Jul 30 13:21:42 2010 From: ronaldoussoren at mac.com (Ronald Oussoren) Date: Fri, 30 Jul 2010 04:21:42 -0700 (PDT) Subject: [Pythonmac-SIG] [Pyobjc-dev] ANN: py2app 0.5 In-Reply-To: Message-ID: <4e0fb688-14d2-e9bf-8db7-bdbf856b2b25@me.com> On 30 Jul, 2010,at 11:42 AM, Virgil Dupras wrote: Thanks a bunch Ronald, your work is very very much appreciated I tried to build my app on a whole spanking new stack (Python 2.7, pyobjc 2.3 and py2app 0.5.2) and it worked (I use the plugin feature). I had, however, to erase the prebuilt files and re-build them. ? That's odd, the prebuilt binaries should just work. This brings a question: I noticed that you added several new prebuilt for each architecture combination. I ask: why using prebuilt at all? ? Because that allows you to built python apps on systems without Xcode. Why not simply have the setup build the thing on the user machine upon install? This way the user gets binaries that exactly correspond to the cflags he used when building python. Are there cases where a py2app user would want any other cflags? I only recently discovered the pythonmac-sig and I saw your call for help. It's sad that nobody answered yet, but I can't say I'm surprised. Like I told you at EuroPython, I'd like to help but I have a very hard time understanding py2app's convoluted code base (distutils is probably to blame for that, god I hate distutils/setuptools). I guess it's the same thing for other users. ? py2app isn't that hard to understand, it is a fairly basic distutils extension. ?The code base could use some cleanup and documentation though, it should be possible to simplify the code base without losing features. I'm also not surprised that almost nobody reacted to my call for help, that's just how opensource works. ?That means that the projects where I work on move forward very slowly because there is only one developer that has little time. Folks, please don't forget that I do almost all my python work in my private time and don't get paid for doing it. ?This includes py2app, pyobjc and also the Mac port of Python itself. ?I'd love to spend more time on these projects, but that's not going happen without some kind of financial support. I have a donations link on the pyobjc website, but I don't know why I bothered adding it. I also had an interesting discussion with Alex Morega. He was asking me why I used py2app at all. He gave me a link (http://github.com/alex-morega/tinymail and http://github.com/alex-morega/WhizbangPlugin ) to his Python/Cocoa apps which don't use any packaging. It turns out the reason he can get away without py2app or bundlebuilder is because he uses the system Python and doesn't have other dependencies, but it still raises questions: Is it possible that py2app is a little too complex for what it does? ? IMO py2app doesn't do enough yet. ?In Alex' use-case py2app is overkill because the application cooperates, that's not the case for most other applications (let alone system components like System Preferences). ?py2app is also needed when building application bundles. Py2app needs to be somewhat complex to centralize the knowlegde needed for building applications, that way the users of py2app don't have to worry about the right directory structure, packaging the right files, etc, etc. ? ? Py2app should also learn how to package apps that use setuptools/pkg_resources features like entry points, that way even more applications can be supported without hacks. I was thinking maybe it would be a good idea to go toward code simplification in py2app and that a good way to start would be to get rid of distutils. ? I don't think that would buy us much, although I'll probably try to split py2app into a generic library and the distutils plugin. That's mostly because I want to have a "py2app_standalone" script that can be used in Xcode templates. Ronald -------------- next part -------------- An HTML attachment was scrubbed... URL: From muthonimasinde at gmail.com Fri Jul 30 16:23:55 2010 From: muthonimasinde at gmail.com (Muthoni Masinde) Date: Fri, 30 Jul 2010 17:23:55 +0300 Subject: [Pythonmac-SIG] Installing Mysqldb Module on Python 2.5.1 on Mac OS X 10.5.8 Message-ID: Hello everyone, I am a new entrant to Python (but not new in programming). I am trying to install the mysqldb module on my Mac OS in vain. I have tried all the instructions in the README. I keep getting the following error setup_posix.py", line 32, in get_config metadata, options = get_metadata_and_options() File "/Users/Muthoni/phd2010/Thesis/software/Python/MySQL-python-1.2.3/setup_common.py", line 7, in get_metadata_and_options metadata = dict(config.items('metadata')) File "/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/ConfigParser.py", line 544, in items ConfigParser.NoSectionError: No section: 'metadata' Someone please help. Thank you very much, Muthoni -------------- next part -------------- An HTML attachment was scrubbed... URL: From kw at codebykevin.com Fri Jul 30 15:58:30 2010 From: kw at codebykevin.com (Kevin Walzer) Date: Fri, 30 Jul 2010 09:58:30 -0400 Subject: [Pythonmac-SIG] [Pyobjc-dev] ANN: py2app 0.5 In-Reply-To: <4e0fb688-14d2-e9bf-8db7-bdbf856b2b25@me.com> References: <4e0fb688-14d2-e9bf-8db7-bdbf856b2b25@me.com> Message-ID: <4C52DA86.1090500@codebykevin.com> On 7/30/10 7:21 AM, Ronald Oussoren wrote: > > I'm also not surprised that almost nobody reacted to my call for help, > that's just how opensource works. That means that the projects where I > work on move forward very slowly because there is only one developer > that has little time. > > Folks, please don't forget that I do almost all my python work in my > private time and don't get paid for doing it. This includes py2app, > pyobjc and also the Mac port of Python itself. I'd love to spend more > time on these projects, but that's not going happen without some kind of > financial support. I have a donations link on the pyobjc website, but I > don't know why I bothered adding it. Ronald, I think I speak for everyone on the list when I say we appreciate the work you do. The work you do as Python maintainer is invaluable. Unfortunately, the amount of time I spend on Tk development makes it hard for me to find time to contribute to MacPython development, unless I'm scratching my own itch. Toward that end, I probably will set up a bundlebuilder project at PyPi once I move to Python 3 (I have found I prefer bundlebuilder's simplicity to py2app). As you know, I've also filed patches on IDLE to make it lay nicer on Tk-Cocoa. Again, thanks for the work you do. Thanks also to Ned Deilly for his contributions, bug reports, patches, etc. --Kevin -- Kevin Walzer Code by Kevin http://www.codebykevin.com From rowen at uw.edu Fri Jul 30 18:24:59 2010 From: rowen at uw.edu (Russell Owen) Date: Fri, 30 Jul 2010 09:24:59 -0700 Subject: [Pythonmac-SIG] py2app not happy with zope.interface In-Reply-To: References: <793A2D4F-E7F2-4285-9D8E-6C75882511F7@mac.com> Message-ID: <3A05A3ED-FBE0-4F66-955B-77FE75828EF0@uw.edu> Fixing py2app would be great, but perhaps it would suffice to document the problem and let the user of py2app to fix the bizarre install left by pip. I'll file some kind of "complaint" against pip -- though I would not be at all surprised if this was a side effect of setuptools; easy_install has an obsession with .pth files. I hope all this becomes a lot easier once the package metadata PEPs are implemented. -- Russell On Jul 29, 2010, at 11:06 PM, Ronald Oussoren wrote: > > On 22 Jul, 2010, at 19:06, Russell E. Owen wrote: >>>> >>> >>> How did you install zope.interface? Basically which easy_install >>> or pip >>> command-line did you use to install? >> >> I used "pip install zope.interface". > > > When you use "pip install" to install packages namespace packages > get installed in an odd way: the __init__.py file in the namespace > package is not installed, and pth file is installed to fakes having > a real package, for zope.interface the following > tet installed: > > * zope > * zope.interface-3.6.1-py2.7-nspkg.pth > * zope.interface-3.6.1-py2.7.egg-info > > The nspkg.pth file is very ugly: > > import sys,types,os; p = > os.path.join(sys._getframe(1).f_locals['sitedir'], *('zope',)); ie = > os.path.exists(os.path.join(p,'__init__.py')); m = not ie and > sys.modules.setdefault('zope',types.ModuleType('zope')); mp = (m or > []) and m.__dict__.setdefault('__path__',[]); (p not in mp) and > mp.append(p) > > It should be easy enough to teach modulegraph about this and insert > and empty __init__.py file insite the zip file in the app bundle. > > Increasinly-hating-setuptools[*], > > Ronald From dan.odonovan+nabble at gmail.com Thu Jul 29 13:22:23 2010 From: dan.odonovan+nabble at gmail.com (danodonovan) Date: Thu, 29 Jul 2010 04:22:23 -0700 (PDT) Subject: [Pythonmac-SIG] py2app x86_64 patch and question Message-ID: <29295418.post@talk.nabble.com> Hi Ronald, I hope the Euro Python conference went well. I think py2app is a great idea, thanks for your hard work. I've been using py2app 0.5.2 (from SVN) to build a non-native X11 python app. I tweaked setup.py in testing/apptemplate to include: { 'name': 'main-x86_64', 'target': '10.5', 'cflags': '-isysroot /Developer/SDKs/MacOSX10.5.sdk -arch x86_64', 'cc': 'gcc-4.2', }, as my non-native X11 python isn't fat (or intel etc). Distutils builds everything in build/bdist.macosx-10.6-x86_64 (and so I needed a main-x86_64 prebuilt exe) This works fine for me (and I imagine could be done for main-i386 as someone else mentioned). But leads to my question: For whatever reason, py2app or distutils isn't including my C .so files in the dist/app - could this be because they reside in build/bdist.macosx-10.6-x86_64 rather than build/bdist.macosx-10.6-intel etc. as would be expected in a native build? Is there any way to force py2app to include the binaries from here? (or is this a distutils issue?) Thanks for your help, Dan -- View this message in context: http://old.nabble.com/py2app-x86_64-patch-and-question-tp29295418p29295418.html Sent from the Python - pythonmac-sig mailing list archive at Nabble.com. From ronaldoussoren at mac.com Sat Jul 31 09:14:45 2010 From: ronaldoussoren at mac.com (Ronald Oussoren) Date: Sat, 31 Jul 2010 09:14:45 +0200 Subject: [Pythonmac-SIG] py2app not happy with zope.interface In-Reply-To: <3A05A3ED-FBE0-4F66-955B-77FE75828EF0@uw.edu> References: <793A2D4F-E7F2-4285-9D8E-6C75882511F7@mac.com> <3A05A3ED-FBE0-4F66-955B-77FE75828EF0@uw.edu> Message-ID: On 30 Jul, 2010, at 18:24, Russell Owen wrote: > Fixing py2app would be great, but perhaps it would suffice to document the problem and let the user of py2app to fix the bizarre install left by pip. As pip is a fairly popular tools fixing the the issue in py2app would be better. > > I'll file some kind of "complaint" against pip -- though I would not be at all surprised if this was a side effect of setuptools; easy_install has an obsession with .pth files. I'm almost certain this is the "--single-version-externally-managed " option of setuptools. This is meant to be used with tools that don't want .egg directories/files and cannot deal with two packages that install the same files, such as the linux packaging tools. > I hope all this becomes a lot easier once the package metadata PEPs are implemented. The metadata PEP has explicit support for having two packages that install exactly the same copy of a file, too bad pip doesn't use it (and that support for it wasn't added in python 2.7's distutils, IMO Tarek was too conservative there). Ronald > > -- Russell > > On Jul 29, 2010, at 11:06 PM, Ronald Oussoren wrote: > >> >> On 22 Jul, 2010, at 19:06, Russell E. Owen wrote: >>>>> >>>> >>>> How did you install zope.interface? Basically which easy_install or pip >>>> command-line did you use to install? >>> >>> I used "pip install zope.interface". >> >> >> When you use "pip install" to install packages namespace packages get installed in an odd way: the __init__.py file in the namespace package is not installed, and pth file is installed to fakes having a real package, for zope.interface the following >> tet installed: >> >> * zope >> * zope.interface-3.6.1-py2.7-nspkg.pth >> * zope.interface-3.6.1-py2.7.egg-info >> >> The nspkg.pth file is very ugly: >> >> import sys,types,os; p = os.path.join(sys._getframe(1).f_locals['sitedir'], *('zope',)); ie = os.path.exists(os.path.join(p,'__init__.py')); m = not ie and sys.modules.setdefault('zope',types.ModuleType('zope')); mp = (m or []) and m.__dict__.setdefault('__path__',[]); (p not in mp) and mp.append(p) >> >> It should be easy enough to teach modulegraph about this and insert and empty __init__.py file insite the zip file in the app bundle. >> >> Increasinly-hating-setuptools[*], >> >> Ronald > -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 3567 bytes Desc: not available URL: From ronaldoussoren at mac.com Sat Jul 31 10:26:15 2010 From: ronaldoussoren at mac.com (Ronald Oussoren) Date: Sat, 31 Jul 2010 10:26:15 +0200 Subject: [Pythonmac-SIG] [Pyobjc-dev] Py2app too complex? In-Reply-To: <4C5377B8.2080105@canterbury.ac.nz> References: <2E51FD64-BD00-4BD6-BCA8-89E48A672FA7@mac.com> <4C5377B8.2080105@canterbury.ac.nz> Message-ID: <6C56C7A5-891E-4A32-B9C2-27A459D03969@mac.com> On 31 Jul, 2010, at 3:09, Greg Ewing wrote: > Virgil Dupras wrote: >> Is it possible that py2app is a little too complex for what >> it does? > > I think a lot of the complexity of py2app and py2exe come > from trying to automatically figure out what modules and > libraries need to be included. I object to calling py2app complex, the code base is fairly easy to understand. Have you even looked at the code base? > > I've been thinking for a while about creating something > simpler that doesn't attempt any automatic module discovery > at all. You would be required to construct a project file > that explicitly lists all the required modules and libraries, > including standard library modules. That is not simpler, it just shifts the complexity to the user. It is better to shift the complexity away from the user, that way the user does not have to reinvent the weel. Ronald -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 3567 bytes Desc: not available URL: From hsoft at hardcoded.net Sat Jul 31 10:56:47 2010 From: hsoft at hardcoded.net (Virgil Dupras) Date: Sat, 31 Jul 2010 10:56:47 +0200 Subject: [Pythonmac-SIG] [Pyobjc-dev] Py2app too complex? In-Reply-To: <6C56C7A5-891E-4A32-B9C2-27A459D03969@mac.com> References: <2E51FD64-BD00-4BD6-BCA8-89E48A672FA7@mac.com> <4C5377B8.2080105@canterbury.ac.nz> <6C56C7A5-891E-4A32-B9C2-27A459D03969@mac.com> Message-ID: On Sat, Jul 31, 2010 at 10:26 AM, Ronald Oussoren wrote: > > On 31 Jul, 2010, at 3:09, Greg Ewing wrote: > >> Virgil Dupras wrote: >>> Is it possible that py2app is a little too complex for what >>> it does? >> >> I think a lot of the complexity of py2app and py2exe come >> from trying to automatically figure out what modules and >> libraries need to be included. > > I object to calling py2app complex, the code base is fairly easy to understand. ? Have you even looked at the code base? > >> >> I've been thinking for a while about creating something >> simpler that doesn't attempt any automatic module discovery >> at all. You would be required to construct a project file >> that explicitly lists all the required modules and libraries, >> including standard library modules. > > That is not simpler, it just shifts the complexity to the user. It is better to shift the complexity away from the user, that way the user does not have to reinvent the weel. > > Ronald > ------------------------------------------------------------------------------ > The Palm PDK Hot Apps Program offers developers who use the > Plug-In Development Kit to bring their C/C++ apps to Palm for a share > of $1 Million in cash or HP Products. Visit us here for more details: > http://p.sf.net/sfu/dev2dev-palm > _______________________________________________ > Pyobjc-dev mailing list > Pyobjc-dev at lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/pyobjc-dev > > I'm not sure I agree that no dependency finding would be a good thing. Importing a stdlib modules often imports tons of other ones you don't know about and manually figuring these dependencies out can be really tedious. However, I think that using modulegraph instead of the built-in modulefinder is a mistake. For one thing, modulegraph doesn't support relative imports, yet. Yeah, we could work on it, but why bother when modulefinder already does it? It's just more maintenance. I know modulegraph is supposed to be better, but I would *gladly* list my non-stdlib dependencies manually rather than pray that py2app finds them correctly. The way I work with py2app now is that whenever a dependency isn't found by py2app, I put an explicit import of it in my "main py file" in a section documented for being py2app workaround imports. It works, but I'm sure there's a more elegant way... I think distutils is supposed to let you list dependencies manually in the setup() call, but when I tried it I found it extremely non-working, at all. So yes, a reliable way to manually list dependencies would be a great thing. Virgil Dupras From lemoine.nathan at gmail.com Sat Jul 31 23:02:41 2010 From: lemoine.nathan at gmail.com (Nathan Lemoine) Date: Sat, 31 Jul 2010 17:02:41 -0400 Subject: [Pythonmac-SIG] py2app error In-Reply-To: References: <4DD5585D-1E8F-4D26-955A-43BCF01F50FF@gmail.com> <53F2A68A-9415-474D-88EB-78A2F3E986A2@mac.com> <32CA16F6-27E7-45A8-9808-C58688D96A85@gmail.com> Message-ID: Running the testing application in the command line did confirm that the pyglet module isn't being found: File "/Users/Nate/dist/tester.app/Contents/Resources/__boot__.py", line 160, in _run execfile(path, globals(), globals()) File "/Users/Nate/Desktop/tester.py", line 1, in import pyglet ImportError: No module named pyglet Is there a way to manually add the path for pyglet to py2app's search or in the setup.py file to force the module to be loaded? On Jul 30, 2010, at 1:54 AM, Ronald Oussoren wrote: > > On 30 Jul, 2010, at 2:59, Nathan Lemoine wrote: > >> I installed the 0.5.2 update, and I've tried making just a very >> simple pyglet app to play a movie file so that you all could try it >> if you want on your python distributions: >> >> import pyglet >> >> vidPath="video.avi" ##put the path to a video file here >> window = pyglet.window.Window() >> source = pyglet.media.StreamingSource() >> MediaLoad = pyglet.media.load(vidPath) >> player = pyglet.media.Player() >> player.queue(MediaLoad) >> player.play() >> >> @window.event >> def on_draw(): >> player.get_texture().blit(0,0) >> >> pyglet.app.run() > > Thanks for the demo, that will definitly help in reproducing and > fixing the problem. > >> >> Executing python setup.py py2app still gives me the same error: >> >> Traceback (most recent call last): >> File "/Library/Python/2.5/site-packages/py2app-0.5.2-py2.5.egg/ >> py2app/build_app.py", line 604, in _run >> self.run_normal() >> File "/Library/Python/2.5/site-packages/py2app-0.5.2-py2.5.egg/ >> py2app/build_app.py", line 675, in run_normal >> self.create_binaries(py_files, pkgdirs, extensions, loader_files) >> File "/Library/Python/2.5/site-packages/py2app-0.5.2-py2.5.egg/ >> py2app/build_app.py", line 739, in create_binaries >> dry_run=self.dry_run) >> File "/Library/Python/2.5/site-packages/py2app-0.5.2-py2.5.egg/ >> py2app/util.py", line 376, in byte_compile >> if force or newer(mod.filename, cfile): >> File "/Library/Python/2.5/site-packages/py2app-0.5.2-py2.5.egg/ >> py2app/util.py", line 172, in newer >> msource = get_mtime(source) >> File "/Library/Python/2.5/site-packages/py2app-0.5.2-py2.5.egg/ >> py2app/util.py", line 164, in get_mtime >> info = zf.getinfo(rest) >> File "/System/Library/Frameworks/Python.framework/Versions/2.5/lib/ >> python2.5/zipfile.py", line 462, in getinfo >> return self.NameToInfo[name] >> KeyError: 'pyglet/__init__.pyc' >>> /System/Library/Frameworks/Python.framework/Versions/2.5/lib/ >>> python2.5/zipfile.py(462)getinfo() >> -> return self.NameToInfo[name] >> (Pdb) >> >> I ran it in alias mode as well and it bundled 'tester.app' >> successfully. When I attempted to run the bundle, I just got a >> dialog box that said 'tester Error' and brought me to the MacPython >> website. I'm not sure how to find out what the issue is with the >> aliased bundle. > > You can run the app from the command-line: test.app/Contents/MacOS/ > tester > > When you do that you'll get error messages in your terminal window, > and those should explain what's going on. I expect that pyglet > cannot be found. > >> >> Thanks for the help so far! I really appreciate it. I don't think I >> could figure this out on my own > > I haven't had time to look into this issue specifically, I'll do so > in the near future. > > Ronald > > >> >> >> >> On Jul 29, 2010, at 2:34 AM, Ronald Oussoren wrote: >> >>> >>> On 29 Jul, 2010, at 8:09, Ronald Oussoren wrote: >>> >>>> >>>> On 28 Jul, 2010, at 18:38, Nathan Lemoine wrote: >>>> >>>>> >>>>> Traceback (most recent call last): >>>>> File "/Library/Python/2.5/site-packages/py2app-0.5-py2.5.egg/ >>>>> py2app/build_app.py", line 602, in _run >>>>> self.run_alias() >>>>> File "/Library/Python/2.5/site-packages/py2app-0.5-py2.5.egg/ >>>>> py2app/build_app.py", line 548, in run_alias >>>>> dst = self.build_alias_executable(target, target.script) >>>>> File "/Library/Python/2.5/site-packages/py2app-0.5-py2.5.egg/ >>>>> py2app/build_app.py", line 1145, in build_alias_executable >>>>> appdir, resdir, plist = self.create_bundle(target, script) >>>>> File "/Library/Python/2.5/site-packages/py2app-0.5-py2.5.egg/ >>>>> py2app/build_app.py", line 1131, in create_bundle >>>>> use_runtime_preference=use_runtime_preference >>>>> File "/Library/Python/2.5/site-packages/py2app-0.5-py2.5.egg/ >>>>> py2app/build_app.py", line 1120, in create_appbundle >>>>> extension=self.extension, >>>>> File "/Library/Python/2.5/site-packages/py2app-0.5-py2.5.egg/ >>>>> py2app/create_appbundle.py", line 34, in create_appbundle >>>>> copy(srcmain, destmain) >>>>> File "/Library/Python/2.5/site-packages/py2app-0.5-py2.5.egg/ >>>>> py2app/util.py", line 233, in mergecopy >>>>> return macholib.util.mergecopy(src, dest) >>>>> File "build/bdist.macosx-10.5-i386/egg/macholib/util.py", line >>>>> 111, in mergecopy >>>>> copy2(src, dest) >>>>> File "build/bdist.macosx-10.5-i386/egg/macholib/util.py", line >>>>> 43, in copy2 >>>>> shutil.copy2(fsencoding(src), fsencoding(dst)) >>>>> File "/System/Library/Frameworks/Python.framework/Versions/2.5/ >>>>> lib/python2.5/shutil.py", line 91, in copy2 >>>>> copyfile(src, dst) >>>>> File "/System/Library/Frameworks/Python.framework/Versions/2.5/ >>>>> lib/python2.5/shutil.py", line 46, in copyfile >>>>> fsrc = open(src, 'rb') >>>>> IOError: [Errno 2] No such file or directory: '/Library/Python/ >>>>> 2.5/site-packages/py2app-0.5-py2.5.egg/py2app/apptemplate/ >>>>> prebuilt/main-i386' >>>>>> /System/Library/Frameworks/Python.framework/Versions/2.5/lib/ >>>>>> python2.5/shutil.py(53)copyfile() >>>>> -> fsrc.close() >>>>> >>>>> I went into the Python Framework folder and the only prebuilt >>>>> executeable in there is 32bit one, there isn't a main-i386 file. >>>>> Am I missing a file? >>>> >>>> You aren't missing a file, py2app doesn't have a main-i386 file. >>>> As a quick workaround you can copy /Library/Python/2.5/site- >>>> packages/py2app-0.5-py2.5.egg/py2app/apptemplate/prebuilt/main- >>>> fat to /Library/Python/2.5/site-packages/py2app-0.5-py2.5.egg/ >>>> py2app/apptemplate/prebuilt/main-i386. >>>> >>>> I will tweak py2app to better handle this, that will be in the >>>> next release (0.5.2, hopefully later this week). >>> >>> I've upload py2app 0.5.2. With this version I can build a pyobjc >>> application using python 2.5 (without the IOError exception), the >>> pyglet error is not yet fixed. >>> >>> Ronald >>> >> > From greg.ewing at canterbury.ac.nz Sat Jul 31 03:09:12 2010 From: greg.ewing at canterbury.ac.nz (Greg Ewing) Date: Sat, 31 Jul 2010 13:09:12 +1200 Subject: [Pythonmac-SIG] Py2app too complex? In-Reply-To: References: <2E51FD64-BD00-4BD6-BCA8-89E48A672FA7@mac.com> Message-ID: <4C5377B8.2080105@canterbury.ac.nz> Virgil Dupras wrote: > Is it possible that py2app is a little too complex for what > it does? I think a lot of the complexity of py2app and py2exe come from trying to automatically figure out what modules and libraries need to be included. I've been thinking for a while about creating something simpler that doesn't attempt any automatic module discovery at all. You would be required to construct a project file that explicitly lists all the required modules and libraries, including standard library modules. This may sound onerous, but I don't think it would be if you did it as part of the process of developing the code. There would be a testing mode which would run the application in an isolated environment using the current project settings. If you did all your development that way, you would immediately discover when something was missing and needed to be added to the project. Furthermore, you would be assured that if it works during testing, it will also work when bundled -- something that currently requires a separate testing step when using py2app or py2exe, because you can never trust them to find all the dependencies correctly. Does anyone else think such a tool would be useful? -- Greg