From callmerob at gmail.com Tue Mar 1 19:31:07 2011 From: callmerob at gmail.com (Rob Leachman) Date: Tue, 1 Mar 2011 10:31:07 -0800 Subject: [Pythonmac-SIG] [SOLVED] How to exclude py2app Pygame icon Message-ID: As often happens, forming confusion into an intelligible question yields the solution. I'll share my finding and would appreciate any feedback. This hack seems a lot of bother but any other fix evades. The issue was stated nicely some time ago, see http://www.mail-archive.com/pythonmac-sig at python.org/msg08548.html as desired. The follow-up reply (add --resources AppIcon.png) doesn't seem to help. Looks like this list has a tradition of revisiting this topic on an annual basis (ha) and I didn't see another answer. My question was the same as OP, how to recreate the .zip after hacking on it, today the attached seems to do the trick and at the expense of just a bit more work producing the .app: Recreate the problem: hg clone https://RobertLeachman at bitbucket.org/RobertLeachman/pythentene hg clone https://RobertLeachman@ bitbucket.org/RobertLeachman/pythenteneassets cp pythenteneassets/stuff/setup_mac.py pythentene cp pythenteneassets/stuff/gameIcon.icns pythentene/stuff cd pythentene python setup_mac.py py2app Works fine, produces dist/Pythentene.app but has the issue at hand: the Pygame icon flashes on the dock as the game starts. cd dist/Pythentene.app/Contents/Resources/lib/python2.6 mkdir x; cd x; unzip ../site-packages.zip; cd pygame rm pygame_icon* cp ../../../../../../../../stuff/gameIcon.icns pygame_icon.icns cd .. zip -r9 site-packages-new.zip * cd .. mv x/site-packages-new.zip site-packages.zip rm -rf x Success, no more pygame icon but instead a nice stable experience for the user. I'm sincere about wanting to talk about the subject line, but also can't resist... this is all go-forward from the 0.1a release of http://www.bitblaster.com/pythentene/ and I'm hungry for help or feedback. Let me know if you are interested in some open-source programming work, or just play this classic game and complete the survey if you will. Thanks! -------------- next part -------------- An HTML attachment was scrubbed... URL: From brendan.simon at etrix.com.au Tue Mar 1 22:34:04 2011 From: brendan.simon at etrix.com.au (Brendan Simon (eTRIX)) Date: Wed, 02 Mar 2011 08:34:04 +1100 Subject: [Pythonmac-SIG] C++ ABI 1002/102 incompatibility with wxPython on OS X In-Reply-To: <4D512F22.6090701@etrix.com.au> References: <4D3E95F8.5000101@etrix.com.au> <4D3F0301.3030209@noaa.gov> <4D4E6E39.70808@etrix.com.au> <4D512F22.6090701@etrix.com.au> Message-ID: <4D6D664C.2000004@etrix.com.au> On 8/02/11 10:55 PM, Brendan Simon (eTRIX) wrote: > On 1/25/11 1:20 AM, Brendan Simon (eTRIX) wrote: >>>> I have a wxPython app that is built with py2app. A user recently >>>> reported the following error when trying to run the app. >>>> >>>> Fatal Error: Mismatch between the program and library build versions >>>> detected. >>>> The library used 2.8 (no debug,Unicode,compiler with C++ ABI 1002,wx >>>> containers,compatible with 2.6), >>>> and your program used 2.8 (no debug,Unicode,compiler with C++ ABI >>>> 102,wx containers,compatible with 2.6). >>>> Abort trap >>>> logout >> As others have informed me, the C++ ABI changed from gcc-3.3 to gcc-3.4 >> (and beyond). >> It turns out that previous builds of my application DO work on PowerPC OS X 10.4, it's only recent builds that fail with the ABI compatibility error. The app bundle is built with python.org 2.5.4 using pythonw (/Library/Frameworks/Python.framework/Versions/2.5/bin/pythonw). It contains a libwx_macud-2.8.0.dylib file which I think is the culprit. I interrogated this file (strings and grep) and noted an ABI difference. An app that works on PowerPC and Intel 10.4.11. $ cat ./MyApp.app/Contents/Frameworks/libwx_macud-2.8.0.dylib | strings | grep ABI 2.8 (debug,Unicode,compiler with C++ ABI 102,wx containers,compatible with 2.6) 2.8 (debug,Unicode,compiler with C++ ABI 1002,wx containers,compatible with 2.6) An app that does NOT work on PowerPC 10.4.11 but does work on Intel 10.4.11. $ cat ./MyApp.app/Contents/Frameworks/libwx_macud-2.8.0.dylib | strings | grep ABI 2.8 (debug,Unicode,compiler with C++ ABI 1002,wx containers,compatible with 2.6) 2.8 (debug,Unicode,compiler with C++ ABI 1002,wx containers,compatible with 2.6) The latter has TWO identical lines with ABI 1002. i.e. it does NOT have the ABI 102 for some reason. A search of my filesystem reveals that none of the wx libraries appear to have ABI 102 in the wx libraries. $ find /usr -name "libwx_macud-2.8.0.dylib" -ls 141212 8 lrwxr-xr-x 1 root wheel 27 15 Aug 2009 /usr/lib/libwx_macud-2.8.0.dylib -> libwx_macud-2.8.0.5.0.dylib 227169828 8 lrwxr-xr-x 1 root wheel 27 5 Aug 2010 /usr/local/lib/wxPython-unicode-2.8.11.0/lib/libwx_macud-2.8.0.dylib -> libwx_macud-2.8.0.7.0.dylib 2411353 8 lrwxr-xr-x 1 root wheel 27 18 Jun 2008 /usr/local/lib/wxPython-unicode-2.8.4.0/lib/libwx_macud-2.8.0.dylib -> libwx_macud-2.8.0.1.1.dylib 2412261 8 lrwxr-xr-x 1 root wheel 27 18 Jun 2008 /usr/local/lib/wxPython-unicode-2.8.4.2/lib/libwx_macud-2.8.0.dylib -> libwx_macud-2.8.0.1.1.dylib $ find /usr -name "libwx_macud-2.8.0.dylib" | xargs strings | grep ABI 2.8 (debug,Unicode,compiler with C++ ABI 1002,wx containers,compatible with 2.6) 2.8 (debug,Unicode,compiler with C++ ABI 1002,wx containers,compatible with 2.6) 2.8 (debug,Unicode,compiler with C++ ABI 1002,wx containers,compatible with 2.6) 2.8 (debug,Unicode,compiler with C++ ABI 1002,wx containers,compatible with 2.6) I'm not sure what has changed to cause this. * OS X updates * Code changes that use various interpreters, specified as: python, pythonw, /Library/Frameworks/Python.framework/Versions/2.5/bin/pythonw, etc. * Installs of new pythons (e.g. python 2.7, python 3.x) * Installs of newer wxPython ?? ANSI versus Unicode versions ?? Any ideas as to why my wx library no longer has the ABI 102 compatibility ?? I'm thinking it is most likely a wxPython build or install problem. Thanks, Brendan. -------------- next part -------------- An HTML attachment was scrubbed... URL: From brendan.simon at etrix.com.au Tue Mar 1 22:42:15 2011 From: brendan.simon at etrix.com.au (Brendan Simon (eTRIX)) Date: Wed, 02 Mar 2011 08:42:15 +1100 Subject: [Pythonmac-SIG] C++ ABI 1002/102 incompatibility with wxPython on OS X In-Reply-To: <4D6D664C.2000004@etrix.com.au> References: <4D3E95F8.5000101@etrix.com.au> <4D3F0301.3030209@noaa.gov> <4D4E6E39.70808@etrix.com.au> <4D512F22.6090701@etrix.com.au> <4D6D664C.2000004@etrix.com.au> Message-ID: <4D6D6837.5020400@etrix.com.au> On 2/03/11 8:34 AM, Brendan Simon (eTRIX) wrote: > On 8/02/11 10:55 PM, Brendan Simon (eTRIX) wrote: >> On 1/25/11 1:20 AM, Brendan Simon (eTRIX) wrote: >>>>> I have a wxPython app that is built with py2app. A user recently >>>>> reported the following error when trying to run the app. >>>>> >>>>> Fatal Error: Mismatch between the program and library build versions >>>>> detected. >>>>> The library used 2.8 (no debug,Unicode,compiler with C++ ABI 1002,wx >>>>> containers,compatible with 2.6), >>>>> and your program used 2.8 (no debug,Unicode,compiler with C++ ABI >>>>> 102,wx containers,compatible with 2.6). >>>>> Abort trap >>>>> logout >>> As others have informed me, the C++ ABI changed from gcc-3.3 to gcc-3.4 >>> (and beyond). >>> > > It turns out that previous builds of my application DO work on PowerPC > OS X 10.4, it's only recent builds > that fail with the ABI compatibility error. > > The app bundle is built with python.org 2.5.4 using pythonw > (/Library/Frameworks/Python.framework/Versions/2.5/bin/pythonw). It > contains a libwx_macud-2.8.0.dylib file which I think is the culprit. > I interrogated this file (strings and grep) and noted an ABI difference. > > An app that works on PowerPC and Intel 10.4.11. > > $ cat ./MyApp.app/Contents/Frameworks/libwx_macud-2.8.0.dylib | > strings | grep ABI > 2.8 (debug,Unicode,compiler with C++ ABI 102,wx containers,compatible > with 2.6) > 2.8 (debug,Unicode,compiler with C++ ABI 1002,wx containers,compatible > with 2.6) > > An app that does NOT work on PowerPC 10.4.11 but does work on Intel > 10.4.11. > > $ cat ./MyApp.app/Contents/Frameworks/libwx_macud-2.8.0.dylib | > strings | grep ABI > 2.8 (debug,Unicode,compiler with C++ ABI 1002,wx containers,compatible > with 2.6) > 2.8 (debug,Unicode,compiler with C++ ABI 1002,wx containers,compatible > with 2.6) > > The latter has TWO identical lines with ABI 1002. i.e. it does NOT > have the ABI 102 for some reason. > > A search of my filesystem reveals that none of the wx libraries appear > to have ABI 102 in the wx libraries. > > $ find /usr -name "libwx_macud-2.8.0.dylib" -ls > 141212 8 lrwxr-xr-x 1 root wheel 27 15 Aug > 2009 /usr/lib/libwx_macud-2.8.0.dylib -> libwx_macud-2.8.0.5.0.dylib > 227169828 8 lrwxr-xr-x 1 root wheel 27 5 Aug > 2010 > /usr/local/lib/wxPython-unicode-2.8.11.0/lib/libwx_macud-2.8.0.dylib > -> libwx_macud-2.8.0.7.0.dylib > 2411353 8 lrwxr-xr-x 1 root wheel 27 18 Jun > 2008 > /usr/local/lib/wxPython-unicode-2.8.4.0/lib/libwx_macud-2.8.0.dylib -> > libwx_macud-2.8.0.1.1.dylib > 2412261 8 lrwxr-xr-x 1 root wheel 27 18 Jun > 2008 > /usr/local/lib/wxPython-unicode-2.8.4.2/lib/libwx_macud-2.8.0.dylib -> > libwx_macud-2.8.0.1.1.dylib > > $ find /usr -name "libwx_macud-2.8.0.dylib" | xargs strings | grep ABI > 2.8 (debug,Unicode,compiler with C++ ABI 1002,wx containers,compatible > with 2.6) > 2.8 (debug,Unicode,compiler with C++ ABI 1002,wx containers,compatible > with 2.6) > 2.8 (debug,Unicode,compiler with C++ ABI 1002,wx containers,compatible > with 2.6) > 2.8 (debug,Unicode,compiler with C++ ABI 1002,wx containers,compatible > with 2.6) > > I'm not sure what has changed to cause this. > > * OS X updates > * Code changes that use various interpreters, specified as: > python, pythonw, > /Library/Frameworks/Python.framework/Versions/2.5/bin/pythonw, etc. > * Installs of new pythons (e.g. python 2.7, python 3.x) > * Installs of newer wxPython ?? ANSI versus Unicode versions ?? > > > Any ideas as to why my wx library no longer has the ABI 102 > compatibility ?? > I'm thinking it is most likely a wxPython build or install problem. The other possibility is that the builds that do work may have been built on another Mac running 10.5, not my current Mac running 10.6. Will have dig up the old Mac and see if that makes a difference. -------------- next part -------------- An HTML attachment was scrubbed... URL: From Chris.Barker at noaa.gov Tue Mar 1 22:58:50 2011 From: Chris.Barker at noaa.gov (Christopher Barker) Date: Tue, 01 Mar 2011 13:58:50 -0800 Subject: [Pythonmac-SIG] C++ ABI 1002/102 incompatibility with wxPython on OS X In-Reply-To: <4D6D664C.2000004@etrix.com.au> References: <4D3E95F8.5000101@etrix.com.au> <4D3F0301.3030209@noaa.gov> <4D4E6E39.70808@etrix.com.au> <4D512F22.6090701@etrix.com.au> <4D6D664C.2000004@etrix.com.au> Message-ID: <4D6D6C1A.50704@noaa.gov> On 3/1/11 1:34 PM, Brendan Simon (eTRIX) wrote: > An app that works on PowerPC and Intel 10.4.11. > > $ cat ./MyApp.app/Contents/Frameworks/libwx_macud-2.8.0.dylib | strings > | grep ABI > 2.8 (debug,Unicode,compiler with C++ ABI 102,wx containers,compatible > with 2.6) > 2.8 (debug,Unicode,compiler with C++ ABI 1002,wx containers,compatible > with 2.6) This is presumably the PPC and Intel parts of the lib. IIRC, at one point (about two years ago), Robin did some machinations to build the PPC version of the binary with a different compiler version than the Intel version. I needed to go through the same machinations to build an extension that was linked against wxPython. I think that was required to get a build that would work on 10.3.9 PPC and recent Intel machines. Apparently, it's required for 10.4, too. I, unfortunately, don't have a 10.4 machine to test on anymore, so it' a bit hard for me to help. HOwever, looking at my ugly build script, it looks like I'm essentially doing: 1) build a regular old extension 2) using lipo to remove the PPc part 3) setting ENV varibles to use gcc3.3: # this builds the ppc version correctly export CXX="g++-3.3 -arch ppc -DMAC_OS_X_VERSION_MAX_ALLOWED=1040" export CC="gcc-3.3 -arch ppc -DMAC_OS_X_VERSION_MAX_ALLOWED=1040" export MACOSX_DEPLOYMENT_TARGET=10.3 4) pull the ppc part out of that build, and add it inot the original one. when I look at the dylib delivered with that app, I get: $ cat libwx_macud-2.8.0.dylib | strings | grep ABI 2.8 (debug,Unicode,compiler with C++ ABI 102,wx containers,compatible with 2.6) 2.8 (debug,Unicode,compiler with C++ ABI 1002,wx containers,compatible with 2.6) when I look at the one in /usr/lib, which I presume was supplied by apple, I get: 2.8 (debug,Unicode,compiler with C++ ABI 1002,wx containers,compatible with 2.6) 2.8 (debug,Unicode,compiler with C++ ABI 1002,wx containers,compatible with 2.6) (this is with OS-X 10.6). When I look at the one in : /usr/local/lib/wxPython-unicode-2.8.11.0/lib/ (which I got from a wxPython binary), I get: $ cat libwx_macud-2.8.0.dylib | strings | grep ABI 2.8 (debug,Unicode,compiler with C++ ABI 102,wx containers,compatible with 2.6) 2.8 (debug,Unicode,compiler with C++ ABI 1002,wx containers,compatible with 2.6) Which is what you want. I suspect that you're now using Apple's wx, by accident, or are you using a newer wxPython than 2.8.11 ? -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 Tue Mar 1 23:02:06 2011 From: Chris.Barker at noaa.gov (Christopher Barker) Date: Tue, 01 Mar 2011 14:02:06 -0800 Subject: [Pythonmac-SIG] C++ ABI 1002/102 incompatibility with wxPython on OS X In-Reply-To: <4D6D6C1A.50704@noaa.gov> References: <4D3E95F8.5000101@etrix.com.au> <4D3F0301.3030209@noaa.gov> <4D4E6E39.70808@etrix.com.au> <4D512F22.6090701@etrix.com.au> <4D6D664C.2000004@etrix.com.au> <4D6D6C1A.50704@noaa.gov> Message-ID: <4D6D6CDE.2070105@noaa.gov> On 3/1/11 1:58 PM, Christopher Barker wrote: > When I look at the one in : > > /usr/local/lib/wxPython-unicode-2.8.11.0/lib/ > (which I got from a wxPython binary), I get: > > $ cat libwx_macud-2.8.0.dylib | strings | grep ABI > 2.8 (debug,Unicode,compiler with C++ ABI 102,wx containers,compatible > with 2.6) > 2.8 (debug,Unicode,compiler with C++ ABI 1002,wx containers,compatible > with 2.6) One more note: I just took a look at an app bundle I recently built with wx -- it has the right ABI versions. This is with: Python 2.6.6 (from Python.org) wxPython 2.8.11.0 (from wxpython.org) So it can be done. -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 kaz at pculture.org Wed Mar 2 20:16:59 2011 From: kaz at pculture.org (Kaz Wesley) Date: Wed, 2 Mar 2011 11:16:59 -0800 Subject: [Pythonmac-SIG] missing wrapper for an NSView method? Message-ID: The Cocoa docs describe a reflectScrolledClipView: method for NSView in "OS X 10.0 and higher": http://developer.apple.com/library/mac/#documentation/Cocoa/Reference/ApplicationKit/Classes/NSView_Class/Reference/NSView.html#//apple_ref/occ/instm/NSView/reflectScrolledClipView: But when I do this: >>> from AppKit import NSView >>> NSView.reflectScrolledClipView_ I get an AttributeError. Am I overlooking something, or is this a missing-wrapper-method bug? From kaz at pculture.org Wed Mar 2 23:34:21 2011 From: kaz at pculture.org (Kaz Wesley) Date: Wed, 2 Mar 2011 14:34:21 -0800 Subject: [Pythonmac-SIG] missing wrapper for an NSView method? In-Reply-To: References: Message-ID: Don't mind me, I think I have misunderstood the structure of the Cocoa docs. On Wed, Mar 2, 2011 at 11:16, Kaz Wesley wrote: > The Cocoa docs describe a reflectScrolledClipView: method for NSView > in "OS X 10.0 and higher": > http://developer.apple.com/library/mac/#documentation/Cocoa/Reference/ApplicationKit/Classes/NSView_Class/Reference/NSView.html#//apple_ref/occ/instm/NSView/reflectScrolledClipView: > > But when I do this: >>>> from AppKit import NSView >>>> NSView.reflectScrolledClipView_ > > I get an AttributeError. Am I overlooking something, or is this a > missing-wrapper-method bug? > From kw at codebykevin.com Thu Mar 3 00:01:36 2011 From: kw at codebykevin.com (Kevin Walzer) Date: Wed, 02 Mar 2011 18:01:36 -0500 Subject: [Pythonmac-SIG] Python compatible with GC? Message-ID: <4D6ECC50.60205@codebykevin.com> I'm trying to debug a crash in a Python/Tkinter application that I am unable to reproduce using equivalent Tcl/Tk code. I have a custom Tcl/Tk extension library that implements an NSToolbar for Tk windows (using Tk-Cocoa). In testing this extension, when I call the standard Cocoa dialog to save a file, Python then crashes with a segfault. Ordinarily these kinds of issues are reproducible in Tk itself using Tcl/Tk itself, since the crash pertains to some bug in Tk. However, I am not able to reproduce this issue with Tcl/Tk, just with Python/Tkinter. This leads me to suspect the issue may lie somewhere within the interaction between Python and Tk. My build of Python is 2.7.1, built as 64/32-bit, and linked to the system Tcl/Tk Cocoa frameworks (for Mac App Store compatibility). Tcl/Tk is built with garbage-collection enabled; could this cause some issue with Python, which I believe does not support Objective-C-based GC? Here is my crashlog below. Any advice is appreciated. 0 com.apple.AppKit 0x00007fff8758d3d4 -[NSWindow setLevel:] + 132 1 com.apple.Foundation 0x00007fff814d323c __NSFireDelayedPerform + 404 2 com.apple.CoreFoundation 0x00007fff84dd9be8 __CFRunLoopRun + 6488 3 com.apple.CoreFoundation 0x00007fff84dd7dbf CFRunLoopRunSpecific + 575 4 Tcl 0x0000000102da1466 Tcl_WaitForEvent + 299 5 Tcl 0x0000000102d7028a Tcl_DoOneEvent + 261 6 _tkinter.so 0x000000010184421d Tkapp_CallDeallocArgs + 8781 7 org.python.python 0x00000001006bca8d PyEval_EvalFrameEx + 20797 8 org.python.python 0x00000001006becd6 PyEval_EvalCodeEx + 2118 9 org.python.python 0x00000001006bccb3 PyEval_EvalFrameEx + 21347 10 org.python.python 0x00000001006becd6 PyEval_EvalCodeEx + 2118 11 org.python.python 0x00000001006bedf6 PyEval_EvalCode + 54 12 org.python.python 0x00000001006e37fe PyRun_FileExFlags + 174 13 org.python.python 0x00000001006b4a9e _PyBuiltin_Init + 14894 14 org.python.python 0x00000001006bca8d PyEval_EvalFrameEx + 20797 15 org.python.python 0x00000001006becd6 PyEval_EvalCodeEx + 2118 16 org.python.python 0x00000001006bccb3 PyEval_EvalFrameEx + 21347 17 org.python.python 0x00000001006becd6 PyEval_EvalCodeEx + 2118 18 org.python.python 0x00000001006bedf6 PyEval_EvalCode + 54 19 org.python.python 0x00000001006e37fe PyRun_FileExFlags + 174 20 org.python.python 0x00000001006e3ab9 PyRun_SimpleFileExFlags + 489 21 com.codebykevin.quickwho-cbk 0x0000000100005856 start + 19074 22 com.codebykevin.quickwho-cbk 0x00000001000059c8 main + 229 23 com.codebykevin.quickwho-cbk 0x0000000100000e08 start + 52 --Kevin -- Kevin Walzer Code by Kevin http://www.codebykevin.com From ronaldoussoren at mac.com Thu Mar 3 07:51:29 2011 From: ronaldoussoren at mac.com (Ronald Oussoren) Date: Thu, 03 Mar 2011 07:51:29 +0100 Subject: [Pythonmac-SIG] Python compatible with GC? In-Reply-To: <4D6ECC50.60205@codebykevin.com> References: <4D6ECC50.60205@codebykevin.com> Message-ID: On 3 Mar, 2011, at 0:01, Kevin Walzer wrote: > I'm trying to debug a crash in a Python/Tkinter application that I am unable to reproduce using equivalent Tcl/Tk code. I have a custom Tcl/Tk extension library that implements an NSToolbar for Tk windows (using Tk-Cocoa). In testing this extension, when I call the standard Cocoa dialog to save a file, Python then crashes with a segfault. > > Ordinarily these kinds of issues are reproducible in Tk itself using Tcl/Tk itself, since the crash pertains to some bug in Tk. However, I am not able to reproduce this issue with Tcl/Tk, just with Python/Tkinter. This leads me to suspect the issue may lie somewhere within the interaction between Python and Tk. > > My build of Python is 2.7.1, built as 64/32-bit, and linked to the system Tcl/Tk Cocoa frameworks (for Mac App Store compatibility). Tcl/Tk is built with garbage-collection enabled; could this cause some issue with Python, which I believe does not support Objective-C-based GC? The python.org installer is build with GC disabled, which means GC won't be used in any extension. This could explain some crashes due to bad refcount management, that could cause dangling references when running without GC and keep them alive with GC. Simularly for Objective-C weak references. BTW. I'm -10 on building the python.org installer with GC enabled for anything but python 3.3, this would be a backward incompatible change for already released branches of Python. Furthermore I'd be surprised if PyObjC is compatible with GC, I've tried to code defensively w.r.t. GC but have never tested that PyObjC actually works with GC. Ronald > > Here is my crashlog below. Any advice is appreciated. > > > 0 com.apple.AppKit 0x00007fff8758d3d4 -[NSWindow setLevel:] + 132 > 1 com.apple.Foundation 0x00007fff814d323c __NSFireDelayedPerform + 404 > 2 com.apple.CoreFoundation 0x00007fff84dd9be8 __CFRunLoopRun + 6488 > 3 com.apple.CoreFoundation 0x00007fff84dd7dbf CFRunLoopRunSpecific + 575 > 4 Tcl 0x0000000102da1466 Tcl_WaitForEvent + 299 > 5 Tcl 0x0000000102d7028a Tcl_DoOneEvent + 261 > 6 _tkinter.so 0x000000010184421d Tkapp_CallDeallocArgs + 8781 > 7 org.python.python 0x00000001006bca8d PyEval_EvalFrameEx + 20797 > 8 org.python.python 0x00000001006becd6 PyEval_EvalCodeEx + 2118 > 9 org.python.python 0x00000001006bccb3 PyEval_EvalFrameEx + 21347 > 10 org.python.python 0x00000001006becd6 PyEval_EvalCodeEx + 2118 > 11 org.python.python 0x00000001006bedf6 PyEval_EvalCode + 54 > 12 org.python.python 0x00000001006e37fe PyRun_FileExFlags + 174 > 13 org.python.python 0x00000001006b4a9e _PyBuiltin_Init + 14894 > 14 org.python.python 0x00000001006bca8d PyEval_EvalFrameEx + 20797 > 15 org.python.python 0x00000001006becd6 PyEval_EvalCodeEx + 2118 > 16 org.python.python 0x00000001006bccb3 PyEval_EvalFrameEx + 21347 > 17 org.python.python 0x00000001006becd6 PyEval_EvalCodeEx + 2118 > 18 org.python.python 0x00000001006bedf6 PyEval_EvalCode + 54 > 19 org.python.python 0x00000001006e37fe PyRun_FileExFlags + 174 > 20 org.python.python 0x00000001006e3ab9 PyRun_SimpleFileExFlags + 489 > 21 com.codebykevin.quickwho-cbk 0x0000000100005856 start + 19074 > 22 com.codebykevin.quickwho-cbk 0x00000001000059c8 main + 229 > 23 com.codebykevin.quickwho-cbk 0x0000000100000e08 start + 52 > > --Kevin > -- > Kevin Walzer > Code by Kevin > http://www.codebykevin.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 From andre.sintzoff at gmail.com Fri Mar 4 10:56:58 2011 From: andre.sintzoff at gmail.com (=?ISO-8859-1?Q?Andr=E9_Sintzoff?=) Date: Fri, 4 Mar 2011 10:56:58 +0100 Subject: [Pythonmac-SIG] py2app and .so files Message-ID: Hello, I'm trying to create a py2app application built for TortoiseHg (https://bitbucket.org/tortoisehg/thg/wiki/Home). The goal is to provide a Mac OS X stand alone application for TortoiseHg. The application is created with: $ python setup.py py2app --use-pythonpath Unfortunately, when $ open ./dist/TortoiseHg.app/Contents/MacOS/TortoiseHg the following message is displayed ImportError: '/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/lib-dynload/mercurial/osutil.so' not found I'm wondering why the application searches modules in /System/Library/Frameworks/Python.framework and not in the bundle just created where the files are available. $ ls ./dist/TortoiseHg.app/Contents/Resources/lib/python2.5/lib-dynload/* ./dist/TortoiseHg.app/Contents/Resources/lib/python2.5/lib-dynload/PyQt4: Qsci.so QtCore.so QtGui.so ./dist/TortoiseHg.app/Contents/Resources/lib/python2.5/lib-dynload/mercurial: base85.so diffhelpers.so osutil.so bdiff.so mpatch.so parsers.so How to tell to the application to use bundled .so files? Thank you Andr? From aahz at pythoncraft.com Fri Mar 4 17:10:17 2011 From: aahz at pythoncraft.com (Aahz) Date: Fri, 4 Mar 2011 08:10:17 -0800 Subject: [Pythonmac-SIG] py2app and .so files In-Reply-To: References: Message-ID: <20110304161017.GA6732@panix.com> On Fri, Mar 04, 2011, Andr? Sintzoff wrote: > > The application is created with: > $ python setup.py py2app --use-pythonpath > > Unfortunately, when > $ open ./dist/TortoiseHg.app/Contents/MacOS/TortoiseHg > the following message is displayed > ImportError: '/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/lib-dynload/mercurial/osutil.so' > not found > > I'm wondering why the application searches modules in > /System/Library/Frameworks/Python.framework and not in the bundle just > created where the files are available. You need to download from python.org; using the built-in Python causes py2app to behave differently. -- Aahz (aahz at pythoncraft.com) <*> http://www.pythoncraft.com/ "Programming language design is not a rational science. Most reasoning about it is at best rationalization of gut feelings, and at worst plain wrong." --GvR, python-ideas, 2009-03-01 From andre.sintzoff at gmail.com Fri Mar 4 17:57:27 2011 From: andre.sintzoff at gmail.com (=?ISO-8859-1?Q?Andr=E9_Sintzoff?=) Date: Fri, 4 Mar 2011 17:57:27 +0100 Subject: [Pythonmac-SIG] py2app and .so files In-Reply-To: <20110304161017.GA6732@panix.com> References: <20110304161017.GA6732@panix.com> Message-ID: 2011/3/4 Aahz : > On Fri, Mar 04, 2011, Andr? Sintzoff wrote: >> >> The application is created with: >> $ python setup.py py2app --use-pythonpath >> >> Unfortunately, when >> $ open ./dist/TortoiseHg.app/Contents/MacOS/TortoiseHg >> the following message is displayed >> ImportError: '/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/lib-dynload/mercurial/osutil.so' >> not found >> >> I'm wondering why the application searches modules in >> /System/Library/Frameworks/Python.framework and not in the bundle just >> created where the files are available. > > You need to download from python.org; using the built-in Python causes > py2app to behave differently. I just tried to install MacPython (http://pythonmac.org/packages/py25-fat/dmg/python-2.5-macosx.dmg) according to Unfortunately, I have some issues regarding paths... I got the following import error when launching my application: ImportError: No module named PyQt4.uic.Compiler I'm afraid to have done something modifying sys.path but I don't see what. Andr? From cweisiger at msg.ucsf.edu Fri Mar 4 20:12:26 2011 From: cweisiger at msg.ucsf.edu (Chris Weisiger) Date: Fri, 4 Mar 2011 11:12:26 -0800 Subject: [Pythonmac-SIG] py2app and .so files In-Reply-To: References: <20110304161017.GA6732@panix.com> Message-ID: On Fri, Mar 4, 2011 at 8:57 AM, Andr? Sintzoff wrote: > 2011/3/4 Aahz : > > > > You need to download from python.org; using the built-in Python causes > > py2app to behave differently. > > I just tried to install MacPython > (http://pythonmac.org/packages/py25-fat/dmg/python-2.5-macosx.dmg) > according to > > Unfortunately, I have some issues regarding paths... > I got the following import error when launching my application: > ImportError: No module named PyQt4.uic.Compiler > > Library installs are version-specific, so you will have to reinstall all of the libraries that your program uses so that the python.org install can see them. -Chris -------------- next part -------------- An HTML attachment was scrubbed... URL: From nad at acm.org Fri Mar 4 20:12:29 2011 From: nad at acm.org (Ned Deily) Date: Fri, 04 Mar 2011 11:12:29 -0800 Subject: [Pythonmac-SIG] py2app and .so files References: <20110304161017.GA6732@panix.com> Message-ID: In article , Andr? Sintzoff wrote: > 2011/3/4 Aahz : > > On Fri, Mar 04, 2011, Andr? Sintzoff wrote: > >> > >> The application is created with: > >> $ python setup.py py2app --use-pythonpath > >> > >> Unfortunately, when > >> $ open ./dist/TortoiseHg.app/Contents/MacOS/TortoiseHg > >> the following message is displayed > >> ImportError: > >> '/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/lib > >> -dynload/mercurial/osutil.so' > >> not found > >> > >> I'm wondering why the application searches modules in > >> /System/Library/Frameworks/Python.framework and not in the bundle just > >> created where the files are available. > > > > You need to download from python.org; using the built-in Python causes > > py2app to behave differently. > > I just tried to install MacPython > (http://pythonmac.org/packages/py25-fat/dmg/python-2.5-macosx.dmg) Is there a reason you need to use a very out-of-date Python 2.5? More recent released installers are available here: http://python.org/download/ For maximum compatibility, stick to one of the 32-bit-only 10.3+ installers, say, for python2.7. > Unfortunately, I have some issues regarding paths... > I got the following import error when launching my application: > ImportError: No module named PyQt4.uic.Compiler > > I'm afraid to have done something modifying sys.path but I don't see what. After installing the new Python, you'll need to install a copy of easy_install for it (either setuptools or Distribute) and then re-install any other 3rd-part packages that you need, like py2app and PyQt. -- Ned Deily, nad at acm.org From andre.sintzoff at gmail.com Sat Mar 5 11:37:47 2011 From: andre.sintzoff at gmail.com (=?ISO-8859-1?Q?Andr=E9_Sintzoff?=) Date: Sat, 5 Mar 2011 11:37:47 +0100 Subject: [Pythonmac-SIG] py2app and .so files In-Reply-To: References: <20110304161017.GA6732@panix.com> Message-ID: 2011/3/4 Ned Deily : > In article > , > ?Andr? Sintzoff wrote: > >> 2011/3/4 Aahz : >> > On Fri, Mar 04, 2011, Andr? Sintzoff wrote: >> >> >> >> The application is created with: >> >> $ python setup.py py2app --use-pythonpath >> >> >> >> Unfortunately, when >> >> $ open ./dist/TortoiseHg.app/Contents/MacOS/TortoiseHg >> >> the following message is displayed >> >> ImportError: >> >> '/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/lib >> >> -dynload/mercurial/osutil.so' >> >> not found >> >> >> >> I'm wondering why the application searches modules in >> >> /System/Library/Frameworks/Python.framework and not in the bundle just >> >> created where the files are available. >> > >> > You need to download from python.org; using the built-in Python causes >> > py2app to behave differently. >> >> I just tried to install MacPython >> (http://pythonmac.org/packages/py25-fat/dmg/python-2.5-macosx.dmg) > > Is there a reason you need to use a very out-of-date Python 2.5? ? More > recent released installers are available here: > > http://python.org/download/ > > For maximum compatibility, stick to one of the 32-bit-only 10.3+ > installers, say, for python2.7. For compatibility reasons (TortoiseHg aims to run on Python 2.4 like Mercurial), I would like to remain on a old Python version to be sure the code does not use any new functionality. I never took the time to see if there is some Python static code analyzer able to ensure that a code is Python 2.4 compliant. >> Unfortunately, I have some issues regarding paths... >> I got the following import error when launching my application: >> ImportError: No module named PyQt4.uic.Compiler >> >> I'm afraid to have done something modifying sys.path but I don't see what. > > After installing the new Python, you'll need to install a copy of > easy_install for it (either setuptools or Distribute) and then > re-install any other 3rd-part packages that you need, like py2app and > PyQt. Thanks for this reminder. I forget it. Andr? From ronaldoussoren at mac.com Sun Mar 6 12:08:42 2011 From: ronaldoussoren at mac.com (Ronald Oussoren) Date: Sun, 06 Mar 2011 12:08:42 +0100 Subject: [Pythonmac-SIG] py2app and .so files In-Reply-To: <20110304161017.GA6732@panix.com> References: <20110304161017.GA6732@panix.com> Message-ID: <31BDC190-60BD-46A2-8DBB-FA206946AEC4@mac.com> On 4 Mar, 2011, at 17:10, Aahz wrote: > On Fri, Mar 04, 2011, Andr? Sintzoff wrote: >> >> The application is created with: >> $ python setup.py py2app --use-pythonpath >> >> Unfortunately, when >> $ open ./dist/TortoiseHg.app/Contents/MacOS/TortoiseHg >> the following message is displayed >> ImportError: '/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/lib-dynload/mercurial/osutil.so' >> not found >> >> I'm wondering why the application searches modules in >> /System/Library/Frameworks/Python.framework and not in the bundle just >> created where the files are available. > > You need to download from python.org; using the built-in Python causes > py2app to behave differently. To be precise: py2app won't include the base install of Python in the appliction bundle when you use Apple's build of Python. This is make sure that you don't accidently ship parts of the OS in your application bundle (Python is open source, but it is better to be safe than sorry when lawyers can get involved). What I don't understand is why it tries to load a part of mercurial from the stdlib, this definitely looks like a bug to me. I wonder how mercurial got installed. Ronald > -- > Aahz (aahz at pythoncraft.com) <*> http://www.pythoncraft.com/ > > "Programming language design is not a rational science. Most reasoning > about it is at best rationalization of gut feelings, and at worst plain > wrong." --GvR, python-ideas, 2009-03-01 > _______________________________________________ > 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 andre.sintzoff at gmail.com Sun Mar 6 13:11:21 2011 From: andre.sintzoff at gmail.com (=?ISO-8859-1?Q?Andr=E9_Sintzoff?=) Date: Sun, 6 Mar 2011 13:11:21 +0100 Subject: [Pythonmac-SIG] py2app and .so files In-Reply-To: <31BDC190-60BD-46A2-8DBB-FA206946AEC4@mac.com> References: <20110304161017.GA6732@panix.com> <31BDC190-60BD-46A2-8DBB-FA206946AEC4@mac.com> Message-ID: 2011/3/6 Ronald Oussoren : > > On 4 Mar, 2011, at 17:10, Aahz wrote: > >> On Fri, Mar 04, 2011, Andr? Sintzoff wrote: >>> >>> The application is created with: >>> $ python setup.py py2app --use-pythonpath >>> >>> Unfortunately, when >>> $ open ./dist/TortoiseHg.app/Contents/MacOS/TortoiseHg >>> the following message is displayed >>> ImportError: '/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/lib-dynload/mercurial/osutil.so' >>> not found >>> >>> I'm wondering why the application searches modules in >>> /System/Library/Frameworks/Python.framework and not in the bundle just >>> created where the files are available. >> >> You need to download from python.org; using the built-in Python causes >> py2app to behave differently. > > To be precise: py2app won't include the base install of Python in the appliction bundle when you use Apple's build of Python. This is make sure that you don't accidently ship parts of the OS in your application bundle (Python is open source, but it is better to be safe than sorry when lawyers can get involved). > > What I don't understand is why it tries to load a part of mercurial from the stdlib, this definitely looks like a bug to me. ?I wonder how mercurial got installed. >From source, using make local and make install which copies all files in /usr/local/lib/python2.5/site-packages/mercurial/ After copying dist/TortoiseHg.app/Contents/Resources/lib/python2.5/lib-dynload/mercurial/* in /System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/lib-dynload/mercurial the application fails a little bit further with: ImportError: '/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/lib-dynload/PyQt4/QtCore.so' not found So, the problem is perhaps not specific to mercurial itself. Andr? From nad at acm.org Sun Mar 6 20:41:29 2011 From: nad at acm.org (Ned Deily) Date: Sun, 06 Mar 2011 11:41:29 -0800 Subject: [Pythonmac-SIG] py2app and .so files References: <20110304161017.GA6732@panix.com> <31BDC190-60BD-46A2-8DBB-FA206946AEC4@mac.com> Message-ID: In article , Andr? Sintzoff wrote: > >From source, using make local and make install which copies all files > in /usr/local/lib/python2.5/site-packages/mercurial/ > > After copying > dist/TortoiseHg.app/Contents/Resources/lib/python2.5/lib-dynload/mercurial/* > in > /System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/lib-dyn > load/mercurial > the application fails a little bit further with: > ImportError: > '/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/lib-dy > nload/PyQt4/QtCore.so' > not found > > So, the problem is perhaps not specific to mercurial itself. You should not be copying *anything* into /System/Library/Frameworks. That's part of OS X and managed by Apple. User-installed site packages for the system Pythons are not installed there (at least on recent versions of OS X), they are installed into /Library/Python. But for your use case (i.e. to make a standalone distributable app), you don't want to have anything to do with the system Python. I'm no longer familiar with that old version of Python 2.5 (BTW, there is a newer Python 2.5.4 OS X installer still available from python.org here: http://www.python.org/download/releases/2.5.4/ ), but the normal place for it to be looking for site-packages is: /Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-pack ages -- Ned Deily, nad at acm.org From ronaldoussoren at mac.com Mon Mar 7 10:14:16 2011 From: ronaldoussoren at mac.com (Ronald Oussoren) Date: Mon, 07 Mar 2011 10:14:16 +0100 Subject: [Pythonmac-SIG] py2app and .so files In-Reply-To: References: <20110304161017.GA6732@panix.com> <31BDC190-60BD-46A2-8DBB-FA206946AEC4@mac.com> Message-ID: <44A81D49-F579-4450-BA2D-FF90836620CF@mac.com> On 6 Mar, 2011, at 13:11, Andr? Sintzoff wrote: > 2011/3/6 Ronald Oussoren : >> >> On 4 Mar, 2011, at 17:10, Aahz wrote: >> >>> On Fri, Mar 04, 2011, Andr? Sintzoff wrote: >>>> >>>> The application is created with: >>>> $ python setup.py py2app --use-pythonpath >>>> >>>> Unfortunately, when >>>> $ open ./dist/TortoiseHg.app/Contents/MacOS/TortoiseHg >>>> the following message is displayed >>>> ImportError: '/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/lib-dynload/mercurial/osutil.so' >>>> not found >>>> >>>> I'm wondering why the application searches modules in >>>> /System/Library/Frameworks/Python.framework and not in the bundle just >>>> created where the files are available. >>> >>> You need to download from python.org; using the built-in Python causes >>> py2app to behave differently. >> >> To be precise: py2app won't include the base install of Python in the appliction bundle when you use Apple's build of Python. This is make sure that you don't accidently ship parts of the OS in your application bundle (Python is open source, but it is better to be safe than sorry when lawyers can get involved). >> >> What I don't understand is why it tries to load a part of mercurial from the stdlib, this definitely looks like a bug to me. I wonder how mercurial got installed. > > From source, using make local and make install which copies all files > in /usr/local/lib/python2.5/site-packages/mercurial/ > > After copying dist/TortoiseHg.app/Contents/Resources/lib/python2.5/lib-dynload/mercurial/* > in /System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/lib-dynload/mercurial > the application fails a little bit further with: > ImportError: '/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/lib-dynload/PyQt4/QtCore.so' > not found > > So, the problem is perhaps not specific to mercurial itself. It's most likely a bug in the way py2app bootstrap codes tries to locate the directory with extensions, it finds the system one instead of the one in the application bundle. I don't have time to look into this right now, but should definitely have time at Pycon or the sprints afterwards. Ronald > > > Andr? From ronaldoussoren at mac.com Mon Mar 7 10:37:52 2011 From: ronaldoussoren at mac.com (Ronald Oussoren) Date: Mon, 07 Mar 2011 10:37:52 +0100 Subject: [Pythonmac-SIG] py2app and .so files In-Reply-To: References: <20110304161017.GA6732@panix.com> <31BDC190-60BD-46A2-8DBB-FA206946AEC4@mac.com> Message-ID: <0E506B90-BED0-49B0-A594-65087DBB8F20@mac.com> On 6 Mar, 2011, at 20:41, Ned Deily wrote: > In article > , > Andr? Sintzoff wrote: > >>> From source, using make local and make install which copies all files >> in /usr/local/lib/python2.5/site-packages/mercurial/ >> >> After copying >> dist/TortoiseHg.app/Contents/Resources/lib/python2.5/lib-dynload/mercurial/* >> in >> /System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/lib-dyn >> load/mercurial >> the application fails a little bit further with: >> ImportError: >> '/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/lib-dy >> nload/PyQt4/QtCore.so' >> not found >> >> So, the problem is perhaps not specific to mercurial itself. > > You should not be copying *anything* into /System/Library/Frameworks. > That's part of OS X and managed by Apple. User-installed site packages > for the system Pythons are not installed there (at least on recent > versions of OS X), they are installed into /Library/Python. But for > your use case (i.e. to make a standalone distributable app), you don't > want to have anything to do with the system Python. I'm no longer > familiar with that old version of Python 2.5 (BTW, there is a newer > Python 2.5.4 OS X installer still available from python.org here: > http://www.python.org/download/releases/2.5.4/ ), but the normal place > for it to be looking for site-packages is: > > /Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-pack > ages > He's just helping out in debugging why his py2app-ed application bundle doesn't work, and the py2app bootstrap code looks in the system lib-dynload directory when it shouldn't. Why it does so is unclear at the moment, I'll have to reproduce the problem (which should be easy enough) and then find a solution. BTW. Is anyone going to pycon this year? I'll be around until the end of the sprints, although I intend to do some sightseeing as well. There's two things I'd like to work on during the sprints: work my way through the open issues in python's bugtracker (and get familiar with the new mercurial workflow while I'm doing this), and work on improving the test suites for macholib, modulegraph and py2app. Ronald From hsoft at hardcoded.net Mon Mar 7 11:52:37 2011 From: hsoft at hardcoded.net (Virgil Dupras) Date: Mon, 7 Mar 2011 11:52:37 +0100 Subject: [Pythonmac-SIG] py2app and .so files In-Reply-To: <0E506B90-BED0-49B0-A594-65087DBB8F20@mac.com> References: <20110304161017.GA6732@panix.com> <31BDC190-60BD-46A2-8DBB-FA206946AEC4@mac.com> <0E506B90-BED0-49B0-A594-65087DBB8F20@mac.com> Message-ID: <04EAA8CA-2A0F-487D-9A60-291ED39775EA@hardcoded.net> On 2011-03-07, at 10:37 AM, Ronald Oussoren wrote: > > BTW. Is anyone going to pycon this year? I'll be around until the end of the sprints, although I intend to do some sightseeing as well. There's two things I'd like to work on during the sprints: work my way through the open issues in python's bugtracker (and get familiar with the new mercurial workflow while I'm doing this), and work on improving the test suites for macholib, modulegraph and py2app. > > I wish I was going, but there's no way in hell I'm stepping in a US airport. Virgil Dupras From andre.sintzoff at gmail.com Mon Mar 7 20:32:45 2011 From: andre.sintzoff at gmail.com (=?ISO-8859-1?Q?Andr=E9_Sintzoff?=) Date: Mon, 7 Mar 2011 20:32:45 +0100 Subject: [Pythonmac-SIG] py2app and .so files In-Reply-To: <0E506B90-BED0-49B0-A594-65087DBB8F20@mac.com> References: <20110304161017.GA6732@panix.com> <31BDC190-60BD-46A2-8DBB-FA206946AEC4@mac.com> <0E506B90-BED0-49B0-A594-65087DBB8F20@mac.com> Message-ID: 2011/3/7 Ronald Oussoren : > > On 6 Mar, 2011, at 20:41, Ned Deily wrote: > >> In article >> , >> Andr? Sintzoff wrote: >> >>>> From source, using make local and make install which copies all files >>> in /usr/local/lib/python2.5/site-packages/mercurial/ >>> >>> After copying >>> dist/TortoiseHg.app/Contents/Resources/lib/python2.5/lib-dynload/mercurial/* >>> in >>> /System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/lib-dyn >>> load/mercurial >>> the application fails a little bit further with: >>> ImportError: >>> '/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/lib-dy >>> nload/PyQt4/QtCore.so' >>> not found >>> >>> So, the problem is perhaps not specific to mercurial itself. >> >> You should not be copying *anything* into /System/Library/Frameworks. >> That's part of OS X and managed by Apple. ? User-installed site packages >> for the system Pythons are not installed there (at least on recent >> versions of OS X), they are installed into /Library/Python. ?But for >> your use case (i.e. to make a standalone distributable app), you don't >> want to have anything to do with the system Python. ?I'm no longer >> familiar with that old version of Python 2.5 (BTW, there is a newer >> Python 2.5.4 OS X installer still available from python.org here: >> http://www.python.org/download/releases/2.5.4/ ), but the normal place >> for it to be looking for site-packages is: >> >> /Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-pack >> ages >> > > He's just helping out in debugging why his py2app-ed application bundle doesn't work, and the py2app bootstrap code looks in the system lib-dynload directory when it shouldn't. > > Why it does so is unclear at the moment, I'll have to reproduce the problem (which should be easy enough) and then find a solution. For your information, I get similar results with py2app/examples/PyQt example. $ /Users/as/hg-repo/py2app/examples/PyQt/dist/hello.app/Contents/MacOS/hello ; exit; Traceback (most recent call last): File "/Users/as/hg-repo/py2app/examples/PyQt/dist/hello.app/Contents/Resources/__boot__.py", line 31, in _run('hello.py') File "/Users/as/hg-repo/py2app/examples/PyQt/dist/hello.app/Contents/Resources/__boot__.py", line 28, in _run execfile(path, globals(), globals()) File "/Users/as/hg-repo/py2app/examples/PyQt/dist/hello.app/Contents/Resources/hello.py", line 2, in from PyQt4 import Qt File "PyQt4/Qt.pyc", line 18, in File "PyQt4/Qt.pyc", line 15, in __load ImportError: '/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/lib-dynload/PyQt4/Qt.so' not found Andr? From ronaldoussoren at mac.com Tue Mar 8 08:49:18 2011 From: ronaldoussoren at mac.com (Ronald Oussoren) Date: Tue, 08 Mar 2011 08:49:18 +0100 Subject: [Pythonmac-SIG] py2app and .so files In-Reply-To: References: <20110304161017.GA6732@panix.com> <31BDC190-60BD-46A2-8DBB-FA206946AEC4@mac.com> <0E506B90-BED0-49B0-A594-65087DBB8F20@mac.com> Message-ID: On 7 Mar, 2011, at 20:32, Andr? Sintzoff wrote: > 2011/3/7 Ronald Oussoren : >> >> On 6 Mar, 2011, at 20:41, Ned Deily wrote: >> >>> In article >>> , >>> Andr? Sintzoff wrote: >>> >>>>> From source, using make local and make install which copies all files >>>> in /usr/local/lib/python2.5/site-packages/mercurial/ >>>> >>>> After copying >>>> dist/TortoiseHg.app/Contents/Resources/lib/python2.5/lib-dynload/mercurial/* >>>> in >>>> /System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/lib-dyn >>>> load/mercurial >>>> the application fails a little bit further with: >>>> ImportError: >>>> '/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/lib-dy >>>> nload/PyQt4/QtCore.so' >>>> not found >>>> >>>> So, the problem is perhaps not specific to mercurial itself. >>> >>> You should not be copying *anything* into /System/Library/Frameworks. >>> That's part of OS X and managed by Apple. User-installed site packages >>> for the system Pythons are not installed there (at least on recent >>> versions of OS X), they are installed into /Library/Python. But for >>> your use case (i.e. to make a standalone distributable app), you don't >>> want to have anything to do with the system Python. I'm no longer >>> familiar with that old version of Python 2.5 (BTW, there is a newer >>> Python 2.5.4 OS X installer still available from python.org here: >>> http://www.python.org/download/releases/2.5.4/ ), but the normal place >>> for it to be looking for site-packages is: >>> >>> /Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-pack >>> ages >>> >> >> He's just helping out in debugging why his py2app-ed application bundle doesn't work, and the py2app bootstrap code looks in the system lib-dynload directory when it shouldn't. >> >> Why it does so is unclear at the moment, I'll have to reproduce the problem (which should be easy enough) and then find a solution. > > For your information, I get similar results with py2app/examples/PyQt example. > > > $ /Users/as/hg-repo/py2app/examples/PyQt/dist/hello.app/Contents/MacOS/hello > ; exit; > Traceback (most recent call last): > File "/Users/as/hg-repo/py2app/examples/PyQt/dist/hello.app/Contents/Resources/__boot__.py", > line 31, in > _run('hello.py') > File "/Users/as/hg-repo/py2app/examples/PyQt/dist/hello.app/Contents/Resources/__boot__.py", > line 28, in _run > execfile(path, globals(), globals()) > File "/Users/as/hg-repo/py2app/examples/PyQt/dist/hello.app/Contents/Resources/hello.py", > line 2, in > from PyQt4 import Qt > File "PyQt4/Qt.pyc", line 18, in > File "PyQt4/Qt.pyc", line 15, in __load > ImportError: '/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/lib-dynload/PyQt4/Qt.so' > not found Great, that will make it a lot easier to find (and then fix) the problem. Ronald > > > Andr? From Chris.Barker at noaa.gov Mon Mar 7 23:18:09 2011 From: Chris.Barker at noaa.gov (Christopher Barker) Date: Mon, 07 Mar 2011 14:18:09 -0800 Subject: [Pythonmac-SIG] Scientific Software developer wanted in Seattle. Message-ID: <4D7559A1.5070704@noaa.gov> Scientific Software Developer NOAA Emergency Response Division Help us develop our next-generation oil spill transport model. Background: The Emergency Response Division (ERD) of NOAA's Office of Response and Restoration (OR&R) provides scientific expertise to support the response to oil and chemical spills in the coastal environment. We played a major role in the recent Deepwater Horizon oil spill in the Gulf of Mexico. In order to fulfill our mission, we develop many of the software tools and models required to support a response to hazardous material spills. In the wake of the Deepwater horizon incident, we are embarking on a program to develop our next-generation oil spill transport model, taking into account lessons learned from years of response and this major incident. General Characteristics: The incumbent of this position will provide software development services to support the mission of the Emergency Response Division of NOAA's Office of Response and Restoration. As part of his/her efforts, independent evaluation and application of development techniques, algorithms, software architecture, and programming patterns will be required. The incumbent will work with the staff of ERD to provide analysis on user needs and software, GUI, and library design. He/she will be expect to work primarily on site at NOAA's facility in Seattle. Knowledge: The incumbent must be able to apply modern concepts of software engineering and design to the development of computational code, desktop applications, web applications, and libraries. The incumbent will need to be able to design, write, refactor, and implement code for a complex desktop and/or web application and computational library. The incumbent will work with a multi-disciplinary team including scientists, users, and other developers, utilizing software development practices such as usability design, version control, bug and issue tracking, and unit testing. Good communication skills and the knowledge of working as part of a team are required. Direction received: The incumbent will participate on various research and development teams. While endpoints will be identified through Division management and some direct supervision will be provided, the incumbent will be responsible for progressively being able to take input from team meetings and design objectives and propose strategies for reaching endpoints. Typical duties and responsibilities: The incumbent will work with the oil and chemical spill modeling team to improve and develop new tools and models used in fate and transport forecasting. Different components of the project will be written in C++, Python, and Javascript. Education requirement, minimum: Bachelor's degree in a technical discipline. Experience requirement, minimum: One to five years experience in development of complex software systems in one or more full-featured programming languages (C, C++, Java, Python, Ruby, Fortran, etc.) The team requires experience in the following languages/disciplines. Each incumbent will need experience in some subset: * Computational/Scientific programming * Numerical Analysis/Methods * Parallel processing * Desktop GUI * Web services * Web clients: HTML/CSS/Javascript * Python * wxPython * OpenGL * C/C++ * Python--C/C++ integration * Software development team leadership While the incumbent will work on-site at NOAA, directly with the NOAA team, this is a contract position with General Dynamics Information Technology: http://www.gdit.com/default.aspx For more information and to apply, use the GDIT web site: https://secure.resumeware.net/gdns_rw/gdns_web/job_detail.cfm?key=59436&show_cart=0&referredId=20 if that long url doesn't work, try: http://www.resumeware.net/gdns_rw/gdns_web/job_search.cfm and search for job ID: 179178 NOTE: This is a potion being hired by GDIT to work with NOAA, so any questions about salary, benefits, etc, etc should go to GDIT. However, feel free to send me questions about our organization, working conditions, more detail about the nature of the projects etc. -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 fmbetancourt at gmail.com Thu Mar 10 11:59:48 2011 From: fmbetancourt at gmail.com (Felicia Betancourt) Date: Thu, 10 Mar 2011 05:59:48 -0500 Subject: [Pythonmac-SIG] Trouble Message-ID: 1299754788-28-ipw.angelogoods@boscgi0702.eigbox.net Hi, Apologies for having to reach out to you like this, but I made a quick trip to London,United Kingdom and had my bag stolen from me with my passport and credit cards in it. The embassy is willing to help by authorizing me to fly without my passport, I just have to pay for a ticket and settle Hotel bills. Unfortunately, I can't have access to funds without my credit card, I've made contact with my bank but they need more time to come up with a new one. I was thinking of asking you to lend me some quick funds that I can give back as soon as I get in. I really need to be on the next available flight. I can forward you details on how you can get money to me. You can reach me via email or the hotel's help desk, 08715046355. I hope to hear from you soon. Thanks Felicia Betancourt From brendan.simon at etrix.com.au Thu Mar 10 13:05:16 2011 From: brendan.simon at etrix.com.au (Brendan Simon (eTRIX)) Date: Thu, 10 Mar 2011 23:05:16 +1100 Subject: [Pythonmac-SIG] py2app 0.5.2 fails to copy main-i386 file Message-ID: <4D78BE7C.9020508@etrix.com.au> I upgraded to py2app 0.5.2 and now my app does not build :( I'm using OS X 10.6 and Python 2.5.4 from python.org. File "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/shutil.py", line 51, in copyfile fsrc = open(src, 'rb') IOError: [Errno 2] No such file or directory: '/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/py2app/apptemplate/prebuilt/main-i386' > /Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/shutil.py(58)copyfile() -> fsrc.close() (Pdb) interrupted make: *** [dist/SureAnalysis.app] Error 1 I thought I read that this was fixed in 0.5.2 (from 0.5.1) but it does not seem to be the case. I did see a message to copy main-fat to main-i386. I tried that and the app builds ok. I note that there is also main-intel, main-universal, etc. I presume main-fat is the one to use ?? My app does not parse the command line arguments anymore when invoked with 'open' e.g. $ open myurl:mycommand I remember modifying something with argv emulation quite a while ago (1 or 2 years ago). Is this still expected with py2app 0.5.2 ?? Thanks, Brendan. -------------- next part -------------- An HTML attachment was scrubbed... URL: From animator333 at yahoo.com Thu Mar 10 13:20:00 2011 From: animator333 at yahoo.com (Prashant Saxena) Date: Thu, 10 Mar 2011 17:50:00 +0530 (IST) Subject: [Pythonmac-SIG] py2app os.getenv and path not working Message-ID: <198673.99387.qm@web94913.mail.in2.yahoo.com> Hi, Mac Leopard 10.5.5 Intel python 2.6.6 wxpython 2.8.11.0 py2app 0.5.2 My program is working fine in source environment. In source environment 'os.getenv' is working fine. When deploying .app using py2app 'os.getenv' is returning none. I am also facing problems when executing external program using wx.Process. These programs are available on path and there is no problem when executing them using terminal or running from my script in source environment. I tried using full path of these external programs but they are also complaining about their own environment vars missing. I am new to mac and absolutely node idea why .app is not able to access environment variables. Cheers Prashant From ronaldoussoren at mac.com Thu Mar 10 15:04:08 2011 From: ronaldoussoren at mac.com (Ronald Oussoren) Date: Thu, 10 Mar 2011 09:04:08 -0500 Subject: [Pythonmac-SIG] py2app 0.5.2 fails to copy main-i386 file In-Reply-To: <4D78BE7C.9020508@etrix.com.au> References: <4D78BE7C.9020508@etrix.com.au> Message-ID: On 10 Mar, 2011, at 7:05, Brendan Simon (eTRIX) wrote: > I upgraded to py2app 0.5.2 and now my app does not build :( > I'm using OS X 10.6 and Python 2.5.4 from python.org. > > File "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/shutil.py", line 51, in copyfile > fsrc = open(src, 'rb') > IOError: [Errno 2] No such file or directory: '/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/py2app/apptemplate/prebuilt/main-i386' > > /Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/shutil.py(58)copyfile() > -> fsrc.close() > (Pdb) interrupted > make: *** [dist/SureAnalysis.app] Error 1 > > I thought I read that this was fixed in 0.5.2 (from 0.5.1) but it does not seem to be the case. > > I did see a message to copy main-fat to main-i386. I tried that and the app builds ok. > I note that there is also main-intel, main-universal, etc. I presume main-fat is the one to use ?? > > My app does not parse the command line arguments anymore when invoked with 'open' > e.g. $ open myurl:mycommand > > I remember modifying something with argv emulation quite a while ago (1 or 2 years ago). Is this still expected with py2app 0.5.2 ?? There is a problem with the source package of py2app. I want to do a new release later this week that fixes the issue. (The problem is that not all files are included in the sdist archive because our setup.py relied on setuptools including all files that are in the repository, and that no longer works because we switched to mercurial). 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 ronaldoussoren at mac.com Thu Mar 10 15:32:04 2011 From: ronaldoussoren at mac.com (Ronald Oussoren) Date: Thu, 10 Mar 2011 09:32:04 -0500 Subject: [Pythonmac-SIG] py2app 0.5.2 fails to copy main-i386 file In-Reply-To: References: <4D78BE7C.9020508@etrix.com.au> Message-ID: <2840555C-6FCE-44C5-B0BD-8B35D5C646A4@mac.com> On 10 Mar, 2011, at 9:04, Ronald Oussoren wrote: > > On 10 Mar, 2011, at 7:05, Brendan Simon (eTRIX) wrote: > >> I upgraded to py2app 0.5.2 and now my app does not build :( >> I'm using OS X 10.6 and Python 2.5.4 from python.org. >> >> File "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/shutil.py", line 51, in copyfile >> fsrc = open(src, 'rb') >> IOError: [Errno 2] No such file or directory: '/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/py2app/apptemplate/prebuilt/main-i386' >> > /Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/shutil.py(58)copyfile() >> -> fsrc.close() >> (Pdb) interrupted >> make: *** [dist/SureAnalysis.app] Error 1 >> >> I thought I read that this was fixed in 0.5.2 (from 0.5.1) but it does not seem to be the case. >> >> I did see a message to copy main-fat to main-i386. I tried that and the app builds ok. >> I note that there is also main-intel, main-universal, etc. I presume main-fat is the one to use ?? >> >> My app does not parse the command line arguments anymore when invoked with 'open' >> e.g. $ open myurl:mycommand >> >> I remember modifying something with argv emulation quite a while ago (1 or 2 years ago). Is this still expected with py2app 0.5.2 ?? > > There is a problem with the source package of py2app. I want to do a new release later this week that fixes the issue. > > (The problem is that not all files are included in the sdist archive because our setup.py relied on setuptools including all files that are in the repository, and that no longer works because we switched to mercurial). That was a bit too optimistic: I installed an Xcode4 prerelease on my machine and that not only doesn't ship with the OSX 10.4u SDK, the compiler also crashes when trying to build the "-ppc" and "-fat" variants of the application loader. As I'm at Pycon I'll probably won't be able to do a release until I return from the conference (which means after the 20th). Ronald > > 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 mcclure at hkl.hms.harvard.edu Thu Mar 10 20:59:00 2011 From: mcclure at hkl.hms.harvard.edu (Ben McClure) Date: Thu, 10 Mar 2011 14:59:00 -0500 Subject: [Pythonmac-SIG] Framework Python and X11 Message-ID: The group I work with needs a Python with tkinter over X11 as well as wxPython. wxPython requires a framework build of Python on Mac, and the current one I have is non-framework, using X11. Is there a way of building a framework Python that still supports X11 tkinter? Thanks, -Ben -- Ben McClure Structural Biology Grid Harvard Medical School www.sbgrid.org From brendan.simon at etrix.com.au Thu Mar 10 21:18:05 2011 From: brendan.simon at etrix.com.au (Brendan Simon (eTRIX)) Date: Fri, 11 Mar 2011 07:18:05 +1100 Subject: [Pythonmac-SIG] py2app 0.5.2 and argv emulation with URLs/URIs In-Reply-To: References: <4D78BE7C.9020508@etrix.com.au> Message-ID: <4D7931FD.5020105@etrix.com.au> On 11/03/11 1:04 AM, Ronald Oussoren wrote: > > On 10 Mar, 2011, at 7:05, Brendan Simon (eTRIX) wrote: > >> I upgraded to py2app 0.5.2 and now my app does not build :( >> I'm using OS X 10.6 and Python 2.5.4 from python.org . >> >> My app does not parse the command line arguments anymore when invoked >> with 'open' >> e.g. $ open myurl:mycommand >> >> I remember modifying something with argv emulation quite a while ago >> (1 or 2 years ago). Is this still expected with py2app 0.5.2 ?? >> i.e. should opening URLs/URIs work out of the box ?? > > There is a problem with the source package of py2app. I want to do a > new release later this week that fixes the issue. > > (The problem is that not all files are included in the sdist archive > because our setup.py relied on setuptools including all files that are > in the repository, and that no longer works because we switched to > mercurial). Any feedback on the argv_emulation issue when open URLs/URIs ?? -------------- next part -------------- An HTML attachment was scrubbed... URL: From nad at acm.org Thu Mar 10 21:22:26 2011 From: nad at acm.org (Ned Deily) Date: Thu, 10 Mar 2011 15:22:26 -0500 Subject: [Pythonmac-SIG] Framework Python and X11 References: Message-ID: In article , Ben McClure wrote: > The group I work with needs a Python with tkinter over X11 as well as > wxPython. wxPython requires a framework build of Python on Mac, and > the current one I have is non-framework, using X11. Is there a way of > building a framework Python that still supports X11 tkinter? The python.org installers for Mac OS X do not support linking to an X11 tkinter. The simplest solution might be to install a Python from MacPorts. The current MacPorts Tk is an X11 Tk, its Pythons are framework builds, and it has its own wxPython ports. (I have no personal experience with wxPython.) If you install the base MacPorts, one command might install all you need: $ sudo port py27-wxpython # or py26-wxpython or .. http://www.macports.org/ports.php?by=name&substr=wxpython -- Ned Deily, nad at acm.org From Chris.Barker at noaa.gov Thu Mar 10 22:13:01 2011 From: Chris.Barker at noaa.gov (Christopher Barker) Date: Thu, 10 Mar 2011 13:13:01 -0800 Subject: [Pythonmac-SIG] Framework Python and X11 In-Reply-To: References: Message-ID: <4D793EDD.6000006@noaa.gov> On 3/10/11 12:22 PM, Ned Deily wrote: > The python.org installers for Mac OS X do not support linking to an X11 > tkinter. The simplest solution might be to install a Python from > MacPorts. probably so, but > The current MacPorts Tk is an X11 Tk, its Pythons are > framework builds, and it has its own wxPython ports. I looked, and the wxPython ports are "wxmac", not wxGTK, which I think is what the OP wants. The fact that macports has done it means it can be done, so the OP would compile his own python as well. I think he's got it working with TK the way they want, so could he just add the framework flag and be done? -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 lou_boog2000 at yahoo.com Thu Mar 10 22:29:48 2011 From: lou_boog2000 at yahoo.com (Lou Pecora) Date: Thu, 10 Mar 2011 13:29:48 -0800 (PST) Subject: [Pythonmac-SIG] Framework Python and X11 In-Reply-To: <4D793EDD.6000006@noaa.gov> References: <4D793EDD.6000006@noaa.gov> Message-ID: <803050.93486.qm@web34406.mail.mud.yahoo.com> ----- Original Message ---- From: Christopher Barker To: pythonmac-sig at python.org Sent: Thu, March 10, 2011 4:13:01 PM Subject: Re: [Pythonmac-SIG] Framework Python and X11 On 3/10/11 12:22 PM, Ned Deily wrote: > The python.org installers for Mac OS X do not support linking to an X11 > tkinter. The simplest solution might be to install a Python from > MacPorts. probably so, but > The current MacPorts Tk is an X11 Tk, its Pythons are > framework builds, and it has its own wxPython ports. I looked, and the wxPython ports are "wxmac", not wxGTK, which I think is what the OP wants. The fact that macports has done it means it can be done, so the OP would compile his own python as well. I think he's got it working with TK the way they want, so could he just add the framework flag and be done? -Chris -- Christopher Barker, Ph.D. ---------- When I was building Sage which has Python 2.6 in it I kept getting X11 windows, not the Apple Aqua version. I found out using otool on the _tkinter.so in sage that I was building against a tk/tcl library that was in /Library/Frameworks/Tk.framework/Versions/8.5/Tk and apparently was an X11 library. When I removed those libraries and rebuilt Sage it automatically built against the Apple tk/tcl libraries in /System/Library/Frameworks/Tk.framework/. Then I got the Aqua windows. Might this be the case here? -- Lou Pecora, my views are my own. From brendan.simon at etrix.com.au Fri Mar 11 00:04:08 2011 From: brendan.simon at etrix.com.au (Brendan Simon (eTRIX)) Date: Fri, 11 Mar 2011 10:04:08 +1100 Subject: [Pythonmac-SIG] [patch] GetURL argv emulation for py2app 0.5.2 Message-ID: <4D7958E8.1060103@etrix.com.au> Below is my patch to get URLs/URIs to be added to sys.argv when an app is opened via the Launcher. It should be applied to: /Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/py2app/bootstrap/argv_emulation.py Can this patch *please* be integrated (please modify if necessary) in to 0.5.3 release !! eg. You can test with "open myapp myurl:test" The sys.argv attribute should include "myurl:test" :) NOTE: for some reason the AppleEvent constants kAEInternetSuite and kAEISGetURL does not work as they are set to 'gurl' (lowercase). However using 'GURL' does work :) Cheers, Brendan. --- argv_emulation_orig.py 2011-03-11 08:49:13.000000000 +1100 +++ argv_emulation.py 2011-03-11 09:47:00.000000000 +1100 @@ -7,7 +7,8 @@ import traceback from Carbon import AE from Carbon.AppleEvents import kCoreEventClass, kAEOpenApplication, \ - kAEOpenDocuments, keyDirectObject, typeAEList, typeAlias + kAEOpenDocuments, keyDirectObject, typeAEList, typeAlias, \ + kAEInternetSuite, kAEISGetURL, typeChar from Carbon import Evt from Carbon import File from Carbon.Events import highLevelEventMask, kHighLevelEvent @@ -23,10 +24,14 @@ self.__runapp) AE.AEInstallEventHandler(kCoreEventClass, kAEOpenDocuments, self.__openfiles) + #AE.AEInstallEventHandler(kAEInternetSuite, kAEISGetURL, self.__geturl) + AE.AEInstallEventHandler('GURL', 'GURL', self.__geturl) def close(self): AE.AERemoveEventHandler(kCoreEventClass, kAEOpenApplication) AE.AERemoveEventHandler(kCoreEventClass, kAEOpenDocuments) + #AE.AERemoveEventHandler(kAEInternetSuite, kAEISGetURL) + AE.AERemoveEventHandler('GURL', 'GURL') def mainloop(self, mask = highLevelEventMask, timeout = 1*60): # Note: this is not the right way to run an event loop in OSX or @@ -91,6 +96,20 @@ self._quit() + def __geturl(self, requestevent, replyevent): + try: + listdesc = requestevent.AEGetParamDesc(keyDirectObject, typeAEList) + for i in range(listdesc.AECountItems()): + desc = listdesc.AEGetNthDesc(i+1, typeChar)[1] + url = desc.data.decode('utf8') + sys.argv.append(url) + except Exception, e: + print "argvemulator.py warning: can't unpack a GetURL event" + import traceback + traceback.print_exc() + + self._quit() + return ArgvCollector() def _argv_emulation(): From ronaldoussoren at mac.com Fri Mar 11 03:41:05 2011 From: ronaldoussoren at mac.com (Ronald Oussoren) Date: Thu, 10 Mar 2011 21:41:05 -0500 Subject: [Pythonmac-SIG] [patch] GetURL argv emulation for py2app 0.5.2 In-Reply-To: <4D7958E8.1060103@etrix.com.au> References: <4D7958E8.1060103@etrix.com.au> Message-ID: On 10 Mar, 2011, at 18:04, Brendan Simon (eTRIX) wrote: > Below is my patch to get URLs/URIs to be added to sys.argv when an app > is opened via the Launcher. > > It should be applied to: > > /Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/py2app/bootstrap/argv_emulation.py > > Can this patch *please* be integrated (please modify if necessary) in to > 0.5.3 release !! Which OS release are you on? I've tried to test with python 2.5 and 2.7 on OSX 10.6 and those seem to work fine without your patch (even with the lowercase values you mention furtheron). My test has a simple main.py script that saves sys.argv in a text file. When I add that file to an application bundle with py2app and then start the bundle with 'open -a dist/myapp.app file:/usr/bin/ssh' the saved argv contains the file to open. As code says more than my description I've attached the unittest testcase I've tried. Is this test testing the failure your reporting or did I misread your message? Ronald -------------- next part -------------- A non-text attachment was scrubbed... Name: test.zip Type: application/zip Size: 1835 bytes Desc: not available URL: -------------- next part -------------- > > eg. You can test with "open myapp myurl:test" > > The sys.argv attribute should include "myurl:test" :) > > NOTE: for some reason the AppleEvent constants kAEInternetSuite and > kAEISGetURL does not work as they are set to 'gurl' (lowercase). > However using 'GURL' does work :) > > Cheers, Brendan. > > > --- argv_emulation_orig.py 2011-03-11 08:49:13.000000000 +1100 > +++ argv_emulation.py 2011-03-11 09:47:00.000000000 +1100 > @@ -7,7 +7,8 @@ > import traceback > from Carbon import AE > from Carbon.AppleEvents import kCoreEventClass, kAEOpenApplication, \ > - kAEOpenDocuments, keyDirectObject, typeAEList, typeAlias > + kAEOpenDocuments, keyDirectObject, typeAEList, typeAlias, \ > + kAEInternetSuite, kAEISGetURL, typeChar > from Carbon import Evt > from Carbon import File > from Carbon.Events import highLevelEventMask, kHighLevelEvent > @@ -23,10 +24,14 @@ > self.__runapp) > AE.AEInstallEventHandler(kCoreEventClass, kAEOpenDocuments, > self.__openfiles) > + #AE.AEInstallEventHandler(kAEInternetSuite, kAEISGetURL, > self.__geturl) > + AE.AEInstallEventHandler('GURL', 'GURL', self.__geturl) > > def close(self): > AE.AERemoveEventHandler(kCoreEventClass, kAEOpenApplication) > AE.AERemoveEventHandler(kCoreEventClass, kAEOpenDocuments) > + #AE.AERemoveEventHandler(kAEInternetSuite, kAEISGetURL) > + AE.AERemoveEventHandler('GURL', 'GURL') > > def mainloop(self, mask = highLevelEventMask, timeout = 1*60): > # Note: this is not the right way to run an event loop in > OSX or > @@ -91,6 +96,20 @@ > > self._quit() > > + def __geturl(self, requestevent, replyevent): > + try: > + listdesc = requestevent.AEGetParamDesc(keyDirectObject, > typeAEList) > + for i in range(listdesc.AECountItems()): > + desc = listdesc.AEGetNthDesc(i+1, typeChar)[1] > + url = desc.data.decode('utf8') > + sys.argv.append(url) > + except Exception, e: > + print "argvemulator.py warning: can't unpack a GetURL > event" > + import traceback > + traceback.print_exc() > + > + self._quit() > + > return ArgvCollector() > > def _argv_emulation(): > > > _______________________________________________ > 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 brendan.simon at etrix.com.au Sat Mar 12 12:36:51 2011 From: brendan.simon at etrix.com.au (Brendan Simon (eTRIX)) Date: Sat, 12 Mar 2011 22:36:51 +1100 Subject: [Pythonmac-SIG] [patch] GetURL argv emulation for py2app 0.5.2 In-Reply-To: References: Message-ID: <4D7B5AD3.5050601@etrix.com.au> On 12/03/11 10:00 PM, pythonmac-sig-request at python.org wrote: > On 10 Mar, 2011, at 18:04, Brendan Simon (eTRIX) wrote: >> > Below is my patch to get URLs/URIs to be added to sys.argv when an app >> > is opened via the Launcher. >> > >> > It should be applied to: >> > >> > /Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/py2app/bootstrap/argv_emulation.py >> > >> > Can this patch *please* be integrated (please modify if necessary) in to >> > 0.5.3 release !! > Which OS release are you on? I've tried to test with python 2.5 and 2.7 on OSX 10.6 and those seem to work fine without your patch (even with the lowercase values you mention furtheron). > > My test has a simple main.py script that saves sys.argv in a text file. When I add that file to an application bundle with py2app and then start the bundle with 'open -a dist/myapp.app file:/usr/bin/ssh' the saved argv contains the file to open. As code says more than my description I've attached the unittest testcase I've tried. > > Is this test testing the failure your reporting or did I misread your message? I am running on OS 10.6, but my app needs to run on 10.4, 10.5 and 10.6 (PPC and Intel). I am using Python 2.5.4. I don't think your test would work if you were to use a custom url, rather than 'file:' and a filename/path. If I ran the command "open myurl:mycommand" from the terminal, and my plist has configured 'myurl' as a recognised url, then the app bundle should fire up. It may need to be in the Application folder for it to work ?? I expect 'myurl:mycommand' to be appended to sys.argv. Here is a snippet of my py2app setup.py. # A custom plist for letting it associate with a URL protocol. URLTYPES = [ { 'CFBundleURLName' : "MyUrl", 'CFBundleURLSchemes' : [ "myurl" ] } ] Plist = dict( NSAppleScriptEnabled = 'YES', CFBundleIdentifier = 'com.myurl', LSMinimumSystemVersion = "10.4", CFBundleURLTypes = URLTYPES ) OPTIONS = { 'argv_emulation' : True, 'iconfile' : 'images/myurl.icns', 'plist' : Plist, } Hope that helps, Brendan. -------------- next part -------------- An HTML attachment was scrubbed... URL: From ronaldoussoren at mac.com Sat Mar 12 15:30:52 2011 From: ronaldoussoren at mac.com (Ronald Oussoren) Date: Sat, 12 Mar 2011 09:30:52 -0500 Subject: [Pythonmac-SIG] [patch] GetURL argv emulation for py2app 0.5.2 In-Reply-To: <4D7B5AD3.5050601@etrix.com.au> References: <4D7B5AD3.5050601@etrix.com.au> Message-ID: <60329AE8-2461-40C9-A33D-256E8A0AC1F7@mac.com> On 12 Mar, 2011, at 6:36, Brendan Simon (eTRIX) wrote: > On 12/03/11 10:00 PM, pythonmac-sig-request at python.org wrote: >> >> On 10 Mar, 2011, at 18:04, Brendan Simon (eTRIX) wrote: >>> > Below is my patch to get URLs/URIs to be added to sys.argv when an app >>> > is opened via the Launcher. >>> > >>> > It should be applied to: >>> > >>> > /Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/py2app/bootstrap/argv_emulation.py >>> > >>> > Can this patch *please* be integrated (please modify if necessary) in to >>> > 0.5.3 release !! >> Which OS release are you on? I've tried to test with python 2.5 and 2.7 on OSX 10.6 and those seem to work fine without your patch (even with the lowercase values you mention furtheron). >> >> My test has a simple main.py script that saves sys.argv in a text file. When I add that file to an application bundle with py2app and then start the bundle with 'open -a dist/myapp.app file:/usr/bin/ssh' the saved argv contains the file to open. As code says more than my description I've attached the unittest testcase I've tried. >> >> Is this test testing the failure your reporting or did I misread your message? > > I am running on OS 10.6, but my app needs to run on 10.4, 10.5 and 10.6 (PPC and Intel). > I am using Python 2.5.4. > > I don't think your test would work if you were to use a custom url, rather than 'file:' and a filename/path. > > If I ran the command "open myurl:mycommand" from the terminal, and my plist has configured 'myurl' as a recognised url, then the app bundle should fire up. It may need to be in the Application folder for it to work ?? > > I expect 'myurl:mycommand' to be appended to sys.argv. > > Here is a snippet of my py2app setup.py. > > # A custom plist for letting it associate with a URL protocol. > URLTYPES = [ > { > 'CFBundleURLName' : "MyUrl", > 'CFBundleURLSchemes' : [ "myurl" ] > } > ] > > Plist = dict( > NSAppleScriptEnabled = 'YES', > CFBundleIdentifier = 'com.myurl', > LSMinimumSystemVersion = "10.4", > CFBundleURLTypes = URLTYPES > ) > > OPTIONS = { > 'argv_emulation' : True, > 'iconfile' : 'images/myurl.icns', > 'plist' : Plist, > } > > Hope that helps, It sure does, this helped me to reproduce the issue. I've added another >From your original e-mail: > + def __geturl(self, requestevent, replyevent): > + try: > + listdesc = requestevent.AEGetParamDesc(keyDirectObject, > typeAEList) > + for i in range(listdesc.AECountItems()): > + desc = listdesc.AEGetNthDesc(i+1, typeChar)[1] > + url = desc.data.decode('utf8') Is the decode really necessary? With this one of the times in sys.argv will be a Unicode string rather than a byte string. I'd therefore prefer to not have the decode call. I've added your patch without the decode call to my repository, including some tests that ensure that future versions won't accidently break the code. Thank you for the patch, Ronald > + sys.argv.append(url) > + except Exception, e: > + print "argvemulator.py warning: can't unpack a GetURL > event" > + import traceback > + traceback.print_exc() > + > 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 brendan.simon at etrix.com.au Sun Mar 13 01:19:38 2011 From: brendan.simon at etrix.com.au (Brendan Simon (eTRIX)) Date: Sun, 13 Mar 2011 11:19:38 +1100 Subject: [Pythonmac-SIG] [patch] GetURL argv emulation for py2app 0.5.2 In-Reply-To: <60329AE8-2461-40C9-A33D-256E8A0AC1F7@mac.com> References: <4D7B5AD3.5050601@etrix.com.au> <60329AE8-2461-40C9-A33D-256E8A0AC1F7@mac.com> Message-ID: <4D7C0D9A.1080004@etrix.com.au> On 13/03/11 1:30 AM, Ronald Oussoren wrote: > On 12 Mar, 2011, at 6:36, Brendan Simon (eTRIX) wrote: >> I am running on OS 10.6, but my app needs to run on 10.4, 10.5 and >> 10.6 (PPC and Intel). >> I am using Python 2.5.4. >> >> I don't think your test would work if you were to use a custom url, >> rather than 'file:' and a filename/path. >> >> If I ran the command "open myurl:mycommand" from the terminal, and my >> plist has configured 'myurl' as a recognised url, then the app bundle >> should fire up. It may need to be in the Application folder for it >> to work ?? >> >> I expect 'myurl:mycommand' to be appended to sys.argv. >> >> Here is a snippet of my py2app setup.py. >> >> # A custom plist for letting it associate with a URL protocol. >> URLTYPES = [ >> { >> 'CFBundleURLName' : "MyUrl", >> 'CFBundleURLSchemes' : [ "myurl" ] >> } >> ] >> >> Plist = dict( >> NSAppleScriptEnabled = 'YES', >> CFBundleIdentifier = 'com.myurl', >> LSMinimumSystemVersion = "10.4", >> CFBundleURLTypes = URLTYPES >> ) >> >> OPTIONS = { >> 'argv_emulation' : True, >> 'iconfile' : 'images/myurl.icns', >> 'plist' : Plist, >> } >> >> Hope that helps, > > It sure does, this helped me to reproduce the issue. I've added another > > From your original e-mail: > >> + def __geturl(self, requestevent, replyevent): >> + try: >> + listdesc = requestevent.AEGetParamDesc(keyDirectObject, >> typeAEList) >> + for i in range(listdesc.AECountItems()): >> + desc = listdesc.AEGetNthDesc(i+1, typeChar)[1] >> + url = desc.data.decode('utf8') > > Is the decode really necessary? With this one of the times in sys.argv > will be a Unicode string rather than a byte string. I'd therefore > prefer to not have the decode call. > > I've added your patch without the decode call to my repository, > including some tests that ensure that future versions won't accidently > break the code. > > Thank you for the patch, My pleasure re the patch. It's nice to be able to contribute back to the open-source community (even if it is just a tiny bit). I did the original patch back in 2009. I don't know why the decode('utf8') is in there. I suspect it was a copy-n-paste from somewhere, either some from some code I found via googling or from some code posted on this mailing list. I'm more than happy to remove the decode it as I presume the application itself can do that if necessary. Cheers, Brendan. From brendan.simon at etrix.com.au Sun Mar 13 01:28:18 2011 From: brendan.simon at etrix.com.au (Brendan Simon (eTRIX)) Date: Sun, 13 Mar 2011 11:28:18 +1100 Subject: [Pythonmac-SIG] [patch] GetURL argv emulation for py2app 0.5.2 In-Reply-To: <4D7958E8.1060103@etrix.com.au> References: <4D7958E8.1060103@etrix.com.au> Message-ID: <4D7C0FA2.6090406@etrix.com.au> On 11/03/11 10:04 AM, Brendan Simon (eTRIX) wrote: > NOTE: for some reason the AppleEvent constants kAEInternetSuite and > kAEISGetURL does not work as they are set to 'gurl' (lowercase). > However using 'GURL' does work :) > > Cheers, Brendan. Was thinking it may be "nicer" to convert the constants to upper case rather than having a magic string ?? - AE.AEInstallEventHandler('GURL', 'GURL', self.__geturl) + AE.AEInstallEventHandler(kAEInternetSuite.upper(), kAEISGetURL.upper(), self.__geturl) - AE.AERemoveEventHandler('GURL', 'GURL') + AE.AERemoveEventHandler(kAEInternetSuite.upper(), kAEISGetURL.upper()) or kAEInternetSuite = kAEInternetSuite.upper() kAEISGetURL = kAEISGetURL.upper()) I'm not fussed either way, as long as it works :) Cheers, Brendan. From ronaldoussoren at mac.com Sun Mar 13 13:13:02 2011 From: ronaldoussoren at mac.com (Ronald Oussoren) Date: Sun, 13 Mar 2011 08:13:02 -0400 Subject: [Pythonmac-SIG] [patch] GetURL argv emulation for py2app 0.5.2 In-Reply-To: <4D7C0FA2.6090406@etrix.com.au> References: <4D7958E8.1060103@etrix.com.au> <4D7C0FA2.6090406@etrix.com.au> Message-ID: <5315AC70-1C2B-4EC2-9CD7-01E7F6CD20E1@mac.com> On 12 Mar, 2011, at 19:28, Brendan Simon (eTRIX) wrote: > > > On 11/03/11 10:04 AM, Brendan Simon (eTRIX) wrote: >> NOTE: for some reason the AppleEvent constants kAEInternetSuite and >> kAEISGetURL does not work as they are set to 'gurl' (lowercase). >> However using 'GURL' does work :) >> >> Cheers, Brendan. > > Was thinking it may be "nicer" to convert the constants to upper case > rather than having a magic string ?? > > - AE.AEInstallEventHandler('GURL', 'GURL', self.__geturl) > + AE.AEInstallEventHandler(kAEInternetSuite.upper(), kAEISGetURL.upper(), self.__geturl) > > > - AE.AERemoveEventHandler('GURL', 'GURL') > + AE.AERemoveEventHandler(kAEInternetSuite.upper(), kAEISGetURL.upper()) I'd prefer to keep the hardcoded literals for now, that makes it clear that the definition in the stdlib is wrong. The current code doesn't work in python3, as the entire Carbon package is not present there. I will therefore rewrite argv_emulation.py using ctypes in the near future and then this issue entirely goes away ;-) Ronald From dan at rosspixelworks.com Mon Mar 14 23:53:24 2011 From: dan at rosspixelworks.com (Dan Ross) Date: Mon, 14 Mar 2011 17:53:24 -0500 Subject: [Pythonmac-SIG] py2app and Python 3.2 Message-ID: <8c7257eaa3f63df0f186d263bc6ccb03@rosspixelworks.com> Hi all- I have a very small and simple Tkinter/Python 3.2 app that I'm trying to bundle with py2app. After updating py2app and it's dependencies to "dev" versions I still get the following error: *** creating application bundle: gui *** Traceback (most recent call last): File "/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/site-packages/py2app-0.5.2-py3.2.egg/py2app/build_app.py", line 604, in _run self.run_normal() File "/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/site-packages/py2app-0.5.2-py3.2.egg/py2app/build_app.py", line 675, in run_normal self.create_binaries(py_files, pkgdirs, extensions, loader_files) File "/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/site-packages/py2app-0.5.2-py3.2.egg/py2app/build_app.py", line 772, in create_binaries target, arcname, pkgexts, copyexts, target.script) File "/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/site-packages/py2app-0.5.2-py3.2.egg/py2app/build_app.py", line 1253, in build_executable sys.version[:3])), os.path.join(inc_dir, 'pyconfig.h')) File "/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/distutils/cmd.py", line 350, in copy_file dry_run=self.dry_run) File "/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/distutils/file_util.py", line 106, in copy_file "can't copy '%s': doesn't exist or not a regular file" % src) distutils.errors.DistutilsFileError: can't copy '/Library/Frameworks/Python.framework/Versions/3.2/include/python3.2/pyconfig.h': doesn't exist or not a regular file > > /Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/distutils/file_util.py(106)copy_file() -> "can't copy '%s': doesn't exist or not a regular file" % src) (Pdb) From snooping around in Library/Frameworks/Python.framework/Versions/3.2/include/ in looks like the python folder is named python3.2m rather than just python. Does this sound familiar or am I barking up the wrong tree? Oh. OS 10.6.6 Python 3.2 64bit Thanks, Dan From animator333 at yahoo.com Tue Mar 15 05:48:01 2011 From: animator333 at yahoo.com (Prashant Saxena) Date: Tue, 15 Mar 2011 10:18:01 +0530 (IST) Subject: [Pythonmac-SIG] py2app and stripped os.environ Message-ID: <869273.34610.qm@web94913.mail.in2.yahoo.com> Hi, Once deployed as .app using py2app, I am not getting all the env vars that are available to users. A detailed discussion on this topic is available at here: https://groups.google.com/forum/#!topic/wxpython-users/8IuO_Q1ZjA8 Considering the last post in that topic, Now all the user env vars are available when starting the app from terminal using command 'open test.app". When you double click the app in finder, app starts but again os.environ gives limited vars. The idea is to get all the vars in os.environ which are available to the user.(All vars available using 'env' command) Prashant From ronaldoussoren at mac.com Tue Mar 15 14:11:33 2011 From: ronaldoussoren at mac.com (Ronald Oussoren) Date: Tue, 15 Mar 2011 09:11:33 -0400 Subject: [Pythonmac-SIG] py2app and stripped os.environ In-Reply-To: <869273.34610.qm@web94913.mail.in2.yahoo.com> References: <869273.34610.qm@web94913.mail.in2.yahoo.com> Message-ID: On 15 Mar, 2011, at 0:48, Prashant Saxena wrote: > Hi, > > Once deployed as .app using py2app, I am not getting all the env vars that are > available to users. A detailed discussion on this > topic is available at here: > https://groups.google.com/forum/#!topic/wxpython-users/8IuO_Q1ZjA8 > Considering the last post in that topic, Now all the user env vars are available > when starting the app from terminal using command > 'open test.app". When you double click the app in finder, app starts but again > os.environ gives limited vars. > > The idea is to get all the vars in os.environ which are available to the > user.(All vars available using 'env' command) That's on OSX issue, and not a problem in py2app. Most of the environment variables you see from the command-line are initialized by the shell and/or Terminal.app and are not available to GUI applications. You'd see the same issue with a native application. Regards, Ronald > > Prashant > > > > _______________________________________________ > 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 Mar 15 14:10:14 2011 From: ronaldoussoren at mac.com (Ronald Oussoren) Date: Tue, 15 Mar 2011 09:10:14 -0400 Subject: [Pythonmac-SIG] py2app and Python 3.2 In-Reply-To: <8c7257eaa3f63df0f186d263bc6ccb03@rosspixelworks.com> References: <8c7257eaa3f63df0f186d263bc6ccb03@rosspixelworks.com> Message-ID: On 14 Mar, 2011, at 18:53, Dan Ross wrote: > Hi all- > > I have a very small and simple Tkinter/Python 3.2 app that I'm trying to bundle with py2app. I'm currently sprinting at Pycon and will do a new release afterwards. The current tip of the development repositories should work though, although they are lightly tested at the moment. The repositories are: * https://bitbucket.org/ronaldoussoren/altgraph * https://bitbucket.org/ronaldoussoren/macholib * https://bitbucket.org/ronaldoussoren/modulegraph * https://bitbucket.org/ronaldoussoren/py2app You'll have to install the packages in this order, there have bee some API additions and bugfixes that require you to install all of them. My focus with the sprints is on CPython bugfixes as well improving the documentation and test coverage of py2app and supporting modules (whereby "improving the test coverage" means that I've started at no coverage at all a month or so ago). Ronald > > After updating py2app and it's dependencies to "dev" versions I still get the following error: > > > *** creating application bundle: gui *** > Traceback (most recent call last): > File "/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/site-packages/py2app-0.5.2-py3.2.egg/py2app/build_app.py", line 604, in _run > self.run_normal() > File "/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/site-packages/py2app-0.5.2-py3.2.egg/py2app/build_app.py", line 675, in run_normal > self.create_binaries(py_files, pkgdirs, extensions, loader_files) > File "/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/site-packages/py2app-0.5.2-py3.2.egg/py2app/build_app.py", line 772, in create_binaries > target, arcname, pkgexts, copyexts, target.script) > File "/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/site-packages/py2app-0.5.2-py3.2.egg/py2app/build_app.py", line 1253, in build_executable > sys.version[:3])), os.path.join(inc_dir, 'pyconfig.h')) > File "/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/distutils/cmd.py", line 350, in copy_file > dry_run=self.dry_run) > File "/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/distutils/file_util.py", line 106, in copy_file > "can't copy '%s': doesn't exist or not a regular file" % src) > distutils.errors.DistutilsFileError: can't copy '/Library/Frameworks/Python.framework/Versions/3.2/include/python3.2/pyconfig.h': doesn't exist or not a regular file >> /Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/distutils/file_util.py(106)copy_file() > -> "can't copy '%s': doesn't exist or not a regular file" % src) > (Pdb) > > > From snooping around in Library/Frameworks/Python.framework/Versions/3.2/include/ in looks like the python folder is named python3.2m rather than just python. > > Does this sound familiar or am I barking up the wrong tree? > > Oh. OS 10.6.6 Python 3.2 64bit > > Thanks, > > Dan > _______________________________________________ > 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 Chris.Barker at noaa.gov Tue Mar 15 16:57:45 2011 From: Chris.Barker at noaa.gov (Christopher Barker) Date: Tue, 15 Mar 2011 08:57:45 -0700 Subject: [Pythonmac-SIG] py2app and stripped os.environ In-Reply-To: References: <869273.34610.qm@web94913.mail.in2.yahoo.com> Message-ID: <4D7F8C79.2030409@noaa.gov> On 3/15/11 6:11 AM, Ronald Oussoren wrote: >> Once deployed as .app using py2app, I am not getting all the env vars that are >> available to users. > That's on OSX issue, and not a problem in py2app. Most of the environment variables you see from the command-line are initialized by the shell and/or Terminal.app and are not available to GUI applications. You'd see the same issue with a native application. Indeed, and we did explain that to the OP on the wxPython list. However, it seems that it is fairly common that folks write applications that call command line utilities. In this case, they need the environment to be set up the way that it is in the user's default shell. I suggest that it might be nice to have an option for py2app to build an app that will initialize the environment that a user would see in their standard shell. Thanks to a suggestion by Robin Dunn, the OP has found a solution, in which the start up app is replaced by a shell script that then calls exec to start up the actual app -- this assures that the shell is initialized, and the environment passed on to the app itself: #!/bin/bash DIR=$(dirname "$0") exec $DIR/launch I don't know if that's a robust way to do it or not. If nothing else, it assumes that the user's default shell is bash, which is common, but not guaranteed. so: 1) is there a better way to accomplish this task? 2) if so, does it make sense to built it into py2app as an option? -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 Tue Mar 15 18:37:24 2011 From: Chris.Barker at noaa.gov (Christopher Barker) Date: Tue, 15 Mar 2011 10:37:24 -0700 Subject: [Pythonmac-SIG] Fwd: Re: py2app and stripped os.environ Message-ID: <4D7FA3D4.8080107@noaa.gov> Re-posting -- for some reason this didn't seem to show up in the list. -Chris -------- Original Message -------- Subject: Re: [Pythonmac-SIG] py2app and stripped os.environ Date: Tue, 15 Mar 2011 13:09:28 -0400 From: Ronald Oussoren To: Christopher Barker CC: pythonmac-sig at python.org On 15 Mar, 2011, at 11:57, Christopher Barker wrote: > On 3/15/11 6:11 AM, Ronald Oussoren wrote: >>> Once deployed as .app using py2app, I am not getting all the env vars that are >>> available to users. > >> That's on OSX issue, and not a problem in py2app. Most of the environment variables you see from the command-line are initialized by the shell and/or Terminal.app and are not available to GUI applications. You'd see the same issue with a native application. > > Indeed, and we did explain that to the OP on the wxPython list. It would have been nice if he'd mentioned that in his post here. > > However, it seems that it is fairly common that folks write applications that call command line utilities. In this case, they need the environment to be set up the way that it is in the user's default shell. I suggest that it might be nice to have an option for py2app to build an app that will initialize the environment that a user would see in their standard shell. That is non-trivial, especially when the user has specified a different shell in the Terminal preferences. To get the right environment you'd probably have to: * Reverse engineer the default shell created by Terminal.app * Parse the environment plist file (I don't recall the name, but have an PyObjC example that uses is) * Run 'login -f USER' in a subprocess, then run the "env" command using that shell All of this should be done in a bootstrap script (in py2app), and code should then be added to the distutils command to ensure that the script gets included when an option is specified (lets say, "--emulate-shell-environment") All of this is definitely possible, but I don't know when I'll get around to doing it. If someone can write a function that fetches the information I can easily integrate it into py2app. This should be a function that takes no arguments and updates os.environ, something like: .. def _emulate_shell_environment(): .. import os .. os.environ['KEY'] = 'value' BTW. I've filed issue #15 for this, to ensure the request doesn't get lost () Ronald -- 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 ronaldoussoren at mac.com Tue Mar 15 18:09:28 2011 From: ronaldoussoren at mac.com (Ronald Oussoren) Date: Tue, 15 Mar 2011 13:09:28 -0400 Subject: [Pythonmac-SIG] py2app and stripped os.environ In-Reply-To: <4D7F8C79.2030409@noaa.gov> References: <869273.34610.qm@web94913.mail.in2.yahoo.com> <4D7F8C79.2030409@noaa.gov> Message-ID: On 15 Mar, 2011, at 11:57, Christopher Barker wrote: > On 3/15/11 6:11 AM, Ronald Oussoren wrote: >>> Once deployed as .app using py2app, I am not getting all the env vars that are >>> available to users. > >> That's on OSX issue, and not a problem in py2app. Most of the environment variables you see from the command-line are initialized by the shell and/or Terminal.app and are not available to GUI applications. You'd see the same issue with a native application. > > Indeed, and we did explain that to the OP on the wxPython list. It would have been nice if he'd mentioned that in his post here. > > However, it seems that it is fairly common that folks write applications that call command line utilities. In this case, they need the environment to be set up the way that it is in the user's default shell. I suggest that it might be nice to have an option for py2app to build an app that will initialize the environment that a user would see in their standard shell. That is non-trivial, especially when the user has specified a different shell in the Terminal preferences. To get the right environment you'd probably have to: * Reverse engineer the default shell created by Terminal.app * Parse the environment plist file (I don't recall the name, but have an PyObjC example that uses is) * Run 'login -f USER' in a subprocess, then run the "env" command using that shell All of this should be done in a bootstrap script (in py2app), and code should then be added to the distutils command to ensure that the script gets included when an option is specified (lets say, "--emulate-shell-environment") All of this is definitely possible, but I don't know when I'll get around to doing it. If someone can write a function that fetches the information I can easily integrate it into py2app. This should be a function that takes no arguments and updates os.environ, something like: .. def _emulate_shell_environment(): .. import os .. os.environ['KEY'] = 'value' BTW. I've filed issue #15 for this, to ensure the request doesn't get lost () Ronald From dan at rosspixelworks.com Wed Mar 16 15:15:22 2011 From: dan at rosspixelworks.com (Dan Ross) Date: Wed, 16 Mar 2011 09:15:22 -0500 Subject: [Pythonmac-SIG] py2app and Python 3.2 In-Reply-To: References: <8c7257eaa3f63df0f186d263bc6ccb03@rosspixelworks.com> Message-ID: <361e8faf7a74ed8e7864d2ab6788eb2d@rosspixelworks.com> Hey Ronald- Thanks for the response. I now get the following error: Traceback (most recent call last): File "/Library/Frameworks/Python.framework/Versions/3.2/bin/py2applet", line 9, in load_entry_point('py2app==0.6', 'console_scripts', 'py2applet')() File "/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/site-packages/py2app-0.6-py3.2.egg/py2app/script_py2applet.py", line 132, in main make_setup(args, scripts, data_files, options) File "/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/site-packages/py2app-0.6-py3.2.egg/py2app/script_py2applet.py", line 163, in make_setup f.write(SETUP_TEMPLATE % tvars) TypeError: 'str' does not support the buffer interface Dan On Tue, 15 Mar 2011 09:10:14 -0400, Ronald Oussoren wrote: > On 14 Mar, 2011, at 18:53, Dan Ross wrote: > >> Hi all- >> >> I have a very small and simple Tkinter/Python 3.2 app that I'm >> trying to bundle with py2app. > > I'm currently sprinting at Pycon and will do a new release > afterwards. The current tip of the development repositories should > work though, although they are lightly tested at the moment. > > The repositories are: > * https://bitbucket.org/ronaldoussoren/altgraph > * https://bitbucket.org/ronaldoussoren/macholib > * https://bitbucket.org/ronaldoussoren/modulegraph > * https://bitbucket.org/ronaldoussoren/py2app > > You'll have to install the packages in this order, there have bee > some API additions and bugfixes that require you to install all of > them. > > My focus with the sprints is on CPython bugfixes as well improving > the documentation and test coverage of py2app and supporting modules > (whereby "improving the test coverage" means that I've started at no > coverage at all a month or so ago). > > Ronald > >> >> After updating py2app and it's dependencies to "dev" versions I >> still get the following error: >> >> >> *** creating application bundle: gui *** >> Traceback (most recent call last): >> File >> "/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/site-packages/py2app-0.5.2-py3.2.egg/py2app/build_app.py", >> line 604, in _run >> self.run_normal() >> File >> "/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/site-packages/py2app-0.5.2-py3.2.egg/py2app/build_app.py", >> line 675, in run_normal >> self.create_binaries(py_files, pkgdirs, extensions, loader_files) >> File >> "/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/site-packages/py2app-0.5.2-py3.2.egg/py2app/build_app.py", >> line 772, in create_binaries >> target, arcname, pkgexts, copyexts, target.script) >> File >> "/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/site-packages/py2app-0.5.2-py3.2.egg/py2app/build_app.py", >> line 1253, in build_executable >> sys.version[:3])), os.path.join(inc_dir, 'pyconfig.h')) >> File >> "/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/distutils/cmd.py", >> line 350, in copy_file >> dry_run=self.dry_run) >> File >> "/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/distutils/file_util.py", >> line 106, in copy_file >> "can't copy '%s': doesn't exist or not a regular file" % src) >> distutils.errors.DistutilsFileError: can't copy >> '/Library/Frameworks/Python.framework/Versions/3.2/include/python3.2/pyconfig.h': >> doesn't exist or not a regular file >>> >>> /Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/distutils/file_util.py(106)copy_file() >> -> "can't copy '%s': doesn't exist or not a regular file" % src) >> (Pdb) >> >> >> From snooping around in >> Library/Frameworks/Python.framework/Versions/3.2/include/ in looks >> like the python folder is named python3.2m rather than just python. >> >> Does this sound familiar or am I barking up the wrong tree? >> >> Oh. OS 10.6.6 Python 3.2 64bit >> >> Thanks, >> >> Dan >> _______________________________________________ >> 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 Wed Mar 16 15:25:00 2011 From: ronaldoussoren at mac.com (Ronald Oussoren) Date: Wed, 16 Mar 2011 10:25:00 -0400 Subject: [Pythonmac-SIG] py2app and Python 3.2 In-Reply-To: <361e8faf7a74ed8e7864d2ab6788eb2d@rosspixelworks.com> References: <8c7257eaa3f63df0f186d263bc6ccb03@rosspixelworks.com> <361e8faf7a74ed8e7864d2ab6788eb2d@rosspixelworks.com> Message-ID: <3D7F0A00-7C1F-4B9C-91C6-0D6178307D7C@mac.com> On 16 Mar, 2011, at 10:15, Dan Ross wrote: > Hey Ronald- > > Thanks for the response. I now get the following error: > > Traceback (most recent call last): > File "/Library/Frameworks/Python.framework/Versions/3.2/bin/py2applet", line 9, in > load_entry_point('py2app==0.6', 'console_scripts', 'py2applet')() > File "/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/site-packages/py2app-0.6-py3.2.egg/py2app/script_py2applet.py", line 132, in main > make_setup(args, scripts, data_files, options) > File "/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/site-packages/py2app-0.6-py3.2.egg/py2app/script_py2applet.py", line 163, in make_setup > f.write(SETUP_TEMPLATE % tvars) > TypeError: 'str' does not support the buffer interface Oh cool, another bytes<->unicode issue. I hadn't looked at py2applet yet... If you open the script_py2applet.py file (the full location is in the traceback) look for ' f.write(SETUP_TEMPLATE % tvars)' you'll see a call to open two lines up. That currently has 'rb' as the last argument, change that to 'r' and py2applet should magically start to work again. I'll commit a fix once I've written a unittest[*] for this. Ronald [*] for a particular odd definition of 'unit', the py2app unittests are currently more integration tests. Fixing that can wait... > > > Dan > > On Tue, 15 Mar 2011 09:10:14 -0400, Ronald Oussoren wrote: >> On 14 Mar, 2011, at 18:53, Dan Ross wrote: >> >>> Hi all- >>> >>> I have a very small and simple Tkinter/Python 3.2 app that I'm trying to bundle with py2app. >> >> I'm currently sprinting at Pycon and will do a new release >> afterwards. The current tip of the development repositories should >> work though, although they are lightly tested at the moment. >> >> The repositories are: >> * https://bitbucket.org/ronaldoussoren/altgraph >> * https://bitbucket.org/ronaldoussoren/macholib >> * https://bitbucket.org/ronaldoussoren/modulegraph >> * https://bitbucket.org/ronaldoussoren/py2app >> >> You'll have to install the packages in this order, there have bee >> some API additions and bugfixes that require you to install all of >> them. >> >> My focus with the sprints is on CPython bugfixes as well improving >> the documentation and test coverage of py2app and supporting modules >> (whereby "improving the test coverage" means that I've started at no >> coverage at all a month or so ago). >> >> Ronald >> >>> >>> After updating py2app and it's dependencies to "dev" versions I still get the following error: >>> >>> >>> *** creating application bundle: gui *** >>> Traceback (most recent call last): >>> File "/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/site-packages/py2app-0.5.2-py3.2.egg/py2app/build_app.py", line 604, in _run >>> self.run_normal() >>> File "/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/site-packages/py2app-0.5.2-py3.2.egg/py2app/build_app.py", line 675, in run_normal >>> self.create_binaries(py_files, pkgdirs, extensions, loader_files) >>> File "/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/site-packages/py2app-0.5.2-py3.2.egg/py2app/build_app.py", line 772, in create_binaries >>> target, arcname, pkgexts, copyexts, target.script) >>> File "/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/site-packages/py2app-0.5.2-py3.2.egg/py2app/build_app.py", line 1253, in build_executable >>> sys.version[:3])), os.path.join(inc_dir, 'pyconfig.h')) >>> File "/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/distutils/cmd.py", line 350, in copy_file >>> dry_run=self.dry_run) >>> File "/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/distutils/file_util.py", line 106, in copy_file >>> "can't copy '%s': doesn't exist or not a regular file" % src) >>> distutils.errors.DistutilsFileError: can't copy '/Library/Frameworks/Python.framework/Versions/3.2/include/python3.2/pyconfig.h': doesn't exist or not a regular file >>>> /Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/distutils/file_util.py(106)copy_file() >>> -> "can't copy '%s': doesn't exist or not a regular file" % src) >>> (Pdb) >>> >>> >>> From snooping around in Library/Frameworks/Python.framework/Versions/3.2/include/ in looks like the python folder is named python3.2m rather than just python. >>> >>> Does this sound familiar or am I barking up the wrong tree? >>> >>> Oh. OS 10.6.6 Python 3.2 64bit >>> >>> Thanks, >>> >>> Dan >>> _______________________________________________ >>> 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 dan at rosspixelworks.com Wed Mar 16 15:30:38 2011 From: dan at rosspixelworks.com (Dan Ross) Date: Wed, 16 Mar 2011 09:30:38 -0500 Subject: [Pythonmac-SIG] py2app and Python 3.2 In-Reply-To: <3D7F0A00-7C1F-4B9C-91C6-0D6178307D7C@mac.com> References: <8c7257eaa3f63df0f186d263bc6ccb03@rosspixelworks.com> <361e8faf7a74ed8e7864d2ab6788eb2d@rosspixelworks.com> <3D7F0A00-7C1F-4B9C-91C6-0D6178307D7C@mac.com> Message-ID: <4df1711948a73a8aa3d3111034415cd1@rosspixelworks.com> Got it. It's 'wb' to 'w' though right? On Wed, 16 Mar 2011 10:25:00 -0400, Ronald Oussoren wrote: > On 16 Mar, 2011, at 10:15, Dan Ross wrote: > >> Hey Ronald- >> >> Thanks for the response. I now get the following error: >> >> Traceback (most recent call last): >> File >> "/Library/Frameworks/Python.framework/Versions/3.2/bin/py2applet", >> line 9, in >> load_entry_point('py2app==0.6', 'console_scripts', 'py2applet')() >> File >> "/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/site-packages/py2app-0.6-py3.2.egg/py2app/script_py2applet.py", >> line 132, in main >> make_setup(args, scripts, data_files, options) >> File >> "/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/site-packages/py2app-0.6-py3.2.egg/py2app/script_py2applet.py", >> line 163, in make_setup >> f.write(SETUP_TEMPLATE % tvars) >> TypeError: 'str' does not support the buffer interface > > Oh cool, another bytes<->unicode issue. I hadn't looked at py2applet > yet... > > If you open the script_py2applet.py file (the full location is in the > traceback) look for ' f.write(SETUP_TEMPLATE % tvars)' you'll see a > call to open two lines up. That currently has 'rb' as the last > argument, change that to 'r' and py2applet should magically start to > work again. > > I'll commit a fix once I've written a unittest[*] for this. > > Ronald > > [*] for a particular odd definition of 'unit', the py2app unittests > are currently more integration tests. Fixing that can wait... > >> >> >> Dan >> >> On Tue, 15 Mar 2011 09:10:14 -0400, Ronald Oussoren >> wrote: >>> On 14 Mar, 2011, at 18:53, Dan Ross wrote: >>> >>>> Hi all- >>>> >>>> I have a very small and simple Tkinter/Python 3.2 app that I'm >>>> trying to bundle with py2app. >>> >>> I'm currently sprinting at Pycon and will do a new release >>> afterwards. The current tip of the development repositories should >>> work though, although they are lightly tested at the moment. >>> >>> The repositories are: >>> * https://bitbucket.org/ronaldoussoren/altgraph >>> * https://bitbucket.org/ronaldoussoren/macholib >>> * https://bitbucket.org/ronaldoussoren/modulegraph >>> * https://bitbucket.org/ronaldoussoren/py2app >>> >>> You'll have to install the packages in this order, there have bee >>> some API additions and bugfixes that require you to install all of >>> them. >>> >>> My focus with the sprints is on CPython bugfixes as well improving >>> the documentation and test coverage of py2app and supporting >>> modules >>> (whereby "improving the test coverage" means that I've started at >>> no >>> coverage at all a month or so ago). >>> >>> Ronald >>> >>>> >>>> After updating py2app and it's dependencies to "dev" versions I >>>> still get the following error: >>>> >>>> >>>> *** creating application bundle: gui *** >>>> Traceback (most recent call last): >>>> File >>>> "/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/site-packages/py2app-0.5.2-py3.2.egg/py2app/build_app.py", >>>> line 604, in _run >>>> self.run_normal() >>>> File >>>> "/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/site-packages/py2app-0.5.2-py3.2.egg/py2app/build_app.py", >>>> line 675, in run_normal >>>> self.create_binaries(py_files, pkgdirs, extensions, >>>> loader_files) >>>> File >>>> "/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/site-packages/py2app-0.5.2-py3.2.egg/py2app/build_app.py", >>>> line 772, in create_binaries >>>> target, arcname, pkgexts, copyexts, target.script) >>>> File >>>> "/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/site-packages/py2app-0.5.2-py3.2.egg/py2app/build_app.py", >>>> line 1253, in build_executable >>>> sys.version[:3])), os.path.join(inc_dir, 'pyconfig.h')) >>>> File >>>> "/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/distutils/cmd.py", >>>> line 350, in copy_file >>>> dry_run=self.dry_run) >>>> File >>>> "/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/distutils/file_util.py", >>>> line 106, in copy_file >>>> "can't copy '%s': doesn't exist or not a regular file" % src) >>>> distutils.errors.DistutilsFileError: can't copy >>>> '/Library/Frameworks/Python.framework/Versions/3.2/include/python3.2/pyconfig.h': >>>> doesn't exist or not a regular file >>>>> >>>>> /Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/distutils/file_util.py(106)copy_file() >>>> -> "can't copy '%s': doesn't exist or not a regular file" % src) >>>> (Pdb) >>>> >>>> >>>> From snooping around in >>>> Library/Frameworks/Python.framework/Versions/3.2/include/ in looks >>>> like the python folder is named python3.2m rather than just python. >>>> >>>> Does this sound familiar or am I barking up the wrong tree? >>>> >>>> Oh. OS 10.6.6 Python 3.2 64bit >>>> >>>> Thanks, >>>> >>>> Dan >>>> _______________________________________________ >>>> 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 dan at rosspixelworks.com Wed Mar 16 16:20:22 2011 From: dan at rosspixelworks.com (Dan Ross) Date: Wed, 16 Mar 2011 10:20:22 -0500 Subject: [Pythonmac-SIG] py2app and Python 3.2 In-Reply-To: <3D7F0A00-7C1F-4B9C-91C6-0D6178307D7C@mac.com> References: <8c7257eaa3f63df0f186d263bc6ccb03@rosspixelworks.com> <361e8faf7a74ed8e7864d2ab6788eb2d@rosspixelworks.com> <3D7F0A00-7C1F-4B9C-91C6-0D6178307D7C@mac.com> Message-ID: <479e7b1e1189337774801ea7404782bd@rosspixelworks.com> Ok, the .app bundles successfully, HOWEVER, at the end of the output I get: creating /Users/danr/Projects/hamilton_py3/dist/gui.app/Contents/Frameworks/Tcl.framework linking /Users/danr/Projects/hamilton_py3/dist/gui.app/Contents/Frameworks/Tcl.framework/libtclstub8.5.a -> Versions/8.5/libtclstub8.5.a error: No such file or directory: /Users/danr/Projects/hamilton_py3/dist/gui.app/Contents/Frameworks/Tcl.framework/libtclstub8.5.a There are also a bunch of folders (html, xml, email, distutils, etc.) that look like they weren't cleaned up? Thanks for the hard work Ronald. On Wed, 16 Mar 2011 10:25:00 -0400, Ronald Oussoren wrote: > On 16 Mar, 2011, at 10:15, Dan Ross wrote: > >> Hey Ronald- >> >> Thanks for the response. I now get the following error: >> >> Traceback (most recent call last): >> File >> "/Library/Frameworks/Python.framework/Versions/3.2/bin/py2applet", >> line 9, in >> load_entry_point('py2app==0.6', 'console_scripts', 'py2applet')() >> File >> "/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/site-packages/py2app-0.6-py3.2.egg/py2app/script_py2applet.py", >> line 132, in main >> make_setup(args, scripts, data_files, options) >> File >> "/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/site-packages/py2app-0.6-py3.2.egg/py2app/script_py2applet.py", >> line 163, in make_setup >> f.write(SETUP_TEMPLATE % tvars) >> TypeError: 'str' does not support the buffer interface > > Oh cool, another bytes<->unicode issue. I hadn't looked at py2applet > yet... > > If you open the script_py2applet.py file (the full location is in the > traceback) look for ' f.write(SETUP_TEMPLATE % tvars)' you'll see a > call to open two lines up. That currently has 'rb' as the last > argument, change that to 'r' and py2applet should magically start to > work again. > > I'll commit a fix once I've written a unittest[*] for this. > > Ronald > > [*] for a particular odd definition of 'unit', the py2app unittests > are currently more integration tests. Fixing that can wait... > >> >> >> Dan >> >> On Tue, 15 Mar 2011 09:10:14 -0400, Ronald Oussoren >> wrote: >>> On 14 Mar, 2011, at 18:53, Dan Ross wrote: >>> >>>> Hi all- >>>> >>>> I have a very small and simple Tkinter/Python 3.2 app that I'm >>>> trying to bundle with py2app. >>> >>> I'm currently sprinting at Pycon and will do a new release >>> afterwards. The current tip of the development repositories should >>> work though, although they are lightly tested at the moment. >>> >>> The repositories are: >>> * https://bitbucket.org/ronaldoussoren/altgraph >>> * https://bitbucket.org/ronaldoussoren/macholib >>> * https://bitbucket.org/ronaldoussoren/modulegraph >>> * https://bitbucket.org/ronaldoussoren/py2app >>> >>> You'll have to install the packages in this order, there have bee >>> some API additions and bugfixes that require you to install all of >>> them. >>> >>> My focus with the sprints is on CPython bugfixes as well improving >>> the documentation and test coverage of py2app and supporting >>> modules >>> (whereby "improving the test coverage" means that I've started at >>> no >>> coverage at all a month or so ago). >>> >>> Ronald >>> >>>> >>>> After updating py2app and it's dependencies to "dev" versions I >>>> still get the following error: >>>> >>>> >>>> *** creating application bundle: gui *** >>>> Traceback (most recent call last): >>>> File >>>> "/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/site-packages/py2app-0.5.2-py3.2.egg/py2app/build_app.py", >>>> line 604, in _run >>>> self.run_normal() >>>> File >>>> "/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/site-packages/py2app-0.5.2-py3.2.egg/py2app/build_app.py", >>>> line 675, in run_normal >>>> self.create_binaries(py_files, pkgdirs, extensions, >>>> loader_files) >>>> File >>>> "/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/site-packages/py2app-0.5.2-py3.2.egg/py2app/build_app.py", >>>> line 772, in create_binaries >>>> target, arcname, pkgexts, copyexts, target.script) >>>> File >>>> "/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/site-packages/py2app-0.5.2-py3.2.egg/py2app/build_app.py", >>>> line 1253, in build_executable >>>> sys.version[:3])), os.path.join(inc_dir, 'pyconfig.h')) >>>> File >>>> "/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/distutils/cmd.py", >>>> line 350, in copy_file >>>> dry_run=self.dry_run) >>>> File >>>> "/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/distutils/file_util.py", >>>> line 106, in copy_file >>>> "can't copy '%s': doesn't exist or not a regular file" % src) >>>> distutils.errors.DistutilsFileError: can't copy >>>> '/Library/Frameworks/Python.framework/Versions/3.2/include/python3.2/pyconfig.h': >>>> doesn't exist or not a regular file >>>>> >>>>> /Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/distutils/file_util.py(106)copy_file() >>>> -> "can't copy '%s': doesn't exist or not a regular file" % src) >>>> (Pdb) >>>> >>>> >>>> From snooping around in >>>> Library/Frameworks/Python.framework/Versions/3.2/include/ in looks >>>> like the python folder is named python3.2m rather than just python. >>>> >>>> Does this sound familiar or am I barking up the wrong tree? >>>> >>>> Oh. OS 10.6.6 Python 3.2 64bit >>>> >>>> Thanks, >>>> >>>> Dan >>>> _______________________________________________ >>>> 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 Wed Mar 16 16:28:30 2011 From: ronaldoussoren at mac.com (Ronald Oussoren) Date: Wed, 16 Mar 2011 11:28:30 -0400 Subject: [Pythonmac-SIG] py2app and Python 3.2 In-Reply-To: <479e7b1e1189337774801ea7404782bd@rosspixelworks.com> References: <8c7257eaa3f63df0f186d263bc6ccb03@rosspixelworks.com> <361e8faf7a74ed8e7864d2ab6788eb2d@rosspixelworks.com> <3D7F0A00-7C1F-4B9C-91C6-0D6178307D7C@mac.com> <479e7b1e1189337774801ea7404782bd@rosspixelworks.com> Message-ID: <395EC6E1-7259-4370-907F-2780F20C464F@mac.com> On 16 Mar, 2011, at 11:20, Dan Ross wrote: > Ok, the .app bundles successfully, HOWEVER, at the end of the output I get: > > creating /Users/danr/Projects/hamilton_py3/dist/gui.app/Contents/Frameworks/Tcl.framework > linking /Users/danr/Projects/hamilton_py3/dist/gui.app/Contents/Frameworks/Tcl.framework/libtclstub8.5.a -> Versions/8.5/libtclstub8.5.a > error: No such file or directory: /Users/danr/Projects/hamilton_py3/dist/gui.app/Contents/Frameworks/Tcl.framework/libtclstub8.5.a Could you create a small example that demonstrates the problem? That would make it easier to debug the issue. Ronald From dan at rosspixelworks.com Wed Mar 16 16:32:05 2011 From: dan at rosspixelworks.com (Dan Ross) Date: Wed, 16 Mar 2011 10:32:05 -0500 Subject: [Pythonmac-SIG] py2app and Python 3.2 In-Reply-To: <395EC6E1-7259-4370-907F-2780F20C464F@mac.com> References: <8c7257eaa3f63df0f186d263bc6ccb03@rosspixelworks.com> <361e8faf7a74ed8e7864d2ab6788eb2d@rosspixelworks.com> <3D7F0A00-7C1F-4B9C-91C6-0D6178307D7C@mac.com> <479e7b1e1189337774801ea7404782bd@rosspixelworks.com> <395EC6E1-7259-4370-907F-2780F20C464F@mac.com> Message-ID: Certainly. Here's the code I'm working with. Dan On Wed, 16 Mar 2011 11:28:30 -0400, Ronald Oussoren wrote: > On 16 Mar, 2011, at 11:20, Dan Ross wrote: > >> Ok, the .app bundles successfully, HOWEVER, at the end of the output >> I get: >> >> creating >> /Users/danr/Projects/hamilton_py3/dist/gui.app/Contents/Frameworks/Tcl.framework >> linking >> /Users/danr/Projects/hamilton_py3/dist/gui.app/Contents/Frameworks/Tcl.framework/libtclstub8.5.a >> -> Versions/8.5/libtclstub8.5.a >> error: No such file or directory: >> /Users/danr/Projects/hamilton_py3/dist/gui.app/Contents/Frameworks/Tcl.framework/libtclstub8.5.a > > Could you create a small example that demonstrates the problem? That > would make it easier to debug the issue. > > Ronald -------------- next part -------------- A non-text attachment was scrubbed... Name: example.zip Type: application/zip Size: 142 bytes Desc: not available URL: From dan at rosspixelworks.com Thu Mar 17 19:57:19 2011 From: dan at rosspixelworks.com (Dan Ross) Date: Thu, 17 Mar 2011 13:57:19 -0500 Subject: [Pythonmac-SIG] =?utf-8?q?Appscript_and_Excel_save=5Fas?= Message-ID: <45c8eb0a0944a3e47fd19ca3c52ecaa4@rosspixelworks.com> Hi there- I have the following AppleScript: set theOutputPath to (path to desktop folder as string) & "My Saved Workbook.csv" tell application "Microsoft Excel" tell active workbook save workbook as filename theOutputPath file format CSV file format end tell end tell This works fine. When I try to use appscript I cannot get the stinking spreadsheet to save as a CSV file with the following: from appscript import * excel = app('/Applications/Microsoft Office 2008/Microsoft Excel') excel.open('/Users/danr/Desktop/Test.xlsx') name = excel.worksheets[1].name.get() print(name) excel.worksheets[1].save_as(filename = 'boogers.csv', file_format = "CSV") Any pointers? Thanks, Dan -------------- next part -------------- An HTML attachment was scrubbed... URL: From dan at rosspixelworks.com Fri Mar 18 14:32:06 2011 From: dan at rosspixelworks.com (Dan Ross) Date: Fri, 18 Mar 2011 08:32:06 -0500 Subject: [Pythonmac-SIG] Pythonmac-SIG Digest, Vol 95, Issue 20 In-Reply-To: References: Message-ID: Ok. I figured the CSV part out, but paths for saving in appscript are kicking my butt. If anyone has any suggestions I'd appreciate them. Thanks, Dan On Fri, 18 Mar 2011 12:00:02 +0100, pythonmac-sig-request at python.org wrote: Hi there- I have the following AppleScript: set theOutputPath to (path to desktop folder as string) & "My Saved Workbook.csv" tell application "Microsoft Excel" tell active workbook save workbook as filename theOutputPath file format CSV file format end tell end tell This works fine. When I try to use appscript I cannot get the stinking spreadsheet to save as a CSV file with the following: from appscript import * excel = app('/Applications/Microsoft Office 2008/Microsoft Excel') excel.open('/Users/danr/Desktop/Test.xlsx') name = excel.worksheets[1].name.get() print(name) excel.worksheets[1].save_as(filename = 'boogers.csv', file_format = "CSV") Any pointers? Thanks, Dan -------------- next part -------------- An HTML attachment was scrubbed... URL: From christian at prinoth.name Fri Mar 18 14:58:33 2011 From: christian at prinoth.name (Christian Prinoth) Date: Fri, 18 Mar 2011 14:58:33 +0100 Subject: [Pythonmac-SIG] Pythonmac-SIG Digest, Vol 95, Issue 20 In-Reply-To: References: Message-ID: maybe you need to use the constant instead of "CSV", i.e. k.CSV_file_format On Fri, Mar 18, 2011 at 12:00, 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. Appscript and Excel save_as (Dan Ross) > > > ---------- Forwarded message ---------- > From: Dan Ross > To: Pythonmac sig > Date: Thu, 17 Mar 2011 13:57:19 -0500 > Subject: [Pythonmac-SIG] Appscript and Excel save_as > > Hi there- > > I have the following AppleScript: > > set theOutputPath to (path to desktop folder as string) & "My Saved > Workbook.csv" > tell application "Microsoft Excel" > tell active workbook > save workbook as filename theOutputPath file format CSV file format > end tell > end tell > > This works fine. When I try to use appscript I cannot get the stinking > spreadsheet to save as a CSV file with the following: > > > > from appscript import * > > excel = app('/Applications/Microsoft Office 2008/Microsoft Excel') > excel.open('/Users/danr/Desktop/Test.xlsx') > name = excel.worksheets[1].name.get() > print(name) > excel.worksheets[1].save_as(filename = 'boogers.csv', file_format = "CSV") > > > > Any pointers? > > > > Thanks, > > > > Dan > > unsubscribe: http://mail.python.org/mailman/options/Pythonmac-SIG > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From rowen at uw.edu Fri Mar 18 20:23:29 2011 From: rowen at uw.edu (Russell E. Owen) Date: Fri, 18 Mar 2011 12:23:29 -0700 Subject: [Pythonmac-SIG] Anyone tried to build python or extensions with XCode 4.0? Message-ID: Has anyone tried to build python or extensions with XCode 4.0? If so, do you have any hints, such as: - Which C compilers to use or avoid - How to make the results backward-compatible with 10.5 and possibly even 10.4 -- Russell From senn at maya.com Fri Mar 18 20:32:31 2011 From: senn at maya.com (Jeff Senn) Date: Fri, 18 Mar 2011 15:32:31 -0400 Subject: [Pythonmac-SIG] Anyone tried to build python or extensions with XCode 4.0? In-Reply-To: References: Message-ID: First, you should become aware of this: http://www.macstories.net/news/developers-xcode-4-will-drop-support-for-10-5-sdk/ In particular the difficult part (i.e. beyond just finding (restoring?) the right library and header files for the SDKs) is that the toolset in XCode 4 has the PPC support removed from it. So... although you can probably without *too* much trouble, build 10.5 intel only (and possibly 10.4 intel only), if you need to support PPC then you'd better keep a copy of XCode 3 around... Note: installing the latest XCode 4 actually *silently* deletes the /Developer/SDKs for 10.4 and 10.5. Nice! On Mar 18, 2011, at 3:23 PM, Russell E. Owen wrote: > Has anyone tried to build python or extensions with XCode 4.0? > If so, do you have any hints, such as: > - Which C compilers to use or avoid > - How to make the results backward-compatible with 10.5 and possibly > even 10.4 > > -- Russell > > _______________________________________________ > 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 livingstonemark at gmail.com Sat Mar 19 02:03:27 2011 From: livingstonemark at gmail.com (Mark Livingstone) Date: Sat, 19 Mar 2011 11:03:27 +1000 Subject: [Pythonmac-SIG] Anyone tried to build python or extensions with XCode 4.0? In-Reply-To: References: Message-ID: Ok, what you say is true for the release version of XCode 4. However, I have just installed XCode 4.0.1. When it installed, it moved my existing XCode 3..26 into the /Developer.old folder. I went in there, ran XCode 3 and with no changes was able to compile a 10.5 SDK version of the CUDA test application. I think Apple has just decided to draw a line in the sand with XCode 4. They are still supporting XCode3 as can be seen by the 3.2.6 release after the release of 4.0.0. I am writing this msg on an Intel Mac Pro which I bought within days of their release so I don't doubt there are G5s still doing Sterling service, but we all know that Apple is not afraid to say "Time to move on". It is not Apple who is begging their customers to stop using IE6!! I can't wait to see what innovative software XCode 4 will inspire us to write. On 19 March 2011 05:32, Jeff Senn wrote: > First, you should become aware of this: > > http://www.macstories.net/news/developers-xcode-4-will-drop-support-for-10-5-sdk/ > > In particular the difficult part (i.e. beyond just finding (restoring?) the right library > and header files for the SDKs) is that the toolset in XCode 4 has the PPC support > removed from it. ?So... although you can probably without *too* much trouble, build 10.5 intel only > (and possibly 10.4 intel only), if you need to support PPC then you'd better keep a copy of > XCode 3 around... > > Note: installing the latest XCode 4 actually *silently* deletes the /Developer/SDKs for 10.4 and 10.5. > Nice! From ronaldoussoren at mac.com Sat Mar 19 22:46:06 2011 From: ronaldoussoren at mac.com (Ronald Oussoren) Date: Sat, 19 Mar 2011 17:46:06 -0400 Subject: [Pythonmac-SIG] Anyone tried to build python or extensions with XCode 4.0? In-Reply-To: References: Message-ID: On 18 Mar, 2011, at 15:32, Jeff Senn wrote: > Note: installing the latest XCode 4 actually *silently* deletes the /Developer/SDKs for 10.4 and 10.5. > Nice! I was unhappily surprised by this as well. That's progress I guess :-( Ronald From ronaldoussoren at mac.com Sat Mar 19 22:50:02 2011 From: ronaldoussoren at mac.com (Ronald Oussoren) Date: Sat, 19 Mar 2011 17:50:02 -0400 Subject: [Pythonmac-SIG] Anyone tried to build python or extensions with XCode 4.0? In-Reply-To: References: Message-ID: <52FA5848-21BF-4973-BC1B-98172EC672E8@mac.com> On 18 Mar, 2011, at 21:03, Mark Livingstone wrote: > > I think Apple has just decided to draw a line in the sand with XCode > 4. They are still supporting XCode3 as can be seen by the 3.2.6 > release after the release of 4.0.0. I am writing this msg on an Intel > Mac Pro which I bought within days of their release so I don't doubt > there are G5s still doing Sterling service, but we all know that Apple > is not afraid to say "Time to move on". It is not Apple who is begging > their customers to stop using IE6!! Sure, but this move means that anyone using Xcode4 will have a hard time to build extensions for the 32-bit installers on OSX, those are hardcoded to build extensions for PPC and i386 and use the 10.4u SDK. I'll write something to include on the Macintosh page on www.python.org and will work on fixes for the next releases of Python, but AFAIK those are still months off (and I don't think this issue is something to rush those releases for). I'll see if I can write a small project that can be easy-installed and tweaks the distutils configuration when it is installed (using pth-trickery). Ronald From senn at maya.com Sun Mar 20 23:32:37 2011 From: senn at maya.com (Jeff Senn) Date: Sun, 20 Mar 2011 18:32:37 -0400 Subject: [Pythonmac-SIG] Anyone tried to build python or extensions with XCode 4.0? In-Reply-To: <52FA5848-21BF-4973-BC1B-98172EC672E8@mac.com> References: <52FA5848-21BF-4973-BC1B-98172EC672E8@mac.com> Message-ID: <5DE33851-9EC3-415F-ACA7-EF70BB9BEAA7@maya.com> On Mar 19, 2011, at 5:50 PM, Ronald Oussoren wrote: > > On 18 Mar, 2011, at 21:03, Mark Livingstone wrote: >> >> I think Apple has just decided to draw a line in the sand with XCode >> 4. They are still supporting XCode3 as can be seen by the 3.2.6 >> release after the release of 4.0.0. I am writing this msg on an Intel >> Mac Pro which I bought within days of their release so I don't doubt >> there are G5s still doing Sterling service, but we all know that Apple >> is not afraid to say "Time to move on". It is not Apple who is begging >> their customers to stop using IE6!! > > Sure, but this move means that anyone using Xcode4 will have a hard time to build extensions for the 32-bit installers on OSX, those are hardcoded to build extensions for PPC and i386 and use the 10.4u SDK. Yeah - this is especially ironic since the Apple-shipped python on Snow Leopard is also dependent on building PPC-compatible extensions... > > I'll write something to include on the Macintosh page on www.python.org and will work on fixes for the next releases of Python, but AFAIK those are still months off (and I don't think this issue is something to rush those releases for). I'll see if I can write a small project that can be easy-installed and tweaks the distutils configuration when it is installed (using pth-trickery). > > 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 > From cappy2112 at gmail.com Mon Mar 21 20:00:40 2011 From: cappy2112 at gmail.com (Tony Cappellini) Date: Mon, 21 Mar 2011 12:00:40 -0700 Subject: [Pythonmac-SIG] Can't import pyserial- after installing with easy_install on OSX 10.6.6 Message-ID: I've installed pyserail via easy_install by -> easy_install pyserial When I import pyserial, it cannot be found. Looking at /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages pyserial doesn't have a directory via the same name. There is this pyserial-2.5-py2.7.egg however. Is this typical for installing packages on OSX? Did the installer not complete? -------------- next part -------------- An HTML attachment was scrubbed... URL: From nad at acm.org Tue Mar 22 00:20:40 2011 From: nad at acm.org (Ned Deily) Date: Mon, 21 Mar 2011 16:20:40 -0700 Subject: [Pythonmac-SIG] Can't import pyserial- after installing with easy_install on OSX 10.6.6 References: Message-ID: In article , Tony Cappellini wrote: > I've installed pyserail via easy_install by -> easy_install pyserial > > When I import pyserial, it cannot be found. > > Looking > at > /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages > pyserial doesn't have a directory via the same name. > > There is this pyserial-2.5-py2.7.egg however. > > Is this typical for installing packages on OSX? > Did the installer not complete? That's what you would expect using easy_install. Distributions get installed into either a directory like that or a zipfile version of the directory. But, somewhat confusingly, it appears the module name is "serial". http://pyserial.sourceforge.net/shortintro.html#configuring-ports-later After installing, "import serial" works for me. I don't have a serial port on this machine to try anything further, though. -- Ned Deily, nad at acm.org From cappy2112 at gmail.com Wed Mar 23 04:17:35 2011 From: cappy2112 at gmail.com (Tony Cappellini) Date: Tue, 22 Mar 2011 20:17:35 -0700 Subject: [Pythonmac-SIG] Can't import pyserial- after installing with easy_install on OSX 10.6.6 Message-ID: From: Ned Deily > To: pythonmac-sig at python.org > Date: Mon, 21 Mar 2011 16:20:40 -0700 > Subject: Re: [Pythonmac-SIG] Can't import pyserial- after installing with > easy_install on OSX 10.6.6 > In article > > That's what you would expect using easy_install. Distributions get > installed into either a directory like that or a zipfile version of the > directory. > > >>But, somewhat confusingly, it appears the module name is "serial". > > http://pyserial.sourceforge.net/shortintro.html#configuring-ports-later > > Agreed. Silly me for thinking the module name was the same as the package. I read that page more than once too. Grrr Pyserial works fine now. Thanks Ned. -------------- next part -------------- An HTML attachment was scrubbed... URL: From ronaldoussoren at mac.com Tue Mar 29 08:36:51 2011 From: ronaldoussoren at mac.com (Ronald Oussoren) Date: Tue, 29 Mar 2011 08:36:51 +0200 Subject: [Pythonmac-SIG] py2app 0.6 Message-ID: <3A7C0676-2B56-4DE7-85AB-23DDBE4D8206@mac.com> I've just upload py2app 0.6 to PyPI (as well as new versions of altgraph, modulegraph and macholib). These are primairily a bugfix releases, and I've been working on (unit)tests for these packages. That work isn't finished yet, the codebase of modulegraph and py2app doesn't lean itself to proper unittests (too much unnecessary interdependencies) which makes writing the tests hard. But at least there now is a testsuite that will grow in future releases. The unittests ran successfully with python 2.5 upto 3.2. Ronald From hstrey at notes.cc.sunysb.edu Wed Mar 23 20:21:22 2011 From: hstrey at notes.cc.sunysb.edu (hstrey at notes.cc.sunysb.edu) Date: Wed, 23 Mar 2011 15:21:22 -0400 Subject: [Pythonmac-SIG] a word of warning for pyobjc users Message-ID: I am currently working with XCode 4 and PyObjC. Despite the earlier warning, XCode 4's interface builder supports python. So, for example, objc.IBOutlet() and @objc.IBAction are showing up as outlets and actions for making connections in interface builder. I also have no problems importing classes from python to the interface builder. Let me know if anyone finds things that do not work Helmut H. Strey, Ph.D. website: http://streylab.neuropraxia.webfactional.com http://streylab.wordpress.com It is a good morning exercise for a research scientist to discard a pet hypothesis every day before breakfast. It keeps him young (Konrad Lorenz (1903-1989)) -------------- next part -------------- An HTML attachment was scrubbed... URL: From ronaldoussoren at mac.com Tue Mar 29 15:06:48 2011 From: ronaldoussoren at mac.com (Ronald Oussoren) Date: Tue, 29 Mar 2011 15:06:48 +0200 Subject: [Pythonmac-SIG] a word of warning for pyobjc users In-Reply-To: References: Message-ID: On 23 Mar, 2011, at 20:21, hstrey at notes.cc.sunysb.edu wrote: > I am currently working with XCode 4 and PyObjC. Despite the earlier warning, XCode 4's interface builder supports python. > So, for example, objc.IBOutlet() and @objc.IBAction are showing up as outlets and actions for making connections in > interface builder. I also have no problems importing classes from python to the interface builder. > > Let me know if anyone finds things that do not work Cool, I hadn't checked the final release yet. Ronald -------------- next part -------------- An HTML attachment was scrubbed... URL: From rowen at uw.edu Tue Mar 29 22:02:47 2011 From: rowen at uw.edu (Russell E. Owen) Date: Tue, 29 Mar 2011 13:02:47 -0700 Subject: [Pythonmac-SIG] Problem with py2app 0.6 Message-ID: I used easy_install to install py2app 0.6 and tried it out on one of several applications I distribute. Unfortunately the build failed with; *** using recipe: virtualenv *** *** using recipe: PIL *** *** using recipe: matplotlib *** *** using recipe: pydoc *** *** using recipe: scipy *** *** using recipe: pygame *** *** using recipe: numpy *** *** filtering dependencies *** 1156 total 82 filtered 11 orphaned 1074 remaining *** create binaries *** *** byte compile python files *** XXX byte-compiling fn=/Users/rowen/TUI_1.8.6_Source/BuildForMac/build/bdist.macosx-10.4-fat/ python2.6-standalone/app/collect/ConfigParser.pyc.py cfile=/Users/rowen/TUI_1.8.6_Source/BuildForMac/build/bdist.macosx-10.4-f at/python2.6-standalone/app/collect/ConfigParser.pyc dfile=ConfigParser.pyc ... XXX byte-compiling fn=/Users/rowen/TUI_1.8.6_Source/BuildForMac/build/bdist.macosx-10.4-fat/ python2.6-standalone/app/collect/pygame/transform.pyc.py cfile=/Users/rowen/TUI_1.8.6_Source/BuildForMac/build/bdist.macosx-10.4-f at/python2.6-standalone/app/collect/pygame/transform.pyc dfile=pygame/transform.pyc error: cannot copy tree '/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/test/zip dir.zip': not a directory I've never heard of the file in the error message (.../test/zipdir.zip) but it does in fact exist. I have appended my setup.py in case it is of any help. -- Russell My setup.py: import os import platform from plistlib import Plist import shutil import subprocess import sys from setuptools import setup # If True a universal binary is built; if False a PPC-only version is built # Only set true if all extensions are universal binaries and Aqua Tcl/Tk is sufficiently reliable UniversalBinaryOK = True # add tuiRoot to sys.path before importing RO or TUI tuiRoot = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) roRoot = os.path.join(tuiRoot, "ROPackage") sys.path = [roRoot, tuiRoot] + sys.path import TUI.Version appName = TUI.Version.ApplicationName mainProg = os.path.join(tuiRoot, "runtuiWithLog.py") iconFile = "%s.icns" % appName appPath = os.path.join("dist", "%s.app" % (appName,)) contentsDir = os.path.join(appPath, "Contents") fullVersStr = TUI.Version.VersionStr shortVersStr = fullVersStr.split(None, 1)[0] inclModules = ( "FileDialog", ) # packages to include recursively inclPackages = ( "TUI", "RO", "matplotlib", # py2app already does this, but it doesn't hurt to insist ) plist = Plist( CFBundleName = appName, CFBundleShortVersionString = shortVersStr, CFBundleGetInfoString = "%s %s" % (appName, fullVersStr), CFBundleExecutable = appName, LSPrefersPPC = not UniversalBinaryOK, ) setup( app = [mainProg], setup_requires = ["py2app"], options = dict( py2app = dict ( plist = plist, iconfile = iconFile, includes = inclModules, packages = inclPackages, ) ), ) From ronaldoussoren at mac.com Wed Mar 30 07:58:51 2011 From: ronaldoussoren at mac.com (Ronald Oussoren) Date: Wed, 30 Mar 2011 07:58:51 +0200 Subject: [Pythonmac-SIG] Problem with py2app 0.6 In-Reply-To: References: Message-ID: <4A82F88F-1527-40F7-8FC2-293065A66A84@mac.com> On 29 Mar, 2011, at 22:02, Russell E. Owen wrote: > I used easy_install to install py2app 0.6 and tried it out on one of > several applications I distribute. Unfortunately the build failed with; The testsuite is obviously not good enough yet to catch all errors. I've done some changes in how py2app deals with source files to clean up the code that deals with zipped egg files, and that obviously introduced a problem. I'll look into this, but that will at best be tonight (in CEST), and otherwise next sunday. BTW. Which version of python do you use? This is not related to this issue, but why do you use inclModules and inclPackages? Does py2app not copy those resources automaticly? And if not, do you use dynamic imports or only import statements? Ronald From rowen at uw.edu Wed Mar 30 17:25:34 2011 From: rowen at uw.edu (Russell Owen) Date: Wed, 30 Mar 2011 08:25:34 -0700 Subject: [Pythonmac-SIG] Problem with py2app 0.6 In-Reply-To: <4A82F88F-1527-40F7-8FC2-293065A66A84@mac.com> References: <4A82F88F-1527-40F7-8FC2-293065A66A84@mac.com> Message-ID: On Mar 29, 2011, at 10:58 PM, Ronald Oussoren wrote: > > On 29 Mar, 2011, at 22:02, Russell E. Owen wrote: > >> I used easy_install to install py2app 0.6 and tried it out on one of >> several applications I distribute. Unfortunately the build failed with; > > The testsuite is obviously not good enough yet to catch all errors. I've done some changes in how py2app deals with source files to clean up the code that deals with zipped egg files, and that obviously introduced a problem. > > I'll look into this, but that will at best be tonight (in CEST), and otherwise next sunday. Thank you. No rush. The old version (which I saved by archiving my site-packages) works fine. (My code has is a fairly severe test of py2app, so I upgrade cautiously.) Let me know if there are any tests you want performed. > BTW. Which version of python do you use? That result was with Python 2.6.6 (from python.org). > This is not related to this issue, but why do you use inclModules and inclPackages? Does py2app not copy those resources automaticly? And if not, do you use dynamic imports or only import statements? For the most part it's due to dynamic loading. The application (named TUI) supports dynamically loaded scripts which may use any part of TUI, RO or matplotlib. I want to be sure the full packages are available even if some bits aren't used by the statically loaded main code. I'm not sure why that one Tk dialog module needs to be manually specified; certainly at one time if I didn't specify it then the application would fail. Maybe it's no longer needed. (Scripts don't use dialog boxes, so it's not due to dynamic loading). BTW: I'm also not allowing my code to be zipped up because I use __file__ to locate some non-code resources and the dynamically loaded scripts. I should convert that code but I'm not sure if there's a standard technique that will have long-term support. I recall that the 3rd party setuptools has something, but easy_install seems to be in flux. -- Russell From Chris.Barker at noaa.gov Wed Mar 30 17:43:49 2011 From: Chris.Barker at noaa.gov (Christopher Barker) Date: Wed, 30 Mar 2011 08:43:49 -0700 Subject: [Pythonmac-SIG] Problem with py2app 0.6 In-Reply-To: References: <4A82F88F-1527-40F7-8FC2-293065A66A84@mac.com> Message-ID: <4D934FB5.9000902@noaa.gov> On 3/30/11 8:25 AM, Russell Owen wrote: > BTW: I'm also not allowing my code to be zipped up because I use __file__ to locate some non-code resources and the dynamically loaded scripts. I should convert that code but I'm not sure if there's a standard technique that will have long-term support. I recall that the 3rd party setuptools has something, but easy_install seems to be in flux. Indeed setuptools does provide that feature, but frankly, it doesn't work well with py2app (or py2exe) packages. You can get it to work but only by copying the entire egg into the bundle as-is, and hand-including setuptools itself (that may have changed, I haven't tried lately). In short, your __file__ method is probably easier to deal with, as you know exactly what it's doing. py2app has its own way of dealing with non-code resources, but it's really for application specific resources, rather than package-specific. -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 lists at joshpowell.net Wed Mar 30 22:54:54 2011 From: lists at joshpowell.net (Josh Powell) Date: Wed, 30 Mar 2011 15:54:54 -0500 Subject: [Pythonmac-SIG] py2app, argv-emulation, and 64-bit Message-ID: <982E2F6F-3A39-413D-85F7-CC6731868E8D@joshpowell.net> Hi all- I'm still relatively new to python, and very new to py2app. I'm looking for a workaround to the issue that "argv-emulation is not supported for 64-bit executables." I have a fairly simple script that processes a text file, and would like to make a drag and drop app for users who aren't comfortable with the command line. Could anyone suggest a way around this error? My next move is to try building in Leopard, but would appreciate other suggestions (esp. if they don't require my finding a Leopard system.) TIA, Josh Powell