From ronaldoussoren at mac.com Sat Jul 1 18:34:17 2006 From: ronaldoussoren at mac.com (Ronald Oussoren) Date: Sat, 1 Jul 2006 18:34:17 +0200 Subject: [Pythonmac-SIG] Universal binary build of py2app application won't run on 10.3.9 In-Reply-To: <44A42427.6030600@noaa.gov> References: <41367AA3-2351-4E5E-8E64-FFB61B4D8176@redivi.com> <44A2CE78.9080706@hotmail.com> <9EA1A2B0-77D5-4429-A94F-996D682B6CEC@redivi.com> <44A42427.6030600@noaa.gov> Message-ID: <0DF06D45-F331-460D-9837-69A03D8B7495@mac.com> On Jun 29, 2006, at 9:04 PM, Christopher Barker wrote: > Michael Glassford wrote: >>> """ >>>> Note that dylibs and frameworks >>>> in vendor locations (/System and /usr - except for /usr/local) >>>> are NOT >>>> included in your application bundle. >>> """ > > Would it be hard to put a little hack in Py2App to include that > particular lib, even though it is in /usr? That would be fairly easy, but shouldn't be part of py2app. You'd start shipping parts of MacOSX with your application and that is legally muddy at best. Ronald -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 2157 bytes Desc: not available Url : http://mail.python.org/pipermail/pythonmac-sig/attachments/20060701/8d541580/attachment.bin From ronaldoussoren at mac.com Sat Jul 1 18:36:12 2006 From: ronaldoussoren at mac.com (Ronald Oussoren) Date: Sat, 1 Jul 2006 18:36:12 +0200 Subject: [Pythonmac-SIG] Universal binary build of py2app application won't run on 10.3.9 In-Reply-To: References: <41367AA3-2351-4E5E-8E64-FFB61B4D8176@redivi.com> <44A2CE78.9080706@hotmail.com> <9EA1A2B0-77D5-4429-A94F-996D682B6CEC@redivi.com> <1E1E9D7C-1FD4-4A4E-BAE5-397F0648E735@mac.com> Message-ID: On Jun 29, 2006, at 9:04 PM, Michael Glassford wrote: > Ronald Oussoren wrote: >> On 28-jun-2006, at 20:56, Bob Ippolito wrote: >> >>> >>> It's not really trivial, but it's the only option you have unless >>> someone else does it first. It sounds like Ronald will probably >>> create another 2.4.3 installer in the future that fixes this and a >>> few other issues, but I don't know when he'll get around to it (if >>> ever, I don't speak for his free time). >> >> I'm doing this in my free time, I'm hoping to do a new release before >> 2.4.4 gets out but don't promise anything. >> >>> In your situation, I would just give up on 10.3 users until the >>> issue >>> with Python is resolved (which is either going to happen when 2.5 >>> comes out, or when the 2.4.3 installer gets updated). >> >> And if you want support for 10.3 actually testing the 2.5 installer >> would be nice. I do some testing on 10.3, but as all my systems run >> 10.4 and I don't have a business-need for supporting 10.3 it doesn't >> get a much attention as it should. >> >> To do that you'll have to build it from source on a 10.4.x system >> with xcode 2.3 and the 10.4u SDK installed. Just run Mac/BuildScript/ >> build-installer.py to create a dmg containing the installer. > > It's not entirely clear if the "2.5 installer" you mention above means > PyObjC or Python. If the former, I tried it (using the Python 2.5 > installer here: > http://www.python.org/ftp/python/2.5/python-2.5b1- > macosx2006-06-20.dmg) > and it isn't working. I built it on an Intel Mac Mini, and when I > run it > on 10.3.9 I see this: I should have been clearer. The binary installer at python.org won't work on 10.3 (or rather there are issues and you shouldn't use it on 10.3). I have fixed a number of those issues in the trunk, if you rebuild the installer using a current checkout of the python trunk you should end up with something that does work properly on 10.3. Ronald -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 2157 bytes Desc: not available Url : http://mail.python.org/pipermail/pythonmac-sig/attachments/20060701/b8a89e98/attachment.bin From ronaldoussoren at mac.com Sat Jul 1 18:45:52 2006 From: ronaldoussoren at mac.com (Ronald Oussoren) Date: Sat, 1 Jul 2006 18:45:52 +0200 Subject: [Pythonmac-SIG] Universal binary build of py2app application won't run on 10.3.9 In-Reply-To: <44A58E9C.704@noaa.gov> References: <41367AA3-2351-4E5E-8E64-FFB61B4D8176@redivi.com> <44A2CE78.9080706@hotmail.com> <9EA1A2B0-77D5-4429-A94F-996D682B6CEC@redivi.com> <44A42427.6030600@noaa.gov> <566636E2-F203-41D3-897F-2F46FBEEB2C5@redivi.com> <44A58E9C.704@noaa.gov> Message-ID: <887F04B2-4E71-4F9F-95AF-C806ACE0C479@mac.com> On Jun 30, 2006, at 10:50 PM, Christopher Barker wrote: > Bob Ippolito wrote: >>>>> Would it be hard to put a little hack in Py2App to include that >>>>> particular lib, even though it is in /usr? >>>>> >>>>> Or better yet, a way to pass in a list of libs you want included >>>>> regardless of their location. > >> It's a bad idea, and redistributing components of OS X isn't legal >> anyway. > > OK, I understand the legal issues -- darn it! > > However. This is a problem, and there appears to be no solution, > other than: > > 1) Don't support 10.3.9 > > or > > 2) Wait for Ronald, out of the goodness of his heart, in his free > time, > to hack the Python build and put out a new version. 3) Take the tree at pythonmac.org, fix that yourself and send us the patch 4) Extract the sources for the bz2 extension from the python source tree, build a static library of libbz2 and build a new version of the bz2 extension. > > I'm guessing that this may not be the ONLY lib that has this > problem -- > it's just the the one that's been discovered. Also, it seems possible > that a user might have a similar problem with a lib that isn't > Apple's. With python 2.5 zlib has a simular problem. The fact that their might be other undiscovered issues is a very good reason for NOT adding this option, we want users to tell us about issues like this. Any vendor that installs libraries in system locations asks for being blasted on this list. It is rather obvious that nobdy here really cares about 10.3.9. The 2.4.3 universal installer has been out for ages and there have been test releases before the production release and nobody seems to have tested on 10.3.9 until now. I don't use 10.3 myself and have reason for supporting 10.3 other than that it seems to be a Good Thing (TM) to have. Given that I'm working on Python in my free time and don't have too much of that one can expect that 10.3.9 support for the binary installers will be less than optimal. Ronald -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 2157 bytes Desc: not available Url : http://mail.python.org/pipermail/pythonmac-sig/attachments/20060701/dd12481c/attachment.bin From marc at precipice.org Sat Jul 1 18:53:10 2006 From: marc at precipice.org (Marc Hedlund) Date: Sat, 1 Jul 2006 11:53:10 -0500 (CDT) Subject: [Pythonmac-SIG] Universal binary build of py2app application won't run on 10.3.9 In-Reply-To: <887F04B2-4E71-4F9F-95AF-C806ACE0C479@mac.com> References: <41367AA3-2351-4E5E-8E64-FFB61B4D8176@redivi.com> <44A2CE78.9080706@hotmail.com> <9EA1A2B0-77D5-4429-A94F-996D682B6CEC@redivi.com> <44A42427.6030600@noaa.gov> <566636E2-F203-41D3-897F-2F46FBEEB2C5@redivi.com> <44A58E9C.704@noaa.gov> <887F04B2-4E71-4F9F-95AF-C806ACE0C479@mac.com> Message-ID: On Sat, 1 Jul 2006, Ronald Oussoren wrote: > > It is rather obvious that nobdy here really cares about 10.3.9. The 2.4.3 > universal installer has been out for ages and there have been test releases > before the production release and nobody seems to have tested on 10.3.9 until > now. > > > I don't use 10.3 myself and have reason for supporting 10.3 other than that > it seems to be a Good Thing (TM) to have. Given that I'm working on Python in > my free time and don't have too much of that one can expect that 10.3.9 > support for the binary installers will be less than optimal. We use the 2.4.3 build on 10.3.9 and test it extensively. We just don't use bzip2. :) Just wanted to add one vote for 10.3.9 still being important -- I think about 30% of our Mac users are on it. -M From ronaldoussoren at mac.com Sat Jul 1 18:52:22 2006 From: ronaldoussoren at mac.com (Ronald Oussoren) Date: Sat, 1 Jul 2006 18:52:22 +0200 Subject: [Pythonmac-SIG] Universal binary build of py2app application won't run on 10.3.9 In-Reply-To: <703FB886-3133-4C3D-B120-410B1D7EE706@kyngchaos.com> References: <41367AA3-2351-4E5E-8E64-FFB61B4D8176@redivi.com> <44A2CE78.9080706@hotmail.com> <9EA1A2B0-77D5-4429-A94F-996D682B6CEC@redivi.com> <44A42427.6030600@noaa.gov> <566636E2-F203-41D3-897F-2F46FBEEB2C5@redivi.com> <44A58E9C.704@noaa.gov> <703FB886-3133-4C3D-B120-410B1D7EE706@kyngchaos.com> Message-ID: <35F46332-49D7-49DC-9C50-F09C6B086150@mac.com> On Jun 30, 2006, at 11:33 PM, William Kyngesburye wrote: > On Jun 30, 2006, at 3:50 PM, Christopher Barker wrote: > >> I'm guessing that this may not be the ONLY lib that has this >> problem -- >> it's just the the one that's been discovered. Also, it seems possible >> that a user might have a similar problem with a lib that isn't >> Apple's. >> > > Here's a list of Panther-Tiger incompatibilities I came up with when > working out Panther-compatible Tiger builds (not quite exhaustive, > mainly stuff that directly affected what I was doing): [... lis snipped ...] The more I work on supporting 10.3.9 and 10.4 the more I believe that the binary installer shouldn't link to system versions of libraries that aren't in a part of the OS where Apple is serious about versioning/backward-compatiblity. That is the easiest way to achieve compatibility with older OS releases without extensive testing. BTW. I don't know what I'll do once 10.5 is out, I might stop working on 10.3.9 support. Ronald -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 2157 bytes Desc: not available Url : http://mail.python.org/pipermail/pythonmac-sig/attachments/20060701/cde3bb10/attachment-0001.bin From woklist at kyngchaos.com Sat Jul 1 19:50:06 2006 From: woklist at kyngchaos.com (William Kyngesburye) Date: Sat, 1 Jul 2006 12:50:06 -0500 Subject: [Pythonmac-SIG] Universal binary build of py2app application won't run on 10.3.9 In-Reply-To: <35F46332-49D7-49DC-9C50-F09C6B086150@mac.com> References: <41367AA3-2351-4E5E-8E64-FFB61B4D8176@redivi.com> <44A2CE78.9080706@hotmail.com> <9EA1A2B0-77D5-4429-A94F-996D682B6CEC@redivi.com> <44A42427.6030600@noaa.gov> <566636E2-F203-41D3-897F-2F46FBEEB2C5@redivi.com> <44A58E9C.704@noaa.gov> <703FB886-3133-4C3D-B120-410B1D7EE706@kyngchaos.com> <35F46332-49D7-49DC-9C50-F09C6B086150@mac.com> Message-ID: > The more I work on supporting 10.3.9 and 10.4 the more I believe > that the binary installer shouldn't link to system versions of > libraries that aren't in a part of the OS where Apple is serious > about versioning/backward-compatiblity. > > That is the easiest way to achieve compatibility with older OS > releases without extensive testing. > > BTW. I don't know what I'll do once 10.5 is out, I might stop > working on 10.3.9 support. Right now it's a tough decision for 10.3.9 support - personally I don't care for it, too much hassle. But for something released to the masses, I'll do my best to support what Apple supports. And come 10.5, my bet is that Apple drops 10.3.9 support. Let's hope that Apple does a more thorough job of providing backward compatibility this time. I've also been slowly migrating Macs (~40) where I work to Tiger, mostly as we buy new Macs with it. I hope I can finish by the Leopard release ^_^ No Python use yet, but someday maybe - if the GRASS GUI moves to Python. ----- William Kyngesburye http://www.kyngchaos.com/ "I ache, therefore I am. Or in my case - I am, therefore I ache." - Marvin From ewestra at gmail.com Mon Jul 3 11:08:02 2006 From: ewestra at gmail.com (Erik Westra) Date: Mon, 3 Jul 2006 21:08:02 +1200 Subject: [Pythonmac-SIG] Universal wxPython app fails when run on second (PPC) machine Message-ID: Hello, pythonmac folks. Thanks to all the hard work you guys have been doing getting Python to run on Intel, I have a wxPython application which runs beatifully on my MacBook Pro. I'm using the Framework build of Python 2.4.3 under OSX 10.4.6, with the "pre-release" universal wxPython version 2.6.3.2rc2. This works perfectly on the Intel machine, but I now have to create a standalone version of my system which also runs on PPC-based Macs. I downloaded and installed Bob Ippolito's py2app, version 0.2.5 from http://pythonmac.org/packages/py24-fat. To my pleasant surprise it worked first time, successfully building a standalone version of the application which runs on the Intel machine just fine. But when I try to copy the app and run it on a second (PPC-based) machine, the application crashes with the following error message: > Traceback (most recent call last): > File "/Users/erik/Desktop/Risk Reporter/Risk Reporter.app/ > Contents/Resources/main.py", line 57, in main > File "Framework.pyc", line 264, in run > File "main.py", line 82, in startup > File "main.py", line 21, in __init__ > File "library/utilities/wxUtils.py", line 388, in __init__ > File "Framework.pyc", line 122, in get > File "Framework.pyc", line 350, in _getPythonModule > File "library/Workbench/Workbench.py", line 30, in ? > File "Framework.pyc", line 134, in get > File "Framework.pyc", line 350, in _getPythonModule > File "library/Workbench/PythonShell.py", line 11, in ? > File "wx/py/__init__.pyc", line 8, in ? > File "wx/py/crust.pyc", line 15, in ? > File "wx/py/editwindow.pyc", line 8, in ? > File "wx/stc.pyc", line 10, in ? > File "wx/_stc.pyc", line 18, in ? > File "wx/_stc.pyc", line 11, in __load > ImportError: Failure linking new module: /Users/erik/Desktop/Risk > Reporter/Risk Reporter.app/Contents/Resources/Python/lib-dynload/wx/ > _stc.so: Library not loaded: /usr/local/lib/wxPython- > ansi-2.6.3.2rc2/lib/libwx_macd-2.6.0.dylib > Referenced from: /Users/erik/Desktop/Risk Reporter/Risk > Reporter.app/Contents/MacOS/../Frameworks/libwx_macd_stc-2.6.0.dylib > Reason: image not found I'm not sure if this is because the application is running under PPC, or if the application is trying to load /usr/local/lib/wxPython- ansi-2.6.3.2rc2/lib/libwx_macd-2.6.0.dylib, which just happens to be installed on the MacBook Pro but not on the PPC machine. Any suggestions for how to get this going? Do I need a later version of py2app, perhaps? Or can I add something to my setup.py script to force this library to be included in the bundled application? Thanks, - Erik. From rowen at cesmail.net Tue Jul 4 01:19:32 2006 From: rowen at cesmail.net (Russell E. Owen) Date: Mon, 03 Jul 2006 16:19:32 -0700 Subject: [Pythonmac-SIG] build matplotlib on 10.3.9 without a bus error? Message-ID: I'm trying to build on a PPC MacOS X 10.3.9 system using Python 2.4.1, but "import pylab" gives a bus error. (This is for a python app I distribute, so I can't give up on 10.3.9 yet. Once I solve this problem then I can redo it with static linking). This is with hand-installed (no fink or DarwinPorts) versions of: - Python 2.4.1 - ActiveState Tcl/Tk 8.4.11 - matplotlib 0.87.3 - zlib 1.2.3 - freetype 2.2.1 - libpng 1.2.10 - numarray 1.5.1 - Numeric 24.2 I tried google and see somebody else saying the same, but no solution. Any ideas? I suspect it may be linking against freetype in /usr/X11R6/lib/ (based on ) but am not sure how to test for or prevent that without messing with system files. (Also, for future reference, is the X11 freetype usable on 10.4?) -- Russell Details: I followed Chris Barker's instructions as found here . numarray 1.5.1 and Numeric 24.2 were already installed. - Installed zlib 1.2.3, freetype 2.2.1 and libpng 1.2.10. They all seemed to install fine and I tested libpng with the included "make test". Note: I did not attempt to specify static or dynamic and found that both kinds of libs were installed for libpng and libfreetype. - Renamed my old ~/.matplotlibrc to matplotlib wouldn't see it. - Built matplotlib in the usual way. - Tried to run from my home dir (not matplotlib's dir). "import pylab" gives a bus error. - I checked the default matplotlibrc file in /Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-pack ages/matplotlib/mpl-data and it looks correct (the backend is TkAgg, for example -- unlike some old versions of matplotlib that try to use GTKAgg no matter what). From bob at redivi.com Tue Jul 4 01:43:38 2006 From: bob at redivi.com (Bob Ippolito) Date: Mon, 3 Jul 2006 16:43:38 -0700 Subject: [Pythonmac-SIG] build matplotlib on 10.3.9 without a bus error? In-Reply-To: References: Message-ID: On Jul 3, 2006, at 4:19 PM, Russell E. Owen wrote: > I'm trying to build on a PPC MacOS X 10.3.9 system using Python 2.4.1, > but "import pylab" gives a bus error. (This is for a python app I > distribute, so I can't give up on 10.3.9 yet. Once I solve this > problem > then I can redo it with static linking). Try running it under gdb and get a backtrace to see where it's actually crashing. gdb --args /usr/local/bin/python -c "import pylab" r bt -bob From cwmoad at gmail.com Tue Jul 4 02:32:23 2006 From: cwmoad at gmail.com (Charlie Moad) Date: Mon, 3 Jul 2006 20:32:23 -0400 Subject: [Pythonmac-SIG] build matplotlib on 10.3.9 without a bus error? In-Reply-To: References: Message-ID: <6382066a0607031732h5831d62et4c03315cdd07feb7@mail.gmail.com> On 7/3/06, Russell E. Owen wrote: > I'm trying to build on a PPC MacOS X 10.3.9 system using Python 2.4.1, > but "import pylab" gives a bus error. (This is for a python app I > distribute, so I can't give up on 10.3.9 yet. Once I solve this problem > then I can redo it with static linking). > > This is with hand-installed (no fink or DarwinPorts) versions of: > - Python 2.4.1 > - ActiveState Tcl/Tk 8.4.11 > - matplotlib 0.87.3 > - zlib 1.2.3 > - freetype 2.2.1 > - libpng 1.2.10 > - numarray 1.5.1 > - Numeric 24.2 > > I tried google and see somebody else saying the same, but no solution. > Any ideas? Have you tried using the 10.4 fat binaries for OSX that we provide for matplotlib? Don't be deceived by the 10.4, since they are built targeting 10.3.9. They already have freetype and libpng statically compiled in. Try downloading the egg and just unzipping it. I don't *think* the 2.4.1 vs. 2.4.3 should be an issue, but its worth a shot. http://sourceforge.net/project/showfiles.php?group_id=80706&package_id=82474&release_id=422840 - Charlie From M.Laloux at mrw.wallonie.be Tue Jul 4 13:05:52 2006 From: M.Laloux at mrw.wallonie.be (LALOUX Martin) Date: Tue, 04 Jul 2006 13:05:52 +0200 Subject: [Pythonmac-SIG] Contents of Pythonmac-SIG digest vol 39, 5 Message-ID: <6.1.2.0.0.20060704130014.02d6c5b8@pop.promibra.intra.mrw.wallonie.be> I use 10.3.9 and python 2.4.1. I confirm that the versions provided by http://sourceforge.net/project/showfiles.php?group_id=80706&package_id=82474&release_id=422840 (10.4 fat binaries for OSX) version matplotlib-0.87.3-py2.4-macosx10.4.mpkg.zip works perfectly with numpy, scipy and numarray installed. I was also able to install Basemap 0.9 without problem -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/pythonmac-sig/attachments/20060704/bde48ff7/attachment.html From ronaldoussoren at mac.com Tue Jul 4 14:40:22 2006 From: ronaldoussoren at mac.com (Ronald Oussoren) Date: Tue, 4 Jul 2006 14:40:22 +0200 Subject: [Pythonmac-SIG] Universal wxPython app fails when run on second (PPC) machine In-Reply-To: References: Message-ID: <39C52B45-09FC-4743-90EE-43A190EF6FE1@mac.com> On Jul 3, 2006, at 11:08 AM, Erik Westra wrote: > Hello, pythonmac folks. > > Thanks to all the hard work you guys have been doing getting Python > to run on Intel, I have a wxPython application which runs beatifully > on my MacBook Pro. I'm using the Framework build of Python 2.4.3 > under OSX 10.4.6, with the "pre-release" universal wxPython version > 2.6.3.2rc2. This works perfectly on the Intel machine, but I now > have to create a standalone version of my system which also runs on > PPC-based Macs. > > I downloaded and installed Bob Ippolito's py2app, version 0.2.5 from > http://pythonmac.org/packages/py24-fat. To my pleasant surprise it > worked first time, successfully building a standalone version of the > application which runs on the Intel machine just fine. But when I > try to copy the app and run it on a second (PPC-based) machine, the > application crashes with the following error message: I cannot reproduce this with the most recent version of py2app (the one you'll get when installing pyobjc from subversion). That also claims to be 0.2.5, but I don't know how different it is from the one in the package repository. I've tested by building the doodle example on an intel box and then running it on a PPC box (that doesn't have wxPython installled). Ronald -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 2157 bytes Desc: not available Url : http://mail.python.org/pipermail/pythonmac-sig/attachments/20060704/2de2089b/attachment.bin From jonathan at jonathansaggau.com Wed Jul 5 05:42:43 2006 From: jonathan at jonathansaggau.com (Jonathan) Date: Tue, 4 Jul 2006 23:42:43 -0400 Subject: [Pythonmac-SIG] Pyobjc python in objc Message-ID: How does one let objc know about a python class' methods, etc. without using a nib file? I've gotten to the point where I can build a bundle that includes a python class subclassing NSObject, but objective-c won't run any methods (other than init). I'm guessing the tutorial that mentions adding outlets and actions in a nib file adds them so that objc knows that they're there. (?) The bundle loads and running NSLog(dir(theObject)) on the python side lists the method I'm trying to call from objc... so I could easily be doing something wrong... again. :) Cheers, -- Jonathan Saggau jonathansaggau.com This amusement engaged me so much that [friends] were obliged to force me from it; and thus it is with every inclination I give into, it continues to augment, till at length it becomes so powerful, that I lose sight of everything except the favorite amusement. - Rousseau -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/pythonmac-sig/attachments/20060704/49cfced8/attachment.htm From bob at redivi.com Wed Jul 5 06:04:42 2006 From: bob at redivi.com (Bob Ippolito) Date: Tue, 4 Jul 2006 21:04:42 -0700 Subject: [Pythonmac-SIG] build matplotlib on 10.3.9 without a bus error? In-Reply-To: References: Message-ID: On Jul 4, 2006, at 8:26 PM, Russell E Owen wrote: > At 4:43 PM -0700 7/3/06, Bob Ippolito wrote: >> On Jul 3, 2006, at 4:19 PM, Russell E. Owen wrote: >> >>> I'm trying to build on a PPC MacOS X 10.3.9 system using Python >>> 2.4.1, >>> but "import pylab" gives a bus error. (This is for a python app I >>> distribute, so I can't give up on 10.3.9 yet. Once I solve this >>> problem >>> then I can redo it with static linking). >> >> Try running it under gdb and get a backtrace to see where it's >> actually crashing. >> >> gdb --args /usr/local/bin/python -c "import pylab" >> r >> bt > > Here is the backtrace. I suspect just the first few lines are > relevant, but I wasn't sure so I include the whole mess. Looks like some problem with C++ and static initializers. No idea how to help you here, I suggest trying the universal build and the latest pylab egg. -bob From bob at redivi.com Wed Jul 5 06:08:00 2006 From: bob at redivi.com (Bob Ippolito) Date: Tue, 4 Jul 2006 21:08:00 -0700 Subject: [Pythonmac-SIG] Pyobjc python in objc In-Reply-To: References: Message-ID: <982BE75E-4FE1-4248-A63C-9587414365C1@redivi.com> On Jul 4, 2006, at 8:42 PM, Jonathan wrote: > How does one let objc know about a python class' methods, etc. > without using a nib file? > > I've gotten to the point where I can build a bundle that includes a > python class subclassing NSObject, but objective-c won't run any > methods (other than init). I'm guessing the tutorial that mentions > adding outlets and actions in a nib file adds them so that objc > knows that they're there. (?) > > The bundle loads and running NSLog(dir(theObject)) on the python > side lists the method I'm trying to call from objc... so I could > easily be doing something wrong... again. :) Normally this is done by writing the abstract base class in Objective- C and subclassing it from Python. You can also do it by adding a category on NSObject. It's not possible to otherwise describe a class in Objective-C that isn't available at link time, because you'll get a linker error. -bob From ronaldoussoren at mac.com Wed Jul 5 07:43:21 2006 From: ronaldoussoren at mac.com (Ronald Oussoren) Date: Wed, 5 Jul 2006 07:43:21 +0200 Subject: [Pythonmac-SIG] build matplotlib on 10.3.9 without a bus error? In-Reply-To: References: Message-ID: On Jul 5, 2006, at 6:04 AM, Bob Ippolito wrote: > > On Jul 4, 2006, at 8:26 PM, Russell E Owen wrote: > >> At 4:43 PM -0700 7/3/06, Bob Ippolito wrote: >>> On Jul 3, 2006, at 4:19 PM, Russell E. Owen wrote: >>> >>>> I'm trying to build on a PPC MacOS X 10.3.9 system using Python >>>> 2.4.1, >>>> but "import pylab" gives a bus error. (This is for a python app I >>>> distribute, so I can't give up on 10.3.9 yet. Once I solve this >>>> problem >>>> then I can redo it with static linking). >>> >>> Try running it under gdb and get a backtrace to see where it's >>> actually crashing. >>> >>> gdb --args /usr/local/bin/python -c "import pylab" >>> r >>> bt >> >> Here is the backtrace. I suspect just the first few lines are >> relevant, but I wasn't sure so I include the whole mess. > > Looks like some problem with C++ and static initializers. No idea how > to help you here, I suggest trying the universal build and the latest > pylab egg. The readme for wxPython claims that their universal build only works on 10.4 and not on 10.3.9 because of some issues in dyld on 10.3.9 that cause problems with some C++ constructs. IIRC static initializers was one of them. Could this be the same problem? Ronald -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 2157 bytes Desc: not available Url : http://mail.python.org/pipermail/pythonmac-sig/attachments/20060705/11a5dc6f/attachment.bin From kent_quirk at cognitoy.com Wed Jul 5 21:05:46 2006 From: kent_quirk at cognitoy.com (Kent Quirk) Date: Wed, 05 Jul 2006 15:05:46 -0400 Subject: [Pythonmac-SIG] build matplotlib on 10.3.9 without a bus error? In-Reply-To: References: Message-ID: <44AC0D8A.9030007@cognitoy.com> Ronald Oussoren wrote: > > On Jul 5, 2006, at 6:04 AM, Bob Ippolito wrote: > >> >> On Jul 4, 2006, at 8:26 PM, Russell E Owen wrote: >> >>> At 4:43 PM -0700 7/3/06, Bob Ippolito wrote: >>>> On Jul 3, 2006, at 4:19 PM, Russell E. Owen wrote: >>>> >>>>> I'm trying to build on a PPC MacOS X 10.3.9 system using Python >>>>> 2.4.1, >>>>> but "import pylab" gives a bus error. (This is for a python app I >>>>> distribute, so I can't give up on 10.3.9 yet. Once I solve this >>>>> problem >>>>> then I can redo it with static linking). >>>> >>>> Try running it under gdb and get a backtrace to see where it's >>>> actually crashing. >>>> >>>> gdb --args /usr/local/bin/python -c "import pylab" >>>> r >>>> bt >>> >>> Here is the backtrace. I suspect just the first few lines are >>> relevant, but I wasn't sure so I include the whole mess. >> >> Looks like some problem with C++ and static initializers. No idea how >> to help you here, I suggest trying the universal build and the latest >> pylab egg. > > The readme for wxPython claims that their universal build only works > on 10.4 and not on 10.3.9 because of some issues in dyld on 10.3.9 > that cause problems with some C++ constructs. IIRC static initializers > was one of them. Could this be the same problem? > > Ronald I ran into a similar problem a few weeks ago on my last project. The problem we had is that when you use the 10.4u SDK, it writes RTTI definitions using a 10.4 loader feature to consolidate multiple RTTI defs for a given class at load time. The 10.3.9 loader can't swallow that, and ends up with non-consolidated RTTI defs. After struggling with it for a couple of weeks, Apple came to the conclusion that the only fix is to release 10.3.10, which apparently they don't consider worth doing. So what we had to do was build the PPC half of our code with the 10.3.9 SDK and GCC 3.3, build the Intel half with 10.4u and gcc4.0, and then lipo the whole mess together. You can convince XCode 2.3 to do this for you, so despite several weeks of pain as we hunted the problem down, in the end it was an acceptable solution. Kent From sidd.krish at gmail.com Thu Jul 6 19:58:16 2006 From: sidd.krish at gmail.com (Siddartha Krishnan) Date: Thu, 6 Jul 2006 13:58:16 -0400 Subject: [Pythonmac-SIG] Using SWIG, C++, and OS X Message-ID: <7C745543-BA7D-46DA-AC8D-51D4ADBC2AA8@gmail.com> Hi, I'm new to using SWIG for python. I am having several problems creating a C++ extension module for python. I am using OS X 10.4 with python 2.4 and SWIG 1.3.29 (using darwinports). I can use SWIG and distutils in order to make a C extension module for python, however, I cannot do so for a C++ extension module - I get an import error: mie-15-203:~/swig/class_test siddarthakrishnan$ python mymod.py Traceback (most recent call last): File "mymod.py", line 5, in ? import _mymod ImportError: Failure linking new module: /Users/siddarthakrishnan/ SWIG/class_test/_mymod.so: Symbol not found: __ZN9SomeClassC1Eii Referenced from: /Users/siddarthakrishnan/SWIG/class_test/_mymod.so Expected in: dynamic lookup The setup.py file is as follows: # setup.py from distutils.core import setup, Extension setup (name = "_mymod", version = "1.0", maintainer = "Your Name", maintainer_email = "your.name at domain.org", description = "Sample Python C++ Extension", ext_modules = [Extension('_mymod', sources=['mymod_wrap.cxx'])]) Does anyone know how to create a setup.py file that works with c++ extension modules? Also, I tried to compile a shared library manually, using: ld -L/opt/local/lib -bundle -undefined suppress -flat_namespace -o testmod.so testmod_wrap.o testmod.o However, when I try to import the module, I get the following error: >>> import testmod Traceback (most recent call last): File "", line 1, in ? ImportError: Failure linking new module: testmod.so: Symbol not found: dyld_stub_binding_helper Referenced from: testmod.so Expected in: flat namespace This is for both C and C++ extension modules. Can someone please help solve this problem? Thanks, Siddartha From kent_quirk at cognitoy.com Thu Jul 6 20:37:51 2006 From: kent_quirk at cognitoy.com (Kent Quirk) Date: Thu, 06 Jul 2006 14:37:51 -0400 Subject: [Pythonmac-SIG] Using SWIG, C++, and OS X In-Reply-To: <7C745543-BA7D-46DA-AC8D-51D4ADBC2AA8@gmail.com> References: <7C745543-BA7D-46DA-AC8D-51D4ADBC2AA8@gmail.com> Message-ID: <44AD587F.1030401@cognitoy.com> Siddartha Krishnan wrote: > I'm new to using SWIG for python. I am having several problems > creating a C++ extension module for python. I am using OS X 10.4 with > python 2.4 and SWIG 1.3.29 (using darwinports). > > I can use SWIG and distutils in order to make a C extension module > for python, however, I cannot do so for a C++ extension module - I > get an import error: > > mie-15-203:~/swig/class_test siddarthakrishnan$ python mymod.py > Traceback (most recent call last): > File "mymod.py", line 5, in ? > import _mymod > ImportError: Failure linking new module: /Users/siddarthakrishnan/ > SWIG/class_test/_mymod.so: Symbol not found: __ZN9SomeClassC1Eii > Referenced from: /Users/siddarthakrishnan/SWIG/class_test/_mymod.so > Expected in: dynamic lookup > > The setup.py file is as follows: > > # setup.py > from distutils.core import setup, Extension > setup (name = "_mymod", > version = "1.0", > maintainer = "Your Name", > maintainer_email = "your.name at domain.org", > description = "Sample Python C++ Extension", > ext_modules = [Extension('_mymod', > sources=['mymod_wrap.cxx'])]) > > Does anyone know how to create a setup.py file that works with c++ > extension modules? > > I've never used SWIG, but I think your problem is related to name mangling. Because C++ is designed to work with primitive linker technology (which uses names and only names for symbol resolution), it can't rely on the linker to be able to put together overloaded functions properly. If you have functions called abs(float) and abs(int), if the only name exported was abs, there'd be a conflict. So C++ "mangles" the names to include type information. You can tell C++ to leave the names alone (giving them C linkage semantics) by using extern "C" like so: extern "C" void myfunc(int x) { } on the routines that you want to make available to Python. Understand that they'll have to be pure external functions, not members of classes. You should probably read and understand this: http://llama.med.harvard.edu/~fgibbons/doc/SWIG1.3.10/Manual/SWIG.html If you're into C++ and want to use the power of C++ in conjunction with Python, consider using boost::python instead of SWIG. Kent From ronaldoussoren at mac.com Thu Jul 6 21:16:09 2006 From: ronaldoussoren at mac.com (Ronald Oussoren) Date: Thu, 6 Jul 2006 21:16:09 +0200 Subject: [Pythonmac-SIG] Using SWIG, C++, and OS X In-Reply-To: <7C745543-BA7D-46DA-AC8D-51D4ADBC2AA8@gmail.com> References: <7C745543-BA7D-46DA-AC8D-51D4ADBC2AA8@gmail.com> Message-ID: <90249122-A545-485F-9BC0-C986AA799469@mac.com> On Jul 6, 2006, at 7:58 PM, Siddartha Krishnan wrote: > Hi, > > I'm new to using SWIG for python. I am having several problems > creating a C++ extension module for python. I am using OS X 10.4 with > python 2.4 and SWIG 1.3.29 (using darwinports). > > I can use SWIG and distutils in order to make a C extension module > for python, however, I cannot do so for a C++ extension module - I > get an import error: > > mie-15-203:~/swig/class_test siddarthakrishnan$ python mymod.py > Traceback (most recent call last): > File "mymod.py", line 5, in ? > import _mymod > ImportError: Failure linking new module: /Users/siddarthakrishnan/ > SWIG/class_test/_mymod.so: Symbol not found: __ZN9SomeClassC1Eii > Referenced from: /Users/siddarthakrishnan/SWIG/class_test/_mymod.so > Expected in: dynamic lookup > > The setup.py file is as follows: > > # setup.py > from distutils.core import setup, Extension > setup (name = "_mymod", > version = "1.0", > maintainer = "Your Name", > maintainer_email = "your.name at domain.org", > description = "Sample Python C++ Extension", > ext_modules = [Extension('_mymod', > sources=['mymod_wrap.cxx'])]) > > Does anyone know how to create a setup.py file that works with c++ > extension modules? Are you linking with all libraries that are needed for the extension? Your module seems to be missing 'SomeClass::SomeClass(int, int)'. If you do the link step that setup.py generates manually, but add '- framework Python' and remove '-undefined surpress' you should get a list of all symbols that aren't present in the extension. However, don't build the final version of the extension like that. Ronald -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 2157 bytes Desc: not available Url : http://mail.python.org/pipermail/pythonmac-sig/attachments/20060706/e9022998/attachment.bin From bob at redivi.com Thu Jul 6 21:58:43 2006 From: bob at redivi.com (Bob Ippolito) Date: Thu, 6 Jul 2006 12:58:43 -0700 Subject: [Pythonmac-SIG] pygame 1.8.0pre build for Mac OS X available Message-ID: <55DFC6C3-677E-4C37-8F83-43B81730BF79@redivi.com> I found some time to throw together a universal pygame binary for Mac OS X from the current SVN (svn://seul.org/svn/pygame/trunk r809). This is using (and includes) the current release frameworks for SDL, SDL_image, SDL_mixer, SDL_ttf from libsdl.org, plus the current CVS of smpeg (made with a custom Xcode project), and latest release versions of libjpeg and libpng (compiled statically, universally, using the gcc-fat.sh script from SDL). Note that smpeg on i386 is *not* MMX accelerated. I couldn't get it to build that way for some reason. Everything from 1.7.x plus the new scrap module should be working. It does still require PyObjC, and possibly Numeric, to be installed. Both of these are also available from the pythonmac repository: http://pythonmac.org/packages/py24-fat/ pygame pygame-1.8.0pre-py2.4-macosx10.4.zip (MD5: f6ed5abbe207e0d7c569d2592a45adb6) The Xcode project used to build smpeg is here: http://undefined.org/python/smpeg-XcodeProjects-20060706.tgz -bob From rowen at cesmail.net Wed Jul 5 05:49:07 2006 From: rowen at cesmail.net (Russell E Owen) Date: Tue, 4 Jul 2006 20:49:07 -0700 Subject: [Pythonmac-SIG] build matplotlib on 10.3.9 without a bus error? In-Reply-To: <6382066a0607031732h5831d62et4c03315cdd07feb7@mail.gmail.com> References: <6382066a0607031732h5831d62et4c03315cdd07feb7@mail.gmail.com> Message-ID: At 8:32 PM -0400 7/3/06, Charlie Moad wrote: >On 7/3/06, Russell E. Owen wrote: >>I'm trying to build on a PPC MacOS X 10.3.9 system using Python 2.4.1, >>but "import pylab" gives a bus error. (This is for a python app I >>distribute, so I can't give up on 10.3.9 yet. Once I solve this problem >>then I can redo it with static linking). >> >>This is with hand-installed (no fink or DarwinPorts) versions of: >>- Python 2.4.1 >>- ActiveState Tcl/Tk 8.4.11 >>- matplotlib 0.87.3 >>- zlib 1.2.3 >>- freetype 2.2.1 >>- libpng 1.2.10 >>- numarray 1.5.1 >>- Numeric 24.2 >> >>I tried google and see somebody else saying the same, but no solution. >>Any ideas? > >Have you tried using the 10.4 fat binaries for OSX that we provide for >matplotlib? Don't be deceived by the 10.4, since they are built >targeting 10.3.9. They already have freetype and libpng statically >compiled in. Try downloading the egg and just unzipping it. I don't >*think* the 2.4.1 vs. 2.4.3 should be an issue, but its worth a shot. > >http://sourceforge.net/project/showfiles.php?group_id=80706&package_id=82474&release_id=422840 > >- Charlie I had no idea the "10.4" fat binaries were compatible with 10.3.9! Wow! There is one issue, however: my app is a Tkinter app and it needs to run under Intel and PPC Macs. Right now I enforce that by building everything PPC-only and having it run under emulation on Intel -- which works fine. If/when a fat Aqua Tcl/Tk comes out that works with my app, I can try to make it all fat. But that could be awhile. I suspect the current ActiveState Tcl/Tk (8.4.13) is not fat, and even if it were -- Aqua Tcl/Tk 8.4.13 and 8.4.12 both have bugs (losing the mouse position) that are killers for my app (but 8.4.11 works fine). I've been assuming that either all components need to be fat or else all need to be PPC-only to be safe on Intel. Perhaps that's too paranoid? -- Russell P.S. Python 2.4.1 isn't an issue for me. I use ActivState's PPC Python 2.4.3 at work. From rowen at cesmail.net Wed Jul 5 05:26:51 2006 From: rowen at cesmail.net (Russell E Owen) Date: Tue, 4 Jul 2006 20:26:51 -0700 Subject: [Pythonmac-SIG] build matplotlib on 10.3.9 without a bus error? In-Reply-To: References: Message-ID: At 4:43 PM -0700 7/3/06, Bob Ippolito wrote: >On Jul 3, 2006, at 4:19 PM, Russell E. Owen wrote: > >>I'm trying to build on a PPC MacOS X 10.3.9 system using Python 2.4.1, >>but "import pylab" gives a bus error. (This is for a python app I >>distribute, so I can't give up on 10.3.9 yet. Once I solve this problem >>then I can redo it with static linking). > >Try running it under gdb and get a backtrace to see where it's >actually crashing. > >gdb --args /usr/local/bin/python -c "import pylab" >r >bt Here is the backtrace. I suspect just the first few lines are relevant, but I wasn't sure so I include the whole mess. -- Russell % gdb --args /usr/local/bin/python -c "import pylab" GNU gdb 5.3-20030128 (Apple version gdb-309) (Thu Dec 4 15:41:30 GMT 2003) Copyright 2003 Free Software Foundation, Inc. GDB is free software, covered by the GNU General Public License, and you are welcome to change it and/or distribute copies of it under certain conditions. Type "show copying" to see the conditions. There is absolutely no warranty for GDB. Type "show warranty" for details. This GDB was configured as "powerpc-apple-darwin". Reading symbols for shared libraries ... done (gdb) r Starting program: /usr/local/bin/python -c import\ pylab Reading symbols for shared libraries . done ... Reading symbols for shared libraries . done Reading symbols for shared libraries bfd_mach_o_scan_read_symtab_symbol: symbol name out of range (2147483648 >= 33388) . done Program received signal EXC_BAD_ACCESS, Could not access memory. 0x00000000 in ?? () (gdb) bt #0 0x00000000 in ?? () Cannot access memory at address 0x0 Cannot access memory at address 0x0 #1 0x01565010 in Py::MethodTable::MethodTable() () #2 0x015653e4 in Py::ExtensionModuleBase::ExtensionModuleBase(char const*) () #3 0x015637dc in init_na_transforms () #4 0x100a8d54 in _PyImport_LoadDynamicModule (name=0x118e7c0 "", pathname=0xbfff7f50 " Return the alpha value used for blending - not supported on all\n backends\n ??\200\020", fp=0x1) at /Users/bob/src/Python-2.4.1/Python/importdl.c:53 #5 0x100a4e18 in load_module (name=0xbfff8720 "matplotlib._na_transforms", fp=0xa000aae0, buf=0xbfff8220 "/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/matplotlib/_na_transforms.so", type=115, loader=0x118e7c0) at /Users/bob/src/Python-2.4.1/Python/import.c:1665 #6 0x100a5e64 in import_submodule (mod=0xb61b0, subname=0xbfff872b "_na_transforms", fullname=0xbfff8720 "matplotlib._na_transforms") at /Users/bob/src/Python-2.4.1/Python/import.c:2250 #7 0x100a58b4 in load_next (mod=0xb61b0, altmod=0xb61b0, p_name=0xa000aae0, buf=0xbfff8720 "matplotlib._na_transforms", p_buflen=0xbfff872b) at /Users/bob/src/Python-2.4.1/Python/import.c:2070 #8 0x100a7c58 in import_module_ex (name=0x0, globals=0x0, locals=0xbfff7e60, fromlist=0x146b430) at /Users/bob/src/Python-2.4.1/Python/import.c:1912 #9 0x100a6ae8 in PyImport_ImportModuleEx (name=0x1467494 "matplotlib._na_transforms", globals=0x144af60, locals=0x144af60, fromlist=0x146b430) at /Users/bob/src/Python-2.4.1/Python/import.c:1946 #10 0x1006faa8 in builtin___import__ (self=0x118e7c0, args=0x0) at /Users/bob/src/Python-2.4.1/Python/bltinmodule.c:45 #11 0x1000c348 in PyObject_Call (func=0x118e7c0, arg=0x0, kw=0xbfff7e60) at /Users/bob/src/Python-2.4.1/Objects/abstract.c:1751 #12 0x1007c26c in PyEval_CallObjectWithKeywords (func=0xe260, arg=0x14695d0, kw=0x0) at /Users/bob/src/Python-2.4.1/Python/ceval.c:3419 #13 0x10079e48 in PyEval_EvalFrame (f=0x113bcc0) at /Users/bob/src/Python-2.4.1/Python/ceval.c:2020 #14 0x1007b284 in PyEval_EvalCodeEx (co=0x3, globals=0x0, locals=0x1565010, args=0x0, argcount=3146240, kws=0x10079d8c, kwcount=1, defs=0x113be0c, defcount=0, closure=0x0) at /Users/bob/src/Python-2.4.1/Python/ceval.c:2730 #15 0x1007e678 in PyEval_EvalCode (co=0x118e7c0, globals=0x0, locals=0xbfff7e60) at /Users/bob/src/Python-2.4.1/Python/ceval.c:484 #16 0x100a4050 in PyImport_ExecCodeModuleEx (name=0x3
, co=0x13d4563, pathname=0x113bcc0 "") at /Users/bob/src/Python-2.4.1/Python/import.c:619 #17 0x100a7738 in load_source_module (name=0xe260 "", pathname=0xe260 "", fp=0x14695d0) at /Users/bob/src/Python-2.4.1/Python/import.c:893 #18 0x100a4cd8 in load_module (name=0xbfff9920 "matplotlib._transforms", fp=0xa000aa88, buf=0xbfff9420 "/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/matplotlib/_transforms.py", type=115, loader=0x118e7c0) at /Users/bob/src/Python-2.4.1/Python/import.c:1656 #19 0x100a5e64 in import_submodule (mod=0xb61b0, subname=0xbfff992b "_transforms", fullname=0xbfff9920 "matplotlib._transforms") at /Users/bob/src/Python-2.4.1/Python/import.c:2250 #20 0x100a58b4 in load_next (mod=0x300200, altmod=0x1, p_name=0xa000aa88, buf=0xbfff9920 "matplotlib._transforms", p_buflen=0xbfff992b) at /Users/bob/src/Python-2.4.1/Python/import.c:2070 #21 0x100a7c18 in import_module_ex (name=0x0, globals=0x0, locals=0xbfff7e60, fromlist=0x145fea0) at /Users/bob/src/Python-2.4.1/Python/import.c:1905 #22 0x100a6ae8 in PyImport_ImportModuleEx (name=0x146a3f4 "_transforms", globals=0x144aed0, locals=0x144aed0, fromlist=0x145fea0) at /Users/bob/src/Python-2.4.1/Python/import.c:1946 #23 0x1006faa8 in builtin___import__ (self=0x118e7c0, args=0x0) at /Users/bob/src/Python-2.4.1/Python/bltinmodule.c:45 #24 0x1000c348 in PyObject_Call (func=0x118e7c0, arg=0x0, kw=0xbfff7e60) at /Users/bob/src/Python-2.4.1/Objects/abstract.c:1751 #25 0x1007c26c in PyEval_CallObjectWithKeywords (func=0xe260, arg=0x1469540, kw=0x0) at /Users/bob/src/Python-2.4.1/Python/ceval.c:3419 #26 0x10079e48 in PyEval_EvalFrame (f=0x11474e0) at /Users/bob/src/Python-2.4.1/Python/ceval.c:2020 #27 0x1007b284 in PyEval_EvalCodeEx (co=0x4, globals=0x0, locals=0x1565010, args=0x0, argcount=3146240, kws=0x10079d8c, kwcount=1, defs=0x113be0c, defcount=0, closure=0x0) at /Users/bob/src/Python-2.4.1/Python/ceval.c:2730 #28 0x1007e678 in PyEval_EvalCode (co=0x118e7c0, globals=0x0, locals=0xbfff7e60) at /Users/bob/src/Python-2.4.1/Python/ceval.c:484 #29 0x100a4050 in PyImport_ExecCodeModuleEx (name=0x4
, co=0x1195f66, pathname=0x11474e0 "") at /Users/bob/src/Python-2.4.1/Python/import.c:619 #30 0x100a7738 in load_source_module (name=0xe260 "", pathname=0xe260 "", fp=0x1469540) at /Users/bob/src/Python-2.4.1/Python/import.c:893 #31 0x100a4cd8 in load_module (name=0xbfffab20 "matplotlib.transforms", fp=0xa000aa30, buf=0xbfffa620 "/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/matplotlib/transforms.py", type=115, loader=0x118e7c0) at /Users/bob/src/Python-2.4.1/Python/import.c:1656 #32 0x100a5e64 in import_submodule (mod=0xb61b0, subname=0xbfffab2b "transforms", fullname=0xbfffab20 "matplotlib.transforms") at /Users/bob/src/Python-2.4.1/Python/import.c:2250 #33 0x100a58b4 in load_next (mod=0x300200, altmod=0x1, p_name=0xa000aa30, buf=0xbfffab20 "matplotlib.transforms", p_buflen=0xbfffab2b) at /Users/bob/src/Python-2.4.1/Python/import.c:2070 #34 0x100a7c18 in import_module_ex (name=0x0, globals=0x0, locals=0xbfff7e60, fromlist=0x1460d70) at /Users/bob/src/Python-2.4.1/Python/import.c:1905 #35 0x100a6ae8 in PyImport_ImportModuleEx (name=0x24efd4 "transforms", globals=0x144adb0, locals=0x144adb0, fromlist=0x1460d70) at /Users/bob/src/Python-2.4.1/Python/import.c:1946 #36 0x1006faa8 in builtin___import__ (self=0x118e7c0, args=0x0) at /Users/bob/src/Python-2.4.1/Python/bltinmodule.c:45 #37 0x1000c348 in PyObject_Call (func=0x118e7c0, arg=0x0, kw=0xbfff7e60) at /Users/bob/src/Python-2.4.1/Objects/abstract.c:1751 #38 0x1007c26c in PyEval_CallObjectWithKeywords (func=0xe260, arg=0x145fe70, kw=0x0) at /Users/bob/src/Python-2.4.1/Python/ceval.c:3419 #39 0x10079e48 in PyEval_EvalFrame (f=0x192c210) at /Users/bob/src/Python-2.4.1/Python/ceval.c:2020 #40 0x1007b284 in PyEval_EvalCodeEx (co=0x6, globals=0x0, locals=0x1565010, args=0x0, argcount=3146240, kws=0x10079d8c, kwcount=1, defs=0x113be0c, defcount=0, closure=0x0) at /Users/bob/src/Python-2.4.1/Python/ceval.c:2730 #41 0x1007e678 in PyEval_EvalCode (co=0x118e7c0, globals=0x0, locals=0xbfff7e60) at /Users/bob/src/Python-2.4.1/Python/ceval.c:484 #42 0x100a4050 in PyImport_ExecCodeModuleEx (name=0x6
, co=0x13db6f3, pathname=0x192c210 "") at /Users/bob/src/Python-2.4.1/Python/import.c:619 #43 0x100a7738 in load_source_module (name=0xe260 "", pathname=0xe260 "", fp=0x145fe70) at /Users/bob/src/Python-2.4.1/Python/import.c:893 #44 0x100a4cd8 in load_module (name=0xbfffbd20 "matplotlib.artist", fp=0xa000a9d8, buf=0xbfffb820 "/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/matplotlib/artist.py", type=115, loader=0x118e7c0) at /Users/bob/src/Python-2.4.1/Python/import.c:1656 #45 0x100a5e64 in import_submodule (mod=0xb61b0, subname=0xbfffbd2b "artist", fullname=0xbfffbd20 "matplotlib.artist") at /Users/bob/src/Python-2.4.1/Python/import.c:2250 #46 0x100a58b4 in load_next (mod=0x300200, altmod=0x1, p_name=0xa000a9d8, buf=0xbfffbd20 "matplotlib.artist", p_buflen=0xbfffbd2b) at /Users/bob/src/Python-2.4.1/Python/import.c:2070 #47 0x100a7c18 in import_module_ex (name=0x0, globals=0x0, locals=0xbfff7e60, fromlist=0x1249b98) at /Users/bob/src/Python-2.4.1/Python/import.c:1905 #48 0x100a6ae8 in PyImport_ImportModuleEx (name=0x25c5b4 "artist", globals=0x144ac00, locals=0x144ac00, fromlist=0x1249b98) at /Users/bob/src/Python-2.4.1/Python/import.c:1946 #49 0x1006faa8 in builtin___import__ (self=0x118e7c0, args=0x0) at /Users/bob/src/Python-2.4.1/Python/bltinmodule.c:45 #50 0x1000c348 in PyObject_Call (func=0x118e7c0, arg=0x0, kw=0xbfff7e60) at /Users/bob/src/Python-2.4.1/Objects/abstract.c:1751 #51 0x1007c26c in PyEval_CallObjectWithKeywords (func=0xe260, arg=0x145f6f0, kw=0x0) at /Users/bob/src/Python-2.4.1/Python/ceval.c:3419 #52 0x10079e48 in PyEval_EvalFrame (f=0x185fa10) at /Users/bob/src/Python-2.4.1/Python/ceval.c:2020 #53 0x1007b284 in PyEval_EvalCodeEx (co=0x27, globals=0x0, locals=0x1565010, args=0x0, argcount=3146240, kws=0x10079d8c, kwcount=1, defs=0x113be0c, defcount=0, closure=0x0) at /Users/bob/src/Python-2.4.1/Python/ceval.c:2730 #54 0x1007e678 in PyEval_EvalCode (co=0x118e7c0, globals=0x0, locals=0xbfff7e60) at /Users/bob/src/Python-2.4.1/Python/ceval.c:484 #55 0x100a4050 in PyImport_ExecCodeModuleEx (name=0x27
, co=0x1870b0c, pathname=0x185fa10 "") at /Users/bob/src/Python-2.4.1/Python/import.c:619 #56 0x100a7738 in load_source_module (name=0xe260 "", pathname=0xe260 "", fp=0x145f6f0) at /Users/bob/src/Python-2.4.1/Python/import.c:893 #57 0x100a4cd8 in load_module (name=0xbfffcf20 "matplotlib.axes", fp=0xa000a980, buf=0xbfffca20 "/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/matplotlib/axes.py", type=115, loader=0x118e7c0) at /Users/bob/src/Python-2.4.1/Python/import.c:1656 #58 0x100a5e64 in import_submodule (mod=0xb61b0, subname=0xbfffcf2b "axes", fullname=0xbfffcf20 "matplotlib.axes") at /Users/bob/src/Python-2.4.1/Python/import.c:2250 #59 0x100a58b4 in load_next (mod=0x300200, altmod=0x1, p_name=0xa000a980, buf=0xbfffcf20 "matplotlib.axes", p_buflen=0xbfffcf2b) at /Users/bob/src/Python-2.4.1/Python/import.c:2070 #60 0x100a7c18 in import_module_ex (name=0x0, globals=0x0, locals=0xbfff7e60, fromlist=0xa8760) at /Users/bob/src/Python-2.4.1/Python/import.c:1905 #61 0x100a6ae8 in PyImport_ImportModuleEx (name=0x24d5d4 "axes", globals=0xdb300, locals=0xdb300, fromlist=0xa8760) at /Users/bob/src/Python-2.4.1/Python/import.c:1946 #62 0x1006faa8 in builtin___import__ (self=0x118e7c0, args=0x0) at /Users/bob/src/Python-2.4.1/Python/bltinmodule.c:45 #63 0x1000c348 in PyObject_Call (func=0x118e7c0, arg=0x0, kw=0xbfff7e60) at /Users/bob/src/Python-2.4.1/Objects/abstract.c:1751 #64 0x1007c26c in PyEval_CallObjectWithKeywords (func=0xe260, arg=0x25b780, kw=0x0) at /Users/bob/src/Python-2.4.1/Python/ceval.c:3419 #65 0x10079e48 in PyEval_EvalFrame (f=0x304c60) at /Users/bob/src/Python-2.4.1/Python/ceval.c:2020 #66 0x1007b284 in PyEval_EvalCodeEx (co=0x6, globals=0x0, locals=0x1565010, args=0x0, argcount=3146240, kws=0x10079d8c, kwcount=1, defs=0x113be0c, defcount=0, closure=0x0) at /Users/bob/src/Python-2.4.1/Python/ceval.c:2730 #67 0x1007e678 in PyEval_EvalCode (co=0x118e7c0, globals=0x0, locals=0xbfff7e60) at /Users/bob/src/Python-2.4.1/Python/ceval.c:484 #68 0x100a4050 in PyImport_ExecCodeModuleEx (name=0x6
, co=0x186a24d, pathname=0x304c60 "") at /Users/bob/src/Python-2.4.1/Python/import.c:619 #69 0x100a7738 in load_source_module (name=0xe260 "", pathname=0xe260 "", fp=0x25b780) at /Users/bob/src/Python-2.4.1/Python/import.c:893 #70 0x100a4cd8 in load_module (name=0xbfffe120 "matplotlib.pylab", fp=0xa000a928, buf=0xbfffdc20 "/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/matplotlib/pylab.py", type=115, loader=0x118e7c0) at /Users/bob/src/Python-2.4.1/Python/import.c:1656 #71 0x100a5e64 in import_submodule (mod=0xb61b0, subname=0xbfffe12b "pylab", fullname=0xbfffe120 "matplotlib.pylab") at /Users/bob/src/Python-2.4.1/Python/import.c:2250 #72 0x100a58b4 in load_next (mod=0x300200, altmod=0x1, p_name=0xa000a928, buf=0xbfffe120 "matplotlib.pylab", p_buflen=0xbfffe12b) at /Users/bob/src/Python-2.4.1/Python/import.c:2070 #73 0x100a7c58 in import_module_ex (name=0x0, globals=0x0, locals=0xbfff7e60, fromlist=0xb6150) at /Users/bob/src/Python-2.4.1/Python/import.c:1912 #74 0x100a6ae8 in PyImport_ImportModuleEx (name=0xb823c "matplotlib.pylab", globals=0xb7930, locals=0xb7930, fromlist=0xb6150) at /Users/bob/src/Python-2.4.1/Python/import.c:1946 #75 0x1006faa8 in builtin___import__ (self=0x118e7c0, args=0x0) at /Users/bob/src/Python-2.4.1/Python/bltinmodule.c:45 #76 0x1000c348 in PyObject_Call (func=0x118e7c0, arg=0x0, kw=0xbfff7e60) at /Users/bob/src/Python-2.4.1/Objects/abstract.c:1751 #77 0x1007c26c in PyEval_CallObjectWithKeywords (func=0xe260, arg=0xb1600, kw=0x0) at /Users/bob/src/Python-2.4.1/Python/ceval.c:3419 #78 0x10079e48 in PyEval_EvalFrame (f=0x11385e0) at /Users/bob/src/Python-2.4.1/Python/ceval.c:2020 #79 0x1007b284 in PyEval_EvalCodeEx (co=0x0, globals=0x0, locals=0x1565010, args=0x0, argcount=3146240, kws=0x10079d8c, kwcount=1, defs=0x113be0c, defcount=0, closure=0x0) at /Users/bob/src/Python-2.4.1/Python/ceval.c:2730 #80 0x1007e678 in PyEval_EvalCode (co=0x118e7c0, globals=0x0, locals=0xbfff7e60) at /Users/bob/src/Python-2.4.1/Python/ceval.c:484 #81 0x100a4050 in PyImport_ExecCodeModuleEx (name=0x0, co=0xb8062, pathname=0x11385e0 "") at /Users/bob/src/Python-2.4.1/Python/import.c:619 #82 0x100a7738 in load_source_module (name=0xe260 "", pathname=0xe260 "", fp=0xb1600) at /Users/bob/src/Python-2.4.1/Python/import.c:893 #83 0x100a4cd8 in load_module (name=0xbffff320 "pylab", fp=0xa000a8d0, buf=0xbfffee20 "/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/pylab.py", type=115, loader=0x118e7c0) at /Users/bob/src/Python-2.4.1/Python/import.c:1656 #84 0x100a5e64 in import_submodule (mod=0x10101da4, subname=0xbffff320 "pylab", fullname=0xbffff320 "pylab") at /Users/bob/src/Python-2.4.1/Python/import.c:2250 #85 0x100a58b4 in load_next (mod=0x300200, altmod=0x1, p_name=0xa000a8d0, buf=0xbffff320 "pylab", p_buflen=0xbffff320) at /Users/bob/src/Python-2.4.1/Python/import.c:2070 #86 0x100a7c18 in import_module_ex (name=0x0, globals=0x0, locals=0xbfff7e60, fromlist=0x10101da4) at /Users/bob/src/Python-2.4.1/Python/import.c:1905 #87 0x100a6ae8 in PyImport_ImportModuleEx (name=0xb60f4 "pylab", globals=0x1fa50, locals=0x1fa50, fromlist=0x10101da4) at /Users/bob/src/Python-2.4.1/Python/import.c:1946 #88 0x1006faa8 in builtin___import__ (self=0x118e7c0, args=0x0) at /Users/bob/src/Python-2.4.1/Python/bltinmodule.c:45 #89 0x1000c348 in PyObject_Call (func=0x118e7c0, arg=0x0, kw=0xbfff7e60) at /Users/bob/src/Python-2.4.1/Objects/abstract.c:1751 #90 0x1007c26c in PyEval_CallObjectWithKeywords (func=0xe260, arg=0x1eba0, kw=0x0) at /Users/bob/src/Python-2.4.1/Python/ceval.c:3419 #91 0x10079e48 in PyEval_EvalFrame (f=0x1138f50) at /Users/bob/src/Python-2.4.1/Python/ceval.c:2020 #92 0x1007b284 in PyEval_EvalCodeEx (co=0x0, globals=0x0, locals=0x1565010, args=0x0, argcount=3146240, kws=0x10079d8c, kwcount=1, defs=0x113be0c, defcount=0, closure=0x0) at /Users/bob/src/Python-2.4.1/Python/ceval.c:2730 #93 0x1007e678 in PyEval_EvalCode (co=0x118e7c0, globals=0x0, locals=0xbfff7e60) at /Users/bob/src/Python-2.4.1/Python/ceval.c:484 #94 0x100b2ee0 in run_node (n=0x0, filename=0x0, globals=0x0, locals=0xe260, flags=0x666f726d) at /Users/bob/src/Python-2.4.1/Python/pythonrun.c:1265 #95 0x100b3db0 in PyRun_SimpleStringFlags (command=0xd128 "", flags=0xbffffbb4) at /Users/bob/src/Python-2.4.1/Python/pythonrun.c:1362 #96 0x100bf544 in Py_Main (argc=129616, argv=0xd128) at /Users/bob/src/Python-2.4.1/Modules/main.c:472 #97 0x000018d0 in start () #98 0x8fe1a278 in __dyld__dyld_start () (gdb) From pdj at iinet.net.au Thu Jul 6 12:48:01 2006 From: pdj at iinet.net.au (Paul Jager) Date: Thu, 6 Jul 2006 20:18:01 +0930 Subject: [Pythonmac-SIG] Embedding MacPython in Matlab via mex file Message-ID: Hello Barry I found in google a forum post you submitted to MacPython about using a framework in MATLAB, and i thought id risk emailing you i hope you dont mind and if so my apologies. I am not very up with "real programming" as I am an engineering student, but part of my project requires me to use a sound device in matlab, and im using a mac... a major issue because the useful and simplest soultion is to use DAQ toolbox of MATLAB problem is they dont have a version for mac for some ridiculous reason. So i need to work out my own solution... all i want to do is access the sound device (an 8 in/out audio interface im using for multi microphone array testing). So i worked out a mex file is required to access core audio somehow... but i need to compile a mex that uses the core audio frameworks... i dont know how that is done and saw your problem was similar (wanting to use framework for python?) Did you solve that, and if so how does one link to external frameworks such as the apple C frameworks for things like CoreAudio etc to make a mex file in MATLAB? Cheers Paul From kw at kevin-walzer.com Fri Jul 7 01:00:21 2006 From: kw at kevin-walzer.com (Kevin Walzer) Date: Thu, 06 Jul 2006 19:00:21 -0400 Subject: [Pythonmac-SIG] build matplotlib on 10.3.9 without a bus error? In-Reply-To: References: <6382066a0607031732h5831d62et4c03315cdd07feb7@mail.gmail.com> Message-ID: <44AD9605.7050100@kevin-walzer.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Russell E Owen wrote: > If/when a fat Aqua Tcl/Tk comes out that works with my app, I can try > to make it all fat. But that could be awhile. I suspect the current > ActiveState Tcl/Tk (8.4.13) is not fat, and even if it were -- Aqua > Tcl/Tk 8.4.13 and 8.4.12 both have bugs (losing the mouse position) > that are killers for my app (but 8.4.11 works fine). > > I've been assuming that either all components need to be fat or else > all need to be PPC-only to be safe on Intel. Perhaps that's too > paranoid? > > -- Russell > FYI, I have a "fat" build of Tk Aqua 8.4.12 here: http://tk-components.sourceforge.net/installer/index.html As far as I know, this is the only "universal" package in distribution. ActiveState ships separate builds for PPC and Intel (some of the extension packages are hard to build universally), and Daniel Steffen has not updated his distribution for nearly a year. Let me know how it works with py2app. I've had problems--py2app gags when trying to graph the PPC and i386 Mach-o dependencies, even with the simple "hello-tk" sample. It seems to problems with libtclstub8.4.a and returns an error message like this: raise ValueError, "got unrecognized magic of %08x" % (header.magic, MH_MAGIC, MH_CIGAM) TypeError: not all arguments converted during string formatting I want to use Tkinter for a Python application I'm starting on because it's more familiar to me, but if py2app can't handle it, then I will probably use wxPython. - -- Kevin Walzer Poetic Code http://www.kevin-walzer.com -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.1 (Darwin) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFErZYErTC5hIgjqTMRAssjAJ4lNcLb2pdW8NXeci1GLHnjGNPRBQCfczW5 UAQ7re9aTHyjdlSR21Dt1oE= =6RYD -----END PGP SIGNATURE----- From rowen at cesmail.net Fri Jul 7 01:05:48 2006 From: rowen at cesmail.net (Russell E. Owen) Date: Thu, 06 Jul 2006 16:05:48 -0700 Subject: [Pythonmac-SIG] build matplotlib on 10.3.9 without a bus error? References: <6382066a0607031732h5831d62et4c03315cdd07feb7@mail.gmail.com> Message-ID: In article <6382066a0607031732h5831d62et4c03315cdd07feb7 at mail.gmail.com>, "Charlie Moad" wrote: > On 7/3/06, Russell E. Owen wrote: > > I'm trying to build on a PPC MacOS X 10.3.9 system using Python 2.4.1, > > but "import pylab" gives a bus error. (This is for a python app I > > distribute, so I can't give up on 10.3.9 yet. Once I solve this problem > > then I can redo it with static linking). > > > > This is with hand-installed (no fink or DarwinPorts) versions of: > > - Python 2.4.1 > > - ActiveState Tcl/Tk 8.4.11 > > - matplotlib 0.87.3 > > - zlib 1.2.3 > > - freetype 2.2.1 > > - libpng 1.2.10 > > - numarray 1.5.1 > > - Numeric 24.2 > > > > I tried google and see somebody else saying the same, but no solution. > > Any ideas? > > Have you tried using the 10.4 fat binaries for OSX that we provide for > matplotlib? Don't be deceived by the 10.4, since they are built > targeting 10.3.9. They already have freetype and libpng statically > compiled in. Try downloading the egg and just unzipping it. I don't > *think* the 2.4.1 vs. 2.4.3 should be an issue, but its worth a shot. > > http://sourceforge.net/project/showfiles.php?group_id=80706&package_id=82474&r > elease_id=422840 I have not yet. (Sorry this reply took so long; I replied right away, but from the wrong address and I've been waiting for my stuck posting to appear and I didn't keep a copy and, well...here is a rewrite...) The issue is that I distribute a python application based on Tkinter. It has to run on Intel Macs and Tcl/Tk is not yet a universal binary. So far I've released a pure PPC-based application (using ActiveState's Python 2.4.3), and it runs fine under Rosetta. I've been afraid of using any universal components for fear the application might crash on an Intel Mac (and I don't have one, so testing is a pain.) Is there a simple rule for determining what is safe for a python application that is intended to run under Rosetta emulation on an Intel Mac -- how much (if any) of it can be universal? -- Russell From kw at kevin-walzer.com Fri Jul 7 01:06:33 2006 From: kw at kevin-walzer.com (Kevin Walzer) Date: Thu, 06 Jul 2006 19:06:33 -0400 Subject: [Pythonmac-SIG] py2app and universal TkAqua Message-ID: <44AD9779.4000206@kevin-walzer.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 I have been unable to build the "hello-tk" demo that ships with py2app if I am building against a "universal" build of Tcl/Tk. Here is my setup: from distutils.core import setup import py2app setup( app=['hello.py'], options=dict( py2app=dict( archs="ppc,i386", frameworks=["/Library/Frameworks/Tcl.framework","/Library/Frameworks/Tk.framework"] ) ) ) Running "sudo python setup.py py2app" returns this error: Graphing /Developer/Python/py2app/Examples/Tkinter/hello_tk/dist/hello.app/Contents/Frameworks/Python.framework/Versions/2.4/Python (ppc) Graphing /Developer/Python/py2app/Examples/Tkinter/hello_tk/dist/hello.app/Contents/Frameworks/Python.framework/Versions/2.4/bin/python (ppc) Graphing /Developer/Python/py2app/Examples/Tkinter/hello_tk/dist/hello.app/Contents/Frameworks/Tcl.framework/Versions/8.4/libtclstub8.4.a (ppc) Traceback (most recent call last): File "setup.py", line 9, in ? frameworks=["/Library/Frameworks/Tcl.framework","/Library/Frameworks/Tk.framework"] File "/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/distutils/core.py", line 149, in setup dist.run_commands() File "/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/distutils/dist.py", line 946, in run_commands self.run_command(cmd) File "/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/distutils/dist.py", line 966, in run_command cmd_obj.run() File "/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/Py2App/py2app/build_app.py", line 389, in run self._run() File "/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/Py2App/py2app/build_app.py", line 510, in _run self.run_normal() File "/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/Py2App/py2app/build_app.py", line 570, in run_normal self.create_binaries(py_files, pkgdirs, extensions, loader_files) File "/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/Py2App/py2app/build_app.py", line 672, in create_binaries platfiles = mm.run() File "/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/Py2App/macholib/MachOStandalone.py", line 101, in run mm.run_file(fn) File "/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/Py2App/macholib/MachOGraph.py", line 67, in run_file m = MachO(pathname) File "/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/Py2App/macholib/MachO.py", line 254, in __init__ self.load() File "/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/Py2App/macholib/MachO.py", line 287, in load self.archs = self.load_fat(fat, fh) File "/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/Py2App/macholib/MachO.py", line 273, in load_fat raise ValueError, "got unrecognized magic of %08x" % (header.magic, MH_MAGIC, MH_CIGAM) TypeError: not all arguments converted during string formatting I have the universal build of Python 2.4.3 installed, and am using py2app 0.2.5 from the pythonmac.org/packages site. My build of TkAqua is version 8.4.12, built as a universal binary, running on 10.4.7 with Xcode 2.3. py2app seems to be choking on the Tcl/Tk stubs library; that's when it returns the "got unrecognized magic" error message. I have no idea how to fix this. - -- Kevin Walzer Poetic Code http://www.kevin-walzer.com -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.1 (Darwin) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFErZd4rTC5hIgjqTMRAnMVAJ9sJE1c2NJCQ40+Fwm1kL6ZgeAHEgCgipXf yYNtYlrO7xjnLoTzxH1CZEg= =ZjSv -----END PGP SIGNATURE----- From rowen at cesmail.net Fri Jul 7 01:37:57 2006 From: rowen at cesmail.net (Russell E. Owen) Date: Thu, 06 Jul 2006 16:37:57 -0700 Subject: [Pythonmac-SIG] build matplotlib on 10.3.9 without a bus error? References: <6382066a0607031732h5831d62et4c03315cdd07feb7@mail.gmail.com> <44AD9605.7050100@kevin-walzer.com> Message-ID: In article <44AD9605.7050100 at kevin-walzer.com>, Kevin Walzer wrote: >...FYI, I have a "fat" build of Tk Aqua 8.4.12 here: > > http://tk-components.sourceforge.net/installer/index.html > > As far as I know, this is the only "universal" package in distribution. > ActiveState ships separate builds for PPC and Intel (some of the > extension packages are hard to build universally), and Daniel Steffen > has not updated his distribution for nearly a year. I believe Daniel Steffen is leaving distribution toActiveState now. (Fine with me--it's easier to have one official distribution, and Daniel is doing wonders fixing Aqua Tcl/Tk bugs). I recently heard from Jeff Griffiths of ActiveState that the next distribution of Tcl/Tk will be a universal binary. (I don't know anything else, such as when that might appear.) Sorry to hear that you've had trouble with py2app with your version. I found 8.4.12 mouse coordinates were sometimes wrong (especially under emulation on an Intel Mac) and 8.4.13 also has this issue (including on PPC) so I've personally been sticking with 8.4.11. I hope your issues with py2app and universal Tcl/Tk get resolved. -- Russell From bob at redivi.com Fri Jul 7 01:39:30 2006 From: bob at redivi.com (Bob Ippolito) Date: Thu, 6 Jul 2006 16:39:30 -0700 Subject: [Pythonmac-SIG] build matplotlib on 10.3.9 without a bus error? In-Reply-To: <44AD9605.7050100@kevin-walzer.com> References: <6382066a0607031732h5831d62et4c03315cdd07feb7@mail.gmail.com> <44AD9605.7050100@kevin-walzer.com> Message-ID: <81BF97EC-DDAA-4EE1-AD2A-405A6638E43E@redivi.com> On Jul 6, 2006, at 4:00 PM, Kevin Walzer wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > Russell E Owen wrote: > >> If/when a fat Aqua Tcl/Tk comes out that works with my app, I can try >> to make it all fat. But that could be awhile. I suspect the current >> ActiveState Tcl/Tk (8.4.13) is not fat, and even if it were -- Aqua >> Tcl/Tk 8.4.13 and 8.4.12 both have bugs (losing the mouse position) >> that are killers for my app (but 8.4.11 works fine). >> >> I've been assuming that either all components need to be fat or else >> all need to be PPC-only to be safe on Intel. Perhaps that's too >> paranoid? >> >> -- Russell >> > > FYI, I have a "fat" build of Tk Aqua 8.4.12 here: > > http://tk-components.sourceforge.net/installer/index.html > > As far as I know, this is the only "universal" package in > distribution. > ActiveState ships separate builds for PPC and Intel (some of the > extension packages are hard to build universally), and Daniel Steffen > has not updated his distribution for nearly a year. > > Let me know how it works with py2app. I've had problems--py2app gags > when trying to graph the PPC and i386 Mach-o dependencies, even > with the > simple "hello-tk" sample. It seems to problems with libtclstub8.4.a > and > returns an error message like this: > > raise ValueError, "got unrecognized magic of %08x" % (header.magic, > MH_MAGIC, MH_CIGAM) > TypeError: not all arguments converted during string formatting > > I want to use Tkinter for a Python application I'm starting on because > it's more familiar to me, but if py2app can't handle it, then I will > probably use wxPython. It really shouldn't be looking at .a files, that's a bug. There's at least a few other bugs in the universal branch of py2app, it's really not ready yet. It does seem to work for some apps, which is why I cut a release. I didn't write any of that code and I haven't audited it, so there isn't much I can do beyond accepting patches that fix these things until I find the time to go through it all (don't hold your breath). -bob From kw at kevin-walzer.com Fri Jul 7 09:00:42 2006 From: kw at kevin-walzer.com (Kevin Walzer) Date: Fri, 07 Jul 2006 03:00:42 -0400 Subject: [Pythonmac-SIG] build matplotlib on 10.3.9 without a bus error? In-Reply-To: <81BF97EC-DDAA-4EE1-AD2A-405A6638E43E@redivi.com> References: <6382066a0607031732h5831d62et4c03315cdd07feb7@mail.gmail.com> <44AD9605.7050100@kevin-walzer.com> <81BF97EC-DDAA-4EE1-AD2A-405A6638E43E@redivi.com> Message-ID: <44AE069A.3020105@kevin-walzer.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Bob Ippolito wrote: > > It really shouldn't be looking at .a files, that's a bug. There's at > least a few other bugs in the universal branch of py2app, it's really > not ready yet. It does seem to work for some apps, which is why I cut a > release. > > I didn't write any of that code and I haven't audited it, so there isn't > much I can do beyond accepting patches that fix these things until I > find the time to go through it all (don't hold your breath). > > -bob > I've poked around a bit in the py2app code, but I really have no idea how to fix this--I would gladly submit a patch if I did. However, for what it's worth, I was able to build a standalone app bundle of the "hello-tk" demo using bundlebuilder. Because bundlebuilder isn't nearly as elegant as py2app, it took some trial and error, and the final app bundle is huge--50+ megabytes--but it works, and the resulting app is a universal binary. I'm glad bundlebuilder is still available. :-) Here's my setup script, run as "sudo python makeapplication.py build": ### makeapplication.py from bundlebuilder import buildapp buildapp( name='hello.app', # what to build mainprogram='hello.py', # your app's main() argv_emulation=1, # drag&dropped filenames show up in sys.argv # iconfile='myapp.icns', # file containing your app's icons standalone=1, # make this app self contained. includeModules=['argvemulator', 'os'], # list of additional Modules to force in includePackages=[], # list of additional Packages to force in libs = [ '/Library/Frameworks/Tk.Framework', '/Library/Frameworks/Tcl.Framework' ] # libs=[], # list of shared libs or Frameworks to include ) - -- Kevin Walzer Poetic Code http://www.kevin-walzer.com -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.1 (Darwin) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFErgaarTC5hIgjqTMRAo0hAKCScEYIGiKg05llIxnYsMhz+O+KoQCfUlaE 6pbjubLo3lbl7sa/Vyva+c8= =Nmo9 -----END PGP SIGNATURE----- From jani at eternum-consulting.com Fri Jul 7 13:12:54 2006 From: jani at eternum-consulting.com (Jani Lahtinen) Date: Fri, 07 Jul 2006 14:12:54 +0300 Subject: [Pythonmac-SIG] No module named appscript Message-ID: <44AE41B6.2040907@eternum-consulting.com> Hello, I just installed the AppScript to my PPC mac from the dmg-file, but when I try to import appscript I get: >>> from appscript import * Traceback (most recent call last): File "", line 1, in ? ImportError: No module named appscript I tried both the 2.3 and 2.4 but the module is not loadable in pythonw. Is there a problem with the installer? Thanks! From kw at kevin-walzer.com Fri Jul 7 16:16:08 2006 From: kw at kevin-walzer.com (Kevin Walzer) Date: Fri, 07 Jul 2006 10:16:08 -0400 Subject: [Pythonmac-SIG] Question about 2.5 beta Message-ID: <44AE6CA8.3070502@kevin-walzer.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 I'm interested in playing with the beta version of 2.5, but only if it will not conflict with my current installation of 2.4.3/universal. Is there a way to safely install the beta without nuking my current installation? If the beta installs the same way that 2.4.3 does, then I'm assuming that it will rewrite my path and install a "python" stub script in /usr/local/bin that points to Python 2.5. That would be an undesirable result. - -- Kevin Walzer Poetic Code http://www.kevin-walzer.com -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.1 (Darwin) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFErmynrTC5hIgjqTMRAlwaAJ9AY/oHvWVegL7QXtU6lM4QONMzKQCfU1jM OoMl5TlewyEh2foTp3nrM5k= =S2M6 -----END PGP SIGNATURE----- From ronaldoussoren at mac.com Fri Jul 7 16:47:03 2006 From: ronaldoussoren at mac.com (Ronald Oussoren) Date: Fri, 07 Jul 2006 16:47:03 +0200 Subject: [Pythonmac-SIG] Question about 2.5 beta In-Reply-To: <44AE6CA8.3070502@kevin-walzer.com> References: <44AE6CA8.3070502@kevin-walzer.com> Message-ID: <16556654.1152283623738.JavaMail.ronaldoussoren@mac.com> On Friday, July 07, 2006, at 04:17PM, Kevin Walzer wrote: >-----BEGIN PGP SIGNED MESSAGE----- >Hash: SHA1 > >I'm interested in playing with the beta version of 2.5, but only if it >will not conflict with my current installation of 2.4.3/universal. Is >there a way to safely install the beta without nuking my current >installation? If the beta installs the same way that 2.4.3 does, then >I'm assuming that it will rewrite my path and install a "python" stub >script in /usr/local/bin that points to Python 2.5. That would be an >undesirable result. The installer is a mpkg, when you customize the installation you can avoid installing the profile changes and unix tools. The package names should be fairly obvious. This will still change the Current link in the Python.framework to 2.5, but that shouldn't cause problems as nobody should link using '-framework Python' anyway. This certainly doesn't affect distutils. Ronald From sidd.krish at gmail.com Fri Jul 7 17:16:49 2006 From: sidd.krish at gmail.com (Siddartha Krishnan) Date: Fri, 7 Jul 2006 11:16:49 -0400 Subject: [Pythonmac-SIG] Using SWIG, C++, and OS X - and Boost.Python In-Reply-To: <44AD587F.1030401@cognitoy.com> References: <7C745543-BA7D-46DA-AC8D-51D4ADBC2AA8@gmail.com> <44AD587F.1030401@cognitoy.com> Message-ID: Hi, Thanks for your help. I can now build the module and import and use it in Python (using SWIG)! Regarding Boost.Python, I am unable to run bjam successfully. I get the following error: user409:~/boosttest siddarthakrishnan$ ls Jamfile Jamrules hello.cpp user409:~/boosttest siddarthakrishnan$ bjam -sTOOLS=darwin Failed to find the project root for directory '.'. Did not find a project-root.jam file there or in any of its parent directories. Please consult the documentation at 'http://www.boost.org'. I have changed the project root path in Jamrules to the Boost directory. project-root.jam is in the directory. Does anyone know how to solve this error. Thanks, Siddartha On 6-Jul-06, at 2:37 PM, Kent Quirk wrote: > Siddartha Krishnan wrote: >> I'm new to using SWIG for python. I am having several problems >> creating a C++ extension module for python. I am using OS X 10.4 >> with python 2.4 and SWIG 1.3.29 (using darwinports). >> >> I can use SWIG and distutils in order to make a C extension >> module for python, however, I cannot do so for a C++ extension >> module - I get an import error: >> >> mie-15-203:~/swig/class_test siddarthakrishnan$ python mymod.py >> Traceback (most recent call last): >> File "mymod.py", line 5, in ? >> import _mymod >> ImportError: Failure linking new module: /Users/siddarthakrishnan/ >> SWIG/class_test/_mymod.so: Symbol not found: __ZN9SomeClassC1Eii >> Referenced from: /Users/siddarthakrishnan/SWIG/class_test/ >> _mymod.so >> Expected in: dynamic lookup >> >> The setup.py file is as follows: >> >> # setup.py >> from distutils.core import setup, Extension >> setup (name = "_mymod", >> version = "1.0", >> maintainer = "Your Name", >> maintainer_email = "your.name at domain.org", >> description = "Sample Python C++ Extension", >> ext_modules = [Extension('_mymod', >> sources=['mymod_wrap.cxx'])]) >> >> Does anyone know how to create a setup.py file that works with c+ >> + extension modules? >> >> > I've never used SWIG, but I think your problem is related to name > mangling. > > Because C++ is designed to work with primitive linker technology > (which uses names and only names for symbol resolution), it can't > rely on the linker to be able to put together overloaded functions > properly. If you have functions called abs(float) and abs(int), if > the only name exported was abs, there'd be a conflict. So C++ > "mangles" the names to include type information. > > You can tell C++ to leave the names alone (giving them C linkage > semantics) by using extern "C" like so: > > extern "C" void myfunc(int x) > { > } > > on the routines that you want to make available to Python. > Understand that they'll have to be pure external functions, not > members of classes. > > You should probably read and understand this: > > http://llama.med.harvard.edu/~fgibbons/doc/SWIG1.3.10/Manual/SWIG.html > > If you're into C++ and want to use the power of C++ in conjunction > with Python, consider using boost::python instead of SWIG. > > Kent > Are you linking with all libraries that are needed for the extension? Your module seems to be missing 'SomeClass::SomeClass(int, int)'. If you do the link step that setup.py generates manually, but add '- framework Python' and remove '-undefined surpress' you should get a list of all symbols that aren't present in the extension. However, don't build the final version of the extension like that. Ronald From glassfordm at hotmail.com Fri Jul 7 18:49:55 2006 From: glassfordm at hotmail.com (Michael Glassford) Date: Fri, 07 Jul 2006 12:49:55 -0400 Subject: [Pythonmac-SIG] Pythonw 2.3.5 error on OSX 10.3.9 Message-ID: When I try to run /usr/local/bin/pythonw2.3, I get the error: """ /usr/local/bin/pythonw2.3: line 2: /Library/Frameworks/Python.framework/Versions/2.3/Resources/Python.app/Contents/MacOS/Python: No such file or directory /usr/local/bin/pythonw2.3: line 2: exec: /Library/Frameworks/Python.framework/Versions/2.3/Resources/Python.app/Contents/MacOS/Python: cannot execute: No such file or directory """ If I check, there is in fact a "/Library/Frameworks/Python.framework/Versions/2.3" directory, but it contains no "Resources" subdirectory. I've tried reinstalling Python 2.3.5, but nothing changed. In other respects, Python 2.3.5 is correctly installed, because /usr/local/bin/python2.3 runs correctly and reports that it is, in fact version 2.3.5. Any ideas? Mike From kw at kevin-walzer.com Fri Jul 7 19:35:29 2006 From: kw at kevin-walzer.com (Kevin Walzer) Date: Fri, 07 Jul 2006 13:35:29 -0400 Subject: [Pythonmac-SIG] Pythonw 2.3.5 error on OSX 10.3.9 In-Reply-To: References: Message-ID: <44AE9B61.5010605@kevin-walzer.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Michael Glassford wrote: > When I try to run /usr/local/bin/pythonw2.3, I get the error: > > """ > /usr/local/bin/pythonw2.3: line 2: > /Library/Frameworks/Python.framework/Versions/2.3/Resources/Python.app/Contents/MacOS/Python: > No such file or directory > /usr/local/bin/pythonw2.3: line 2: exec: > /Library/Frameworks/Python.framework/Versions/2.3/Resources/Python.app/Contents/MacOS/Python: > cannot execute: No such file or directory > """ > > If I check, there is in fact a > "/Library/Frameworks/Python.framework/Versions/2.3" directory, but it > contains no "Resources" subdirectory. > > I've tried reinstalling Python 2.3.5, but nothing changed. In other > respects, Python 2.3.5 is correctly installed, because > /usr/local/bin/python2.3 runs correctly and reports that it is, in fact > version 2.3.5. > > Any ideas? > > > Mike > > _______________________________________________ > Pythonmac-SIG maillist - Pythonmac-SIG at python.org > http://mail.python.org/mailman/listinfo/pythonmac-sig > > I'm confused. Python 2.3.5 is the version of Python that ships with OS X 10.4, and it's installed in /usr/bin. It should not be removed because various system components depend on it. If you've somehow removed that, you may want to reinstall the OS. I'm not aware of a widely-distributed version of Python 2.3.5 that installs in /usr/local/bin. The most recent versions in widespread distribution are 2.4.1 and 2.4.3, just released as a "universal binary" build. Look at http://macpython.org/packages for download links. So where did your 2.3.5 build come from? Did you build it yourself? If so, it should be pretty easy to rebuild. - -- Kevin Walzer Poetic Code http://www.kevin-walzer.com -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.1 (Darwin) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFErptgrTC5hIgjqTMRAjAGAJ48N3cYNtg/LlOyO0HOZMOdtaWRHgCgpQjU 10hDE8/zetpKqrMPzaGzKbU= =g6NI -----END PGP SIGNATURE----- From glassfordm at hotmail.com Fri Jul 7 19:44:59 2006 From: glassfordm at hotmail.com (Michael Glassford) Date: Fri, 07 Jul 2006 13:44:59 -0400 Subject: [Pythonmac-SIG] Building python 2.4.3 on OSX 10.3.9 Message-ID: When I try to build Python 2.4.3 on OSX 10.3.9, I get the following error: """ gcc -c -fno-strict-aliasing -Wno-long-double -no-cpp-precomp -mno-fused-madd -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -I. -I./Include -DPy_BUILD_CORE -DPYTHONPATH='":plat-darwin:plat-mac:plat-mac/lib-scriptpackages:lib-tk"' \ -DPREFIX='"/usr/local"' \ -DEXEC_PREFIX='"/usr/local"' \ -DVERSION='"2.4"' \ -DVPATH='""' \ -o Modules/getpath.o ./Modules/getpath.c Modules/getpath.c: In function `calculate_path': Modules/getpath.c:385: `uint32_t' undeclared (first use in this function) Modules/getpath.c:385: (Each undeclared identifier is reported only once Modules/getpath.c:385: for each function it appears in.) Modules/getpath.c:385: parse error before "nsexeclength" Modules/getpath.c:409: `nsexeclength' undeclared (first use in this function) make: *** [Modules/getpath.o] Error 1 """ Does this mean that the configure process didn't work properly? That something's wrong with lib-tk? Something else? If it might be a lib-tk problem, is there a way to remove it from the installation, since I don't need it? Mike From bob at redivi.com Fri Jul 7 19:53:25 2006 From: bob at redivi.com (Bob Ippolito) Date: Fri, 7 Jul 2006 10:53:25 -0700 Subject: [Pythonmac-SIG] Building python 2.4.3 on OSX 10.3.9 In-Reply-To: References: Message-ID: On Jul 7, 2006, at 10:44 AM, Michael Glassford wrote: > When I try to build Python 2.4.3 on OSX 10.3.9, I get the following > error: > > """ > gcc -c -fno-strict-aliasing -Wno-long-double -no-cpp-precomp > -mno-fused-madd -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -I. > -I./Include -DPy_BUILD_CORE > -DPYTHONPATH='":plat-darwin:plat-mac:plat-mac/lib- > scriptpackages:lib-tk"' \ > -DPREFIX='"/usr/local"' \ > -DEXEC_PREFIX='"/usr/local"' \ > -DVERSION='"2.4"' \ > -DVPATH='""' \ > -o Modules/getpath.o ./Modules/getpath.c > Modules/getpath.c: In function `calculate_path': > Modules/getpath.c:385: `uint32_t' undeclared (first use in this > function) > Modules/getpath.c:385: (Each undeclared identifier is reported only > once > Modules/getpath.c:385: for each function it appears in.) > Modules/getpath.c:385: parse error before "nsexeclength" > Modules/getpath.c:409: `nsexeclength' undeclared (first use in this > function) > make: *** [Modules/getpath.o] Error 1 > """ > > Does this mean that the configure process didn't work properly? That > something's wrong with lib-tk? Something else? > > If it might be a lib-tk problem, is there a way to remove it from the > installation, since I don't need it? Sounds like you might not have the latest version of Xcode installed. Why are you building it yourself anyway? -bob From glassfordm at gmail.com Fri Jul 7 19:55:04 2006 From: glassfordm at gmail.com (Michael Glassford) Date: Fri, 07 Jul 2006 13:55:04 -0400 Subject: [Pythonmac-SIG] Pythonw 2.3.5 error on OSX 10.3.9 In-Reply-To: <44AE9B61.5010605@kevin-walzer.com> References: <44AE9B61.5010605@kevin-walzer.com> Message-ID: <44AE9FF8.4060904@hotmail.com> Kevin Walzer wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > Michael Glassford wrote: >> When I try to run /usr/local/bin/pythonw2.3, I get the error: >> >> """ >> /usr/local/bin/pythonw2.3: line 2: >> /Library/Frameworks/Python.framework/Versions/2.3/Resources/Python.app/Contents/MacOS/Python: >> No such file or directory >> /usr/local/bin/pythonw2.3: line 2: exec: >> /Library/Frameworks/Python.framework/Versions/2.3/Resources/Python.app/Contents/MacOS/Python: >> cannot execute: No such file or directory >> """ >> >> If I check, there is in fact a >> "/Library/Frameworks/Python.framework/Versions/2.3" directory, but it >> contains no "Resources" subdirectory. >> >> I've tried reinstalling Python 2.3.5, but nothing changed. In other >> respects, Python 2.3.5 is correctly installed, because >> /usr/local/bin/python2.3 runs correctly and reports that it is, in fact >> version 2.3.5. >> >> Any ideas? >> >> >> Mike >> >> _______________________________________________ >> Pythonmac-SIG maillist - Pythonmac-SIG at python.org >> http://mail.python.org/mailman/listinfo/pythonmac-sig >> >> > I'm confused. > > Python 2.3.5 is the version of Python that ships with OS X 10.4, and > it's installed in /usr/bin. This isn't OS X 10.4, it's 10.3.9. > It should not be removed because various > system components depend on it. If you've somehow removed that, you may > want to reinstall the OS. I haven't removed anything. Mac OSX 10.3 ships with Python 2.3, and that's still there and runs just fine. I'm trying to install an updated version. > I'm not aware of a widely-distributed version of Python 2.3.5 that > installs in /usr/local/bin. If not in /usr/local/bin, where should I look for it on OSX 10.3.9? > The most recent versions in widespread > distribution are 2.4.1 and 2.4.3, just released as a "universal binary" > build. Look at http://macpython.org/packages for download links. I'm having other problems with 2.4.3 that I will ask about and have asked about in other messages. That's one of the reasons I'm trying to get 2.3 updated to 2.3.5--to use it until I can get 2.4.3 working. There are other reasons as well. > So where did your 2.3.5 build come from? Did you build it yourself? If > so, it should be pretty easy to rebuild. I'm not sure where the version of 2.3.5 build that was on the machine came from. The one I'm trying to install is from the source I downloaded from python.org. > > - -- > Kevin Walzer > Poetic Code > http://www.kevin-walzer.com > -----BEGIN PGP SIGNATURE----- > Version: GnuPG v1.4.1 (Darwin) > Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org > > iD8DBQFErptgrTC5hIgjqTMRAjAGAJ48N3cYNtg/LlOyO0HOZMOdtaWRHgCgpQjU > 10hDE8/zetpKqrMPzaGzKbU= > =g6NI > -----END PGP SIGNATURE----- > _______________________________________________ > Pythonmac-SIG maillist - Pythonmac-SIG at python.org > http://mail.python.org/mailman/listinfo/pythonmac-sig > From glassfordm at hotmail.com Fri Jul 7 19:55:04 2006 From: glassfordm at hotmail.com (Michael Glassford) Date: Fri, 07 Jul 2006 13:55:04 -0400 Subject: [Pythonmac-SIG] Pythonw 2.3.5 error on OSX 10.3.9 In-Reply-To: <44AE9B61.5010605@kevin-walzer.com> References: <44AE9B61.5010605@kevin-walzer.com> Message-ID: <44AE9FF8.4060904@hotmail.com> Kevin Walzer wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > Michael Glassford wrote: >> When I try to run /usr/local/bin/pythonw2.3, I get the error: >> >> """ >> /usr/local/bin/pythonw2.3: line 2: >> /Library/Frameworks/Python.framework/Versions/2.3/Resources/Python.app/Contents/MacOS/Python: >> No such file or directory >> /usr/local/bin/pythonw2.3: line 2: exec: >> /Library/Frameworks/Python.framework/Versions/2.3/Resources/Python.app/Contents/MacOS/Python: >> cannot execute: No such file or directory >> """ >> >> If I check, there is in fact a >> "/Library/Frameworks/Python.framework/Versions/2.3" directory, but it >> contains no "Resources" subdirectory. >> >> I've tried reinstalling Python 2.3.5, but nothing changed. In other >> respects, Python 2.3.5 is correctly installed, because >> /usr/local/bin/python2.3 runs correctly and reports that it is, in fact >> version 2.3.5. >> >> Any ideas? >> >> >> Mike >> >> _______________________________________________ >> Pythonmac-SIG maillist - Pythonmac-SIG at python.org >> http://mail.python.org/mailman/listinfo/pythonmac-sig >> >> > I'm confused. > > Python 2.3.5 is the version of Python that ships with OS X 10.4, and > it's installed in /usr/bin. This isn't OS X 10.4, it's 10.3.9. > It should not be removed because various > system components depend on it. If you've somehow removed that, you may > want to reinstall the OS. I haven't removed anything. Mac OSX 10.3 ships with Python 2.3, and that's still there and runs just fine. I'm trying to install an updated version. > I'm not aware of a widely-distributed version of Python 2.3.5 that > installs in /usr/local/bin. If not in /usr/local/bin, where should I look for it on OSX 10.3.9? > The most recent versions in widespread > distribution are 2.4.1 and 2.4.3, just released as a "universal binary" > build. Look at http://macpython.org/packages for download links. I'm having other problems with 2.4.3 that I will ask about and have asked about in other messages. That's one of the reasons I'm trying to get 2.3 updated to 2.3.5--to use it until I can get 2.4.3 working. There are other reasons as well. > So where did your 2.3.5 build come from? Did you build it yourself? If > so, it should be pretty easy to rebuild. I'm not sure where the version of 2.3.5 build that was on the machine came from. The one I'm trying to install is from the source I downloaded from python.org. > > - -- > Kevin Walzer > Poetic Code > http://www.kevin-walzer.com > -----BEGIN PGP SIGNATURE----- > Version: GnuPG v1.4.1 (Darwin) > Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org > > iD8DBQFErptgrTC5hIgjqTMRAjAGAJ48N3cYNtg/LlOyO0HOZMOdtaWRHgCgpQjU > 10hDE8/zetpKqrMPzaGzKbU= > =g6NI > -----END PGP SIGNATURE----- > _______________________________________________ > Pythonmac-SIG maillist - Pythonmac-SIG at python.org > http://mail.python.org/mailman/listinfo/pythonmac-sig > From Chris.Barker at noaa.gov Fri Jul 7 19:57:06 2006 From: Chris.Barker at noaa.gov (Christopher Barker) Date: Fri, 07 Jul 2006 10:57:06 -0700 Subject: [Pythonmac-SIG] Question about 2.5 beta In-Reply-To: <16556654.1152283623738.JavaMail.ronaldoussoren@mac.com> References: <44AE6CA8.3070502@kevin-walzer.com> <16556654.1152283623738.JavaMail.ronaldoussoren@mac.com> Message-ID: <44AEA072.3020401@noaa.gov> Ronald Oussoren wrote: > The installer is a mpkg, when you customize the installation you can > avoid installing the profile changes and unix tools. The package > names should be fairly obvious. Also, python2.3 python2.4 python2.5 should still be available. That's why I like to put: #!/usr/bin/env python2.4 In my #! lines. -Chris -- Christopher Barker, Ph.D. Oceanographer NOAA/OR&R/HAZMAT (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 glassfordm at gmail.com Fri Jul 7 20:20:30 2006 From: glassfordm at gmail.com (Michael Glassford) Date: Fri, 07 Jul 2006 14:20:30 -0400 Subject: [Pythonmac-SIG] Building python 2.4.3 on OSX 10.3.9 In-Reply-To: References: Message-ID: <44AEA5EE.5040509@hotmail.com> Bob Ippolito wrote: > On Jul 7, 2006, at 10:44 AM, Michael Glassford wrote: > >> When I try to build Python 2.4.3 on OSX 10.3.9, I get the following >> error: >> >> """ >> gcc -c -fno-strict-aliasing -Wno-long-double -no-cpp-precomp >> -mno-fused-madd -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -I. >> -I./Include -DPy_BUILD_CORE >> -DPYTHONPATH='":plat-darwin:plat-mac:plat-mac/lib- >> scriptpackages:lib-tk"' \ >> -DPREFIX='"/usr/local"' \ >> -DEXEC_PREFIX='"/usr/local"' \ >> -DVERSION='"2.4"' \ >> -DVPATH='""' \ >> -o Modules/getpath.o ./Modules/getpath.c >> Modules/getpath.c: In function `calculate_path': >> Modules/getpath.c:385: `uint32_t' undeclared (first use in this >> function) >> Modules/getpath.c:385: (Each undeclared identifier is reported only >> once >> Modules/getpath.c:385: for each function it appears in.) >> Modules/getpath.c:385: parse error before "nsexeclength" >> Modules/getpath.c:409: `nsexeclength' undeclared (first use in this >> function) >> make: *** [Modules/getpath.o] Error 1 >> """ >> >> Does this mean that the configure process didn't work properly? That >> something's wrong with lib-tk? Something else? >> >> If it might be a lib-tk problem, is there a way to remove it from the >> installation, since I don't need it? > > Sounds like you might not have the latest version of Xcode installed. As far as I can tell, XCode isn't installed at all. I ran the XCode 2.3 installer, but it says "You can only install this software on MacOS 10.4". I couldn't find installers for any earlier versions of XCode. > Why are you building it yourself anyway? I already ran the installer for the universal binary version of 2.4.3. When I run that version of Python and "import bz2", I get the error: """ >>> import bz2 Traceback (most recent call last): File "", line 1, in ? ImportError: Failure linking new module: /usr/lib/libbz2.1.0.dylib: dyld: /Library/Frameworks/Python.framework/Versions/2.4/Resources/Python.app/Contents/MacOS/Python can't open library: /usr/lib/libbz2.1.0.dylib (No such file or directory, errno = 2) """ This is the same error I reported on 6/28/06 in a different context: a py2app application built on OSX 10.4 gives me this error when run on OSX 10.3.9. I hadn't realized at the time that I would get the same error when I ran Python 2.4.3 on 10.3.9. I was hoping that if I built the Python myself, it would link correctly to the version of libbz2 that is on OSX 10.3.9. > -bob > > _______________________________________________ > Pythonmac-SIG maillist - Pythonmac-SIG at python.org > http://mail.python.org/mailman/listinfo/pythonmac-sig > From glassfordm at hotmail.com Fri Jul 7 20:20:30 2006 From: glassfordm at hotmail.com (Michael Glassford) Date: Fri, 07 Jul 2006 14:20:30 -0400 Subject: [Pythonmac-SIG] Building python 2.4.3 on OSX 10.3.9 In-Reply-To: References: Message-ID: <44AEA5EE.5040509@hotmail.com> Bob Ippolito wrote: > On Jul 7, 2006, at 10:44 AM, Michael Glassford wrote: > >> When I try to build Python 2.4.3 on OSX 10.3.9, I get the following >> error: >> >> """ >> gcc -c -fno-strict-aliasing -Wno-long-double -no-cpp-precomp >> -mno-fused-madd -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -I. >> -I./Include -DPy_BUILD_CORE >> -DPYTHONPATH='":plat-darwin:plat-mac:plat-mac/lib- >> scriptpackages:lib-tk"' \ >> -DPREFIX='"/usr/local"' \ >> -DEXEC_PREFIX='"/usr/local"' \ >> -DVERSION='"2.4"' \ >> -DVPATH='""' \ >> -o Modules/getpath.o ./Modules/getpath.c >> Modules/getpath.c: In function `calculate_path': >> Modules/getpath.c:385: `uint32_t' undeclared (first use in this >> function) >> Modules/getpath.c:385: (Each undeclared identifier is reported only >> once >> Modules/getpath.c:385: for each function it appears in.) >> Modules/getpath.c:385: parse error before "nsexeclength" >> Modules/getpath.c:409: `nsexeclength' undeclared (first use in this >> function) >> make: *** [Modules/getpath.o] Error 1 >> """ >> >> Does this mean that the configure process didn't work properly? That >> something's wrong with lib-tk? Something else? >> >> If it might be a lib-tk problem, is there a way to remove it from the >> installation, since I don't need it? > > Sounds like you might not have the latest version of Xcode installed. As far as I can tell, XCode isn't installed at all. I ran the XCode 2.3 installer, but it says "You can only install this software on MacOS 10.4". I couldn't find installers for any earlier versions of XCode. > Why are you building it yourself anyway? I already ran the installer for the universal binary version of 2.4.3. When I run that version of Python and "import bz2", I get the error: """ >>> import bz2 Traceback (most recent call last): File "", line 1, in ? ImportError: Failure linking new module: /usr/lib/libbz2.1.0.dylib: dyld: /Library/Frameworks/Python.framework/Versions/2.4/Resources/Python.app/Contents/MacOS/Python can't open library: /usr/lib/libbz2.1.0.dylib (No such file or directory, errno = 2) """ This is the same error I reported on 6/28/06 in a different context: a py2app application built on OSX 10.4 gives me this error when run on OSX 10.3.9. I hadn't realized at the time that I would get the same error when I ran Python 2.4.3 on 10.3.9. I was hoping that if I built the Python myself, it would link correctly to the version of libbz2 that is on OSX 10.3.9. > -bob > > _______________________________________________ > Pythonmac-SIG maillist - Pythonmac-SIG at python.org > http://mail.python.org/mailman/listinfo/pythonmac-sig > From jani at eternum-consulting.com Fri Jul 7 20:23:03 2006 From: jani at eternum-consulting.com (Jani H Lahtinen) Date: Fri, 07 Jul 2006 21:23:03 +0300 Subject: [Pythonmac-SIG] No module named appscript In-Reply-To: <11CD9218-AF9A-4615-9ED5-EBBC926A0180@mac.com> References: <44AE41B6.2040907@eternum-consulting.com> <11CD9218-AF9A-4615-9ED5-EBBC926A0180@mac.com> Message-ID: <44AEA687.3090000@eternum-consulting.com> Jordan Breeding wrote: > On Jul 07, 2006, at 06:12 , Jani Lahtinen wrote: > >> Hello, >> >> I just installed the AppScript to my PPC mac from the dmg-file, but when >> I try to import appscript I get: >> >>>>> from appscript import * >> Traceback (most recent call last): >> File "", line 1, in ? >> ImportError: No module named appscript >> >> I tried both the 2.3 and 2.4 but the module is not loadable in pythonw. >> Is there a problem with the installer? >> >> Thanks! >> _______________________________________________ >> Pythonmac-SIG maillist - Pythonmac-SIG at python.org >> http://mail.python.org/mailman/listinfo/pythonmac-sig > > Just use the installer here and install the version you need: > http://freespace.virgin.net/hamish.sanderson/appscript.html That is what I used. Sorry Jordan for sending the first reply to you only. From goodmansond at gmail.com Sat Jul 8 09:08:47 2006 From: goodmansond at gmail.com (DeanG) Date: Sat, 8 Jul 2006 02:08:47 -0500 Subject: [Pythonmac-SIG] 06 WWDC and Python? Message-ID: Is there any formal or informal Python related activities at WWDC this year? From bob at redivi.com Sat Jul 8 10:12:47 2006 From: bob at redivi.com (Bob Ippolito) Date: Sat, 8 Jul 2006 01:12:47 -0700 Subject: [Pythonmac-SIG] 06 WWDC and Python? In-Reply-To: References: Message-ID: On Jul 8, 2006, at 12:08 AM, DeanG wrote: > Is there any formal or informal Python related activities at WWDC > this year? I don't know of anything planned yet, and I don't think there's anything formal. We could definitely arrange for something informal though -- beer somewhere. Bill would probably be the best person to herd the cats... I can send the word out to a few others in the city once we have a plan. -bob From piet at cs.uu.nl Sat Jul 8 17:27:36 2006 From: piet at cs.uu.nl (Piet van Oostrum) Date: Sat, 08 Jul 2006 17:27:36 +0200 Subject: [Pythonmac-SIG] Building python 2.4.3 on OSX 10.3.9 In-Reply-To: <44AEA5EE.5040509@hotmail.com> References: <44AEA5EE.5040509@hotmail.com> Message-ID: >>>>> Michael Glassford (MG) wrote: >MG> As far as I can tell, XCode isn't installed at all. I ran the XCode 2.3 >MG> installer, but it says "You can only install this software on MacOS >MG> 10.4". I couldn't find installers for any earlier versions of XCode. When you haven't XCode installed, how come you have gcc? -- Piet van Oostrum URL: http://www.cs.uu.nl/~piet [PGP 8DAE142BE17999C4] Private email: piet at vanoostrum.org From ronaldoussoren at mac.com Sat Jul 8 18:55:43 2006 From: ronaldoussoren at mac.com (Ronald Oussoren) Date: Sat, 8 Jul 2006 18:55:43 +0200 Subject: [Pythonmac-SIG] Building python 2.4.3 on OSX 10.3.9 In-Reply-To: References: <44AEA5EE.5040509@hotmail.com> Message-ID: On Jul 8, 2006, at 5:27 PM, Piet van Oostrum wrote: >>>>>> Michael Glassford (MG) wrote: > >> MG> As far as I can tell, XCode isn't installed at all. I ran the >> XCode 2.3 >> MG> installer, but it says "You can only install this software on >> MacOS >> MG> 10.4". I couldn't find installers for any earlier versions of >> XCode. > > When you haven't XCode installed, how come you have gcc? IIRC Xcode 1.5 installs on 10.3.9. Michael, do you have a /Developer folder on your system? If you do you have some edition of the developer tools installed. Ronald -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 2157 bytes Desc: not available Url : http://mail.python.org/pipermail/pythonmac-sig/attachments/20060708/5f604678/attachment.bin From hengist.podd at virgin.net Sat Jul 8 23:05:55 2006 From: hengist.podd at virgin.net (has) Date: Sat, 8 Jul 2006 22:05:55 +0100 Subject: [Pythonmac-SIG] No module named appscript In-Reply-To: References: Message-ID: Jani Lahtinen wrote: > I just installed the AppScript to my PPC mac from the dmg-file, but > when I try to import appscript I get: > > >>> from appscript import * > Traceback (most recent call last): > File "", line 1, in ? > ImportError: No module named appscript > > I tried both the 2.3 and 2.4 but the module is not loadable in > pythonw. Is there a problem with the installer? Shouldn't be; never had any problems before. Are you sure you're using the right python interpreter (i.e. not one for Fink/DarwinPorts Python)? Did you check the site-packages folders for your Python installations to see the files have been installed okay? Apple-installed 2.3: /Library/Python/2.3 (Panther) /Library/Python/2.3/site-packages (Tiger) User-installed MacPython 2.4: /Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site- packages HTH has -- http://freespace.virgin.net/hamish.sanderson/ From piet at cs.uu.nl Sat Jul 8 23:53:55 2006 From: piet at cs.uu.nl (Piet van Oostrum) Date: Sat, 08 Jul 2006 23:53:55 +0200 Subject: [Pythonmac-SIG] Building python 2.4.3 on OSX 10.3.9 In-Reply-To: References: <44AEA5EE.5040509@hotmail.com> Message-ID: <17584.10611.434247.368115@ordesa.cs.uu.nl> >>>>> Ronald Oussoren (RO) wrote: >RO> Michael, do you have a /Developer folder on your system? If you do >RO> you have some edition of the developer tools installed. IIRC, the developer tools had a different name than XCode in older versions of Mac OS X. -- Piet van Oostrum URL: http://www.cs.uu.nl/~piet [PGP 8DAE142BE17999C4] Private email: piet at vanoostrum.org From bbum at mac.com Sun Jul 9 00:01:57 2006 From: bbum at mac.com (Bill Bumgarner) Date: Sat, 8 Jul 2006 15:01:57 -0700 Subject: [Pythonmac-SIG] 06 WWDC and Python? In-Reply-To: References: Message-ID: <80B27A94-7FBC-4166-9CCF-1BCC60BDF4F2@mac.com> On Jul 8, 2006, at 1:12 AM, Bob Ippolito wrote: > On Jul 8, 2006, at 12:08 AM, DeanG wrote: >> Is there any formal or informal Python related activities at WWDC >> this year? > > I don't know of anything planned yet, and I don't think there's > anything formal. We could definitely arrange for something informal > though -- beer somewhere. Bill would probably be the best person to > herd the cats... I can send the word out to a few others in the > city once we have a plan. There is always Tommy's on Saturday and Wednesday. Usually there is a BOF or something on one of the other nights. From glassfordm at gmail.com Sun Jul 9 03:29:03 2006 From: glassfordm at gmail.com (Michael Glassford) Date: Sat, 08 Jul 2006 21:29:03 -0400 Subject: [Pythonmac-SIG] Building python 2.4.3 on OSX 10.3.9 In-Reply-To: References: <44AEA5EE.5040509@hotmail.com> Message-ID: <44B05BDF.8090707@hotmail.com> Piet van Oostrum wrote: >>>>>> Michael Glassford (MG) wrote: > >> MG> As far as I can tell, XCode isn't installed at all. I ran the XCode 2.3 >> MG> installer, but it says "You can only install this software on MacOS >> MG> 10.4". I couldn't find installers for any earlier versions of XCode. > > When you haven't XCode installed, how come you have gcc? I don't know. I wasn't the one who configured it. Mike From glassfordm at hotmail.com Sun Jul 9 03:29:03 2006 From: glassfordm at hotmail.com (Michael Glassford) Date: Sat, 08 Jul 2006 21:29:03 -0400 Subject: [Pythonmac-SIG] Building python 2.4.3 on OSX 10.3.9 In-Reply-To: References: <44AEA5EE.5040509@hotmail.com> Message-ID: <44B05BDF.8090707@hotmail.com> Piet van Oostrum wrote: >>>>>> Michael Glassford (MG) wrote: > >> MG> As far as I can tell, XCode isn't installed at all. I ran the XCode 2.3 >> MG> installer, but it says "You can only install this software on MacOS >> MG> 10.4". I couldn't find installers for any earlier versions of XCode. > > When you haven't XCode installed, how come you have gcc? I don't know. I wasn't the one who configured it. Mike From glassfordm at gmail.com Sun Jul 9 03:31:14 2006 From: glassfordm at gmail.com (Michael Glassford) Date: Sat, 08 Jul 2006 21:31:14 -0400 Subject: [Pythonmac-SIG] Building python 2.4.3 on OSX 10.3.9 In-Reply-To: References: <44AEA5EE.5040509@hotmail.com> Message-ID: <44B05C62.7080502@hotmail.com> Ronald Oussoren wrote: > > On Jul 8, 2006, at 5:27 PM, Piet van Oostrum wrote: > >>>>>>> Michael Glassford (MG) wrote: >> >>> MG> As far as I can tell, XCode isn't installed at all. I ran the >>> XCode 2.3 >>> MG> installer, but it says "You can only install this software on MacOS >>> MG> 10.4". I couldn't find installers for any earlier versions of XCode. >> >> When you haven't XCode installed, how come you have gcc? > > IIRC Xcode 1.5 installs on 10.3.9. > > Michael, do you have a /Developer folder on your system? I do. > If you do you > have some edition of the developer tools installed. All that was in it were the SDKs I had installed (10.3.9, QuickDraw, CoreAudio; all of which were necessary to fix specific build errors). There was no XCode stuff. I've finally found the Panther install CD and now have XCode 1.5 installed. I've finally successfully build Python 2.4.3, but am now running into other problems building my application. I haven't the time to look into them very deeply yet. They look like QuickTime errors, though I don't know why I should be getting those as the QuickTime SDK is installed. I'll report back if I can't figure it out. Mike From glassfordm at hotmail.com Sun Jul 9 03:31:14 2006 From: glassfordm at hotmail.com (Michael Glassford) Date: Sat, 08 Jul 2006 21:31:14 -0400 Subject: [Pythonmac-SIG] Building python 2.4.3 on OSX 10.3.9 In-Reply-To: References: <44AEA5EE.5040509@hotmail.com> Message-ID: <44B05C62.7080502@hotmail.com> Ronald Oussoren wrote: > > On Jul 8, 2006, at 5:27 PM, Piet van Oostrum wrote: > >>>>>>> Michael Glassford (MG) wrote: >> >>> MG> As far as I can tell, XCode isn't installed at all. I ran the >>> XCode 2.3 >>> MG> installer, but it says "You can only install this software on MacOS >>> MG> 10.4". I couldn't find installers for any earlier versions of XCode. >> >> When you haven't XCode installed, how come you have gcc? > > IIRC Xcode 1.5 installs on 10.3.9. > > Michael, do you have a /Developer folder on your system? I do. > If you do you > have some edition of the developer tools installed. All that was in it were the SDKs I had installed (10.3.9, QuickDraw, CoreAudio; all of which were necessary to fix specific build errors). There was no XCode stuff. I've finally found the Panther install CD and now have XCode 1.5 installed. I've finally successfully build Python 2.4.3, but am now running into other problems building my application. I haven't the time to look into them very deeply yet. They look like QuickTime errors, though I don't know why I should be getting those as the QuickTime SDK is installed. I'll report back if I can't figure it out. Mike From glassfordm at gmail.com Mon Jul 10 17:34:50 2006 From: glassfordm at gmail.com (Michael Glassford) Date: Mon, 10 Jul 2006 11:34:50 -0400 Subject: [Pythonmac-SIG] Building python 2.4.3 on OSX 10.3.9 In-Reply-To: <44B05C62.7080502@hotmail.com> References: <44AEA5EE.5040509@hotmail.com> <44B05C62.7080502@hotmail.com> Message-ID: <44B2739A.1040001@hotmail.com> Michael Glassford wrote: > Ronald Oussoren wrote: >> On Jul 8, 2006, at 5:27 PM, Piet van Oostrum wrote: >> >>>>>>>> Michael Glassford (MG) wrote: >>>> MG> As far as I can tell, XCode isn't installed at all. I ran the >>>> XCode 2.3 >>>> MG> installer, but it says "You can only install this software on MacOS >>>> MG> 10.4". I couldn't find installers for any earlier versions of XCode. >>> When you haven't XCode installed, how come you have gcc? >> IIRC Xcode 1.5 installs on 10.3.9. >> >> Michael, do you have a /Developer folder on your system? > I do. > >> If you do you >> have some edition of the developer tools installed. > > All that was in it were the SDKs I had installed (10.3.9, QuickDraw, > CoreAudio; all of which were necessary to fix specific build errors). > There was no XCode stuff. I've finally found the Panther install CD and > now have XCode 1.5 installed. I've finally successfully build Python > 2.4.3, but am now running into other problems building my application. I > haven't the time to look into them very deeply yet. They look like > QuickTime errors, though I don't know why I should be getting those as > the QuickTime SDK is installed. I'll report back if I can't figure it out. OK, now that I've built Python, I'm running into this problem building PyObjC: """ building 'QTKit._QTKit' extension gcc -fno-strict-aliasing -Wno-long-double -no-cpp-precomp -mno-fused-madd -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -I/usr/local/include/python2.4 -c Modules/QTKit/_QTKit.m -o build/temp.darwin-7.9.0-Power_Macintosh-2.4/Modules/QTKit/_QTKit.o -IModules/objc -DMACOSX -DAPPLE_RUNTIME -no-cpp-precomp -Wno-long-double -g -Wall -Wstrict-prototypes -Wmissing-prototypes -Wformat=2 -W -Wshadow -Wpointer-arith -Wmissing-declarations -Wnested-externs -Wno-long-long -Wno-import -Ibuild/codegen/ In file included from /System/Library/Frameworks/QTKit.framework/Headers/QTKit.h:10, from Modules/QTKit/_QTKit.m:8: /System/Library/Frameworks/QTKit.framework/Headers/QTDataReference.h:14: error: parse error before "AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER" /System/Library/Frameworks/QTKit.framework/Headers/QTDataReference.h:15: error: parse error before "AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER" /System/Library/Frameworks/QTKit.framework/Headers/QTDataReference.h:16: error: parse error before "AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER" /System/Library/Frameworks/QTKit.framework/Headers/QTDataReference.h:17: error: parse error before "AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER" /System/Library/Frameworks/QTKit.framework/Headers/QTDataReference.h:18: error: parse error before "AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER" In file included from /System/Library/Frameworks/QTKit.framework/Headers/QTMovie.h:12, from /System/Library/Frameworks/QTKit.framework/Headers/QTKit.h:11, from Modules/QTKit/_QTKit.m:8: """ I've found references online to similar problems when QuickTime 7 is installed on OS X 10.3.9 (which is the case here), but no solutions. I'd gladly downgrade to an earlier version of QuickTime if I knew how (I'm not using QuickTime), but haven't discovered any way to do it. Mike From glassfordm at hotmail.com Mon Jul 10 17:34:50 2006 From: glassfordm at hotmail.com (Michael Glassford) Date: Mon, 10 Jul 2006 11:34:50 -0400 Subject: [Pythonmac-SIG] Building python 2.4.3 on OSX 10.3.9 In-Reply-To: <44B05C62.7080502@hotmail.com> References: <44AEA5EE.5040509@hotmail.com> <44B05C62.7080502@hotmail.com> Message-ID: <44B2739A.1040001@hotmail.com> Michael Glassford wrote: > Ronald Oussoren wrote: >> On Jul 8, 2006, at 5:27 PM, Piet van Oostrum wrote: >> >>>>>>>> Michael Glassford (MG) wrote: >>>> MG> As far as I can tell, XCode isn't installed at all. I ran the >>>> XCode 2.3 >>>> MG> installer, but it says "You can only install this software on MacOS >>>> MG> 10.4". I couldn't find installers for any earlier versions of XCode. >>> When you haven't XCode installed, how come you have gcc? >> IIRC Xcode 1.5 installs on 10.3.9. >> >> Michael, do you have a /Developer folder on your system? > I do. > >> If you do you >> have some edition of the developer tools installed. > > All that was in it were the SDKs I had installed (10.3.9, QuickDraw, > CoreAudio; all of which were necessary to fix specific build errors). > There was no XCode stuff. I've finally found the Panther install CD and > now have XCode 1.5 installed. I've finally successfully build Python > 2.4.3, but am now running into other problems building my application. I > haven't the time to look into them very deeply yet. They look like > QuickTime errors, though I don't know why I should be getting those as > the QuickTime SDK is installed. I'll report back if I can't figure it out. OK, now that I've built Python, I'm running into this problem building PyObjC: """ building 'QTKit._QTKit' extension gcc -fno-strict-aliasing -Wno-long-double -no-cpp-precomp -mno-fused-madd -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -I/usr/local/include/python2.4 -c Modules/QTKit/_QTKit.m -o build/temp.darwin-7.9.0-Power_Macintosh-2.4/Modules/QTKit/_QTKit.o -IModules/objc -DMACOSX -DAPPLE_RUNTIME -no-cpp-precomp -Wno-long-double -g -Wall -Wstrict-prototypes -Wmissing-prototypes -Wformat=2 -W -Wshadow -Wpointer-arith -Wmissing-declarations -Wnested-externs -Wno-long-long -Wno-import -Ibuild/codegen/ In file included from /System/Library/Frameworks/QTKit.framework/Headers/QTKit.h:10, from Modules/QTKit/_QTKit.m:8: /System/Library/Frameworks/QTKit.framework/Headers/QTDataReference.h:14: error: parse error before "AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER" /System/Library/Frameworks/QTKit.framework/Headers/QTDataReference.h:15: error: parse error before "AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER" /System/Library/Frameworks/QTKit.framework/Headers/QTDataReference.h:16: error: parse error before "AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER" /System/Library/Frameworks/QTKit.framework/Headers/QTDataReference.h:17: error: parse error before "AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER" /System/Library/Frameworks/QTKit.framework/Headers/QTDataReference.h:18: error: parse error before "AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER" In file included from /System/Library/Frameworks/QTKit.framework/Headers/QTMovie.h:12, from /System/Library/Frameworks/QTKit.framework/Headers/QTKit.h:11, from Modules/QTKit/_QTKit.m:8: """ I've found references online to similar problems when QuickTime 7 is installed on OS X 10.3.9 (which is the case here), but no solutions. I'd gladly downgrade to an earlier version of QuickTime if I knew how (I'm not using QuickTime), but haven't discovered any way to do it. Mike From jani at eternum-consulting.com Mon Jul 10 22:15:24 2006 From: jani at eternum-consulting.com (Jani H Lahtinen) Date: Mon, 10 Jul 2006 23:15:24 +0300 Subject: [Pythonmac-SIG] No module named appscript In-Reply-To: References: Message-ID: <44B2B55C.3020701@eternum-consulting.com> has wrote: > Jani Lahtinen wrote: > > >> I just installed the AppScript to my PPC mac from the dmg-file, but >> when I try to import appscript I get: >> >> >>>>> from appscript import * >>>>> >> Traceback (most recent call last): >> File "", line 1, in ? >> ImportError: No module named appscript >> >> I tried both the 2.3 and 2.4 but the module is not loadable in >> pythonw. Is there a problem with the installer? >> > > Shouldn't be; never had any problems before. Are you sure you're > using the right python interpreter (i.e. not one for Fink/DarwinPorts > Python)? Did you check the site-packages folders for your Python > installations to see the files have been installed okay? > > Apple-installed 2.3: > /Library/Python/2.3 (Panther) > /Library/Python/2.3/site-packages (Tiger) > > User-installed MacPython 2.4: > /Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site- > packages > > HTH > > has > Ok, I had the Fink version of python 2.4. I have now the Apple installed 2.3 in which there is no such error anymore. Jani From piet at cs.uu.nl Tue Jul 11 19:33:56 2006 From: piet at cs.uu.nl (Piet van Oostrum) Date: Tue, 11 Jul 2006 19:33:56 +0200 Subject: [Pythonmac-SIG] Building python 2.4.3 on OSX 10.3.9 In-Reply-To: <44B2739A.1040001@hotmail.com> References: <44AEA5EE.5040509@hotmail.com> <44B05C62.7080502@hotmail.com> <44B2739A.1040001@hotmail.com> Message-ID: >>>>> Michael Glassford (MG) wrote: >MG> I've found references online to similar problems when QuickTime 7 is >MG> installed on OS X 10.3.9 (which is the case here), but no solutions. I'd >MG> gladly downgrade to an earlier version of QuickTime if I knew how (I'm >MG> not using QuickTime), but haven't discovered any way to do it. Did you (re)install the QuickTime SDK *after* installing QuickTime 7? That might help. -- Piet van Oostrum URL: http://www.cs.uu.nl/~piet [PGP 8DAE142BE17999C4] Private email: piet at vanoostrum.org From bob at redivi.com Tue Jul 11 19:41:54 2006 From: bob at redivi.com (Bob Ippolito) Date: Tue, 11 Jul 2006 10:41:54 -0700 Subject: [Pythonmac-SIG] Building python 2.4.3 on OSX 10.3.9 In-Reply-To: References: <44AEA5EE.5040509@hotmail.com> <44B05C62.7080502@hotmail.com> <44B2739A.1040001@hotmail.com> Message-ID: On Jul 11, 2006, at 10:33 AM, Piet van Oostrum wrote: >>>>>> Michael Glassford (MG) wrote: > >> MG> I've found references online to similar problems when >> QuickTime 7 is >> MG> installed on OS X 10.3.9 (which is the case here), but no >> solutions. I'd >> MG> gladly downgrade to an earlier version of QuickTime if I knew >> how (I'm >> MG> not using QuickTime), but haven't discovered any way to do it. > > Did you (re)install the QuickTime SDK *after* installing QuickTime > 7? That > might help. No, that's not going to help. QtKit didn't even exist for 10.3, PyObjC shouldn't be trying to build it on that platform. Comment it out of the setup.py or something. -bob From ronaldoussoren at mac.com Tue Jul 11 21:31:26 2006 From: ronaldoussoren at mac.com (Ronald Oussoren) Date: Tue, 11 Jul 2006 21:31:26 +0200 Subject: [Pythonmac-SIG] Building python 2.4.3 on OSX 10.3.9 In-Reply-To: References: <44AEA5EE.5040509@hotmail.com> <44B05C62.7080502@hotmail.com> <44B2739A.1040001@hotmail.com> Message-ID: <995A18BC-1AD5-4C15-8DE0-E38BD48CA777@mac.com> On Jul 11, 2006, at 7:41 PM, Bob Ippolito wrote: > > On Jul 11, 2006, at 10:33 AM, Piet van Oostrum wrote: > >>>>>>> Michael Glassford (MG) wrote: >> >>> MG> I've found references online to similar problems when >>> QuickTime 7 is >>> MG> installed on OS X 10.3.9 (which is the case here), but no >>> solutions. I'd >>> MG> gladly downgrade to an earlier version of QuickTime if I knew >>> how (I'm >>> MG> not using QuickTime), but haven't discovered any way to do it. >> >> Did you (re)install the QuickTime SDK *after* installing QuickTime >> 7? That >> might help. > > No, that's not going to help. QtKit didn't even exist for 10.3, > PyObjC shouldn't be trying to build it on that platform. That's what I thought as well. Gues what I found in /System/Library/ Frameworks? sw_vers claims this is a 10.3.9 system (completely up-to- date according to sofwareupdate), and yet it has QTKit.framework. BTW. PyObjC builds completely fine on this system, including the QTKit bindings. Ronald > > Comment it out of the setup.py or something. > > -bob > > _______________________________________________ > Pythonmac-SIG maillist - Pythonmac-SIG at python.org > http://mail.python.org/mailman/listinfo/pythonmac-sig From bob at redivi.com Tue Jul 11 22:39:34 2006 From: bob at redivi.com (Bob Ippolito) Date: Tue, 11 Jul 2006 13:39:34 -0700 Subject: [Pythonmac-SIG] py2app and universal TkAqua In-Reply-To: <44AD9779.4000206@kevin-walzer.com> References: <44AD9779.4000206@kevin-walzer.com> Message-ID: <09D800AC-B6B6-4852-8E58-7E555C2B4D64@redivi.com> On Jul 6, 2006, at 4:06 PM, Kevin Walzer wrote: > I have been unable to build the "hello-tk" demo that ships with py2app > if I am building against a "universal" build of Tcl/Tk. > > Here is my setup: > > from distutils.core import setup > import py2app > > setup( > app=['hello.py'], > options=dict( > py2app=dict( > archs="ppc,i386", > > frameworks=["/Library/Frameworks/Tcl.framework","/Library/ > Frameworks/Tk.framework"] > ) > ) > ) I gave up on that broken universal support in 0.2.x and cleaned up what I had in the trunk (0.3). The way it hooks into distutils now (via setuptools) is totally different so it needs a change to your setup files. 1. remove your existing installation of py2app:: rm -rf /Library/Frameworks/Python.framework/Versions/2.4/lib/ python2.4/py2app rm /Library/Frameworks/Python.framework/Versions/2.4/lib/ python2.4/py2app.pth 2. install setuptools 3. sudo easy_install py2app 4. Change the setup.py:: # used to be "from distutils.core import setup" from setuptools import setup setup( app=['hello.py'], # this is actually useless... options=dict(py2app=dict(frameworks=['Tcl', 'Tk'])), # this is new setup_requires=['py2app'], ) Explicitly specifying the Tcl and Tk frameworks is pointless because the Tkinter extension either links to them or it doesn't. If it does link to them, py2app will find them and include them. If it doesn't link to them (or it links to the /System version, for example) then it still won't use them even if they are present in the app bundle. FYI, the repositories for py2app, macholib, bdist_mpkg, altgraph have all moved to svn.pythonmac.org, e.g.: http://svn.pythonmac.org/py2app/ py2app/trunk/ I didn't bother trying to preserve the history, so don't bother trying to svn switch. -bob From robertanton at aapglobal.com Wed Jul 12 00:14:03 2006 From: robertanton at aapglobal.com (Robert Anton Patterson) Date: Tue, 11 Jul 2006 15:14:03 -0700 Subject: [Pythonmac-SIG] Install Message-ID: Dear Hi I'm trying to install MySQLdb-1.2.1 on Mac OS X and would appreciate anyone's help on the matter. I am able to access MySQL directly through the terminal, PHP, and PHPMyAdmin But when I go to install MYSQL-python via Python setup.py build: I get the following error: [Kolkata:~/desktop/mysql-python] anton% python setup.py build running build running build_py copying MySQLdb/release.py -> build/lib.darwin-8.6.0-Power_Macintosh-2.3/MySQLdb running build_ext building '_mysql' extension gcc -Wl,-F. -Wl,-F. -bundle -undefined dynamic_lookup build/temp.darwin-8.6.0-Power_Macintosh-2.3/_mysql.o -L/usr/local/mysql/lib -lmysqlclient_r -lz -lm -o build/lib.darwin-8.6.0-Power_Macintosh-2.3/_mysql.so ld: warning table of contents of library: /usr/local/mysql/lib/libmysqlclient_r.a not sorted slower link editing will result (use the ranlib(1) -s option) ld: /usr/local/mysql/lib/libmysqlclient_r.a(libmysql.o) stray relocation PPC_RELOC_PAIR entry (355) in section (__TEXT,__text) .... .... ld: /usr/local/mysql/lib/libmysqlclient_r.a(yassl_int.o) stray relocation PPC_RELOC_PAIR entry (671) in section (__TEXT,__text) error: command 'gcc' failed with exit status 1 Full error log downloadable here > http://www.aedeas.net/dropbox/mysqldb-errorlog.txt I thought I didn't have GCC. But I do; [Kolkata:~/desktop/mysql-python] anton% gcc -v Reading specs from /usr/libexec/gcc/darwin/ppc/3.3/specs Thread model: posix gcc version 3.3 20030304 (Apple Computer, Inc. build 1640) Any clues? Thanks, Robert The following might be of use but has not helped me - [BioPython] MySQLdb for Mac OS X http://lists.open-bio.org/pipermail/biopython/2004-January/001785.html From bob at redivi.com Wed Jul 12 02:56:45 2006 From: bob at redivi.com (Bob Ippolito) Date: Tue, 11 Jul 2006 17:56:45 -0700 Subject: [Pythonmac-SIG] Install In-Reply-To: References: Message-ID: <06D4B674-8C01-41FC-85C0-7F0B16FFDC37@redivi.com> On Jul 11, 2006, at 3:14 PM, Robert Anton Patterson wrote: > Hi I'm trying to install MySQLdb-1.2.1 on Mac OS X and would > appreciate > anyone's help on the matter. What version of Mac OS X is this, and how did you install MySQL? Is your Xcode installation up to date? I've never seen linker errors like that before. -bob From bob at redivi.com Wed Jul 12 03:12:22 2006 From: bob at redivi.com (Bob Ippolito) Date: Tue, 11 Jul 2006 18:12:22 -0700 Subject: [Pythonmac-SIG] Install In-Reply-To: References: Message-ID: On Jul 11, 2006, at 6:04 PM, Robert Anton Patterson wrote: > Mac OS X - 10.4.6 > > MYSQL version: 5.0.20a-standard + Apache 2 installed through > WebServer X Kit > ( www.rbsoftware.net/?page=wsxk) > > X-Code is upto date - I just re-installed the newest version off > the Apple > Developers site. > > GCC info: > > [Kolkata:~/desktop/mysql-python] anton% gcc -v > Reading specs from /usr/libexec/gcc/darwin/ppc/3.3/specs > Thread model: posix > > gcc version 3.3 20030304 (Apple Computer, Inc. build 1640) That doesn't sound right, GCC 4 is the default compiler for Mac OS X 10.4. Have you been messing with gcc_select? I'd try setting it back to the default compiler first ("sudo gcc_select 4"). > Any thoughts? Could be that the WebServer X kit installs bogus libraries. I've used MySQLdb on OS X before and it worked just fine, but I don't recall where I installed MySQL from. Probably the official release from mysql.com. -bob From glassfordm at gmail.com Wed Jul 12 16:51:11 2006 From: glassfordm at gmail.com (Michael Glassford) Date: Wed, 12 Jul 2006 10:51:11 -0400 Subject: [Pythonmac-SIG] Building python 2.4.3 on OSX 10.3.9 In-Reply-To: <995A18BC-1AD5-4C15-8DE0-E38BD48CA777@mac.com> References: <44AEA5EE.5040509@hotmail.com> <44B05C62.7080502@hotmail.com> <44B2739A.1040001@hotmail.com> <995A18BC-1AD5-4C15-8DE0-E38BD48CA777@mac.com> Message-ID: <44B50C5F.90206@hotmail.com> Here's what I think happened: Before I realized XCode wasn't installed, I installed QuickTime7SDK, and CoreAudioSDK (both to solve specific errors). Then I installed XCode 1.5, which appeared to replace the QuickTime.framework version 7 with version 6, but didn't touch QTKit.framework (because it didn't know about it, presumably). The mixture of Quicktime 6 and 7 headers apparently was causing the errors; reinstalling QuickTime7SDK appears to have fixed that problem, as I was able to build PyObjC with warnings but no errors. As an FYI: The original reason for trying to build my own Python 2.4 on Mac OSX 10.3.9 was that the one installed by the universal binary Python 2.4 installer has the problem that when I "import bz2" I get the error """ ImportError: Failure linking new module: /usr/lib/libbz2.1.0.dylib: dyld: /Library/Frameworks/Python.framework/Versions/2.4/Resources/Python.app/Contents/MacOS/Python can't open library: /usr/lib/libbz2.1.0.dylib (No such file or directory, errno = 2) """ It appears that it did in fact fix this problem. Now I have the two more problems: 1) The PyObjC unit test give me the following two failures (which I haven't had time to investigate much, yet): ====================================================================== FAIL: testSignatureCount (objc.test.test_splitsig.SplitSignatureTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "build/lib.darwin-7.9.0-Power_Macintosh-2.4/objc/test/test_splitsig.py", line 95, in testSignatureCount '%s [%d:%d] %r %r'%(sel.selector, argcount, coloncount, elems, cls)) AssertionError: didChangeValueForKey: [2:1] ('v', '@', ':', '@', '@') ====================================================================== FAIL: testOverrideDealloc (objc.test.test_subclass.TestOverridingSpecials) ---------------------------------------------------------------------- Traceback (most recent call last): File "build/lib.darwin-7.9.0-Power_Macintosh-2.4/objc/test/test_subclass.py", line 296, in testOverrideDealloc self.assertEquals(len(aList), 2) AssertionError: 0 != 2 ---------------------------------------------------------------------- 2) When I run python (either the one I built, from /usr/local/bin/python2.4, or the one installed by the universal binary installer at /Library/Frameworks/Python.framework/Versions/2.4/python2.4), and "import appscript", for example, I get this error: """ Traceback (most recent call last): File "", line 1, in ? File "/usr/local/lib/python2.4/site-packages/appscript/__init__.py", line 16, in ? from specifier import app, CommandError File "/usr/local/lib/python2.4/site-packages/appscript/specifier.py", line 9, in ? import aem File "/usr/local/lib/python2.4/site-packages/aem/__init__.py", line 25, in ? from send import * File "/usr/local/lib/python2.4/site-packages/aem/send/__init__.py", line 90, in ? raise RuntimeError, "Can't send Apple events: no access to Window Manager. (aem-based scripts must be run within a GUI process; e.g. use 'pythonw', not 'python', if running script in shell)" RuntimeError: Can't send Apple events: no access to Window Manager. (aem-based scripts must be run within a GUI process; e.g. use 'pythonw', not 'python', if running script in shell) """ If I run /Library/Frameworks/Python.framework/Versions/2.4/pythonw2.4, I get the same error. What could make this not work properly? Mike Ronald Oussoren wrote: > On Jul 11, 2006, at 7:41 PM, Bob Ippolito wrote: > >> On Jul 11, 2006, at 10:33 AM, Piet van Oostrum wrote: >> >>>>>>>> Michael Glassford (MG) wrote: >>>> MG> I've found references online to similar problems when >>>> QuickTime 7 is >>>> MG> installed on OS X 10.3.9 (which is the case here), but no >>>> solutions. I'd >>>> MG> gladly downgrade to an earlier version of QuickTime if I knew >>>> how (I'm >>>> MG> not using QuickTime), but haven't discovered any way to do it. >>> Did you (re)install the QuickTime SDK *after* installing QuickTime >>> 7? That >>> might help. >> No, that's not going to help. QtKit didn't even exist for 10.3, >> PyObjC shouldn't be trying to build it on that platform. > > That's what I thought as well. Gues what I found in /System/Library/ > Frameworks? sw_vers claims this is a 10.3.9 system (completely up-to- > date according to sofwareupdate), and yet it has QTKit.framework. > > BTW. PyObjC builds completely fine on this system, including the > QTKit bindings. > > Ronald > >> Comment it out of the setup.py or something. >> >> -bob >> >> _______________________________________________ >> Pythonmac-SIG maillist - Pythonmac-SIG at python.org >> http://mail.python.org/mailman/listinfo/pythonmac-sig > > _______________________________________________ > Pythonmac-SIG maillist - Pythonmac-SIG at python.org > http://mail.python.org/mailman/listinfo/pythonmac-sig > From glassfordm at hotmail.com Wed Jul 12 16:51:11 2006 From: glassfordm at hotmail.com (Michael Glassford) Date: Wed, 12 Jul 2006 10:51:11 -0400 Subject: [Pythonmac-SIG] Building python 2.4.3 on OSX 10.3.9 In-Reply-To: <995A18BC-1AD5-4C15-8DE0-E38BD48CA777@mac.com> References: <44AEA5EE.5040509@hotmail.com> <44B05C62.7080502@hotmail.com> <44B2739A.1040001@hotmail.com> <995A18BC-1AD5-4C15-8DE0-E38BD48CA777@mac.com> Message-ID: <44B50C5F.90206@hotmail.com> Here's what I think happened: Before I realized XCode wasn't installed, I installed QuickTime7SDK, and CoreAudioSDK (both to solve specific errors). Then I installed XCode 1.5, which appeared to replace the QuickTime.framework version 7 with version 6, but didn't touch QTKit.framework (because it didn't know about it, presumably). The mixture of Quicktime 6 and 7 headers apparently was causing the errors; reinstalling QuickTime7SDK appears to have fixed that problem, as I was able to build PyObjC with warnings but no errors. As an FYI: The original reason for trying to build my own Python 2.4 on Mac OSX 10.3.9 was that the one installed by the universal binary Python 2.4 installer has the problem that when I "import bz2" I get the error """ ImportError: Failure linking new module: /usr/lib/libbz2.1.0.dylib: dyld: /Library/Frameworks/Python.framework/Versions/2.4/Resources/Python.app/Contents/MacOS/Python can't open library: /usr/lib/libbz2.1.0.dylib (No such file or directory, errno = 2) """ It appears that it did in fact fix this problem. Now I have the two more problems: 1) The PyObjC unit test give me the following two failures (which I haven't had time to investigate much, yet): ====================================================================== FAIL: testSignatureCount (objc.test.test_splitsig.SplitSignatureTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "build/lib.darwin-7.9.0-Power_Macintosh-2.4/objc/test/test_splitsig.py", line 95, in testSignatureCount '%s [%d:%d] %r %r'%(sel.selector, argcount, coloncount, elems, cls)) AssertionError: didChangeValueForKey: [2:1] ('v', '@', ':', '@', '@') ====================================================================== FAIL: testOverrideDealloc (objc.test.test_subclass.TestOverridingSpecials) ---------------------------------------------------------------------- Traceback (most recent call last): File "build/lib.darwin-7.9.0-Power_Macintosh-2.4/objc/test/test_subclass.py", line 296, in testOverrideDealloc self.assertEquals(len(aList), 2) AssertionError: 0 != 2 ---------------------------------------------------------------------- 2) When I run python (either the one I built, from /usr/local/bin/python2.4, or the one installed by the universal binary installer at /Library/Frameworks/Python.framework/Versions/2.4/python2.4), and "import appscript", for example, I get this error: """ Traceback (most recent call last): File "", line 1, in ? File "/usr/local/lib/python2.4/site-packages/appscript/__init__.py", line 16, in ? from specifier import app, CommandError File "/usr/local/lib/python2.4/site-packages/appscript/specifier.py", line 9, in ? import aem File "/usr/local/lib/python2.4/site-packages/aem/__init__.py", line 25, in ? from send import * File "/usr/local/lib/python2.4/site-packages/aem/send/__init__.py", line 90, in ? raise RuntimeError, "Can't send Apple events: no access to Window Manager. (aem-based scripts must be run within a GUI process; e.g. use 'pythonw', not 'python', if running script in shell)" RuntimeError: Can't send Apple events: no access to Window Manager. (aem-based scripts must be run within a GUI process; e.g. use 'pythonw', not 'python', if running script in shell) """ If I run /Library/Frameworks/Python.framework/Versions/2.4/pythonw2.4, I get the same error. What could make this not work properly? Mike Ronald Oussoren wrote: > On Jul 11, 2006, at 7:41 PM, Bob Ippolito wrote: > >> On Jul 11, 2006, at 10:33 AM, Piet van Oostrum wrote: >> >>>>>>>> Michael Glassford (MG) wrote: >>>> MG> I've found references online to similar problems when >>>> QuickTime 7 is >>>> MG> installed on OS X 10.3.9 (which is the case here), but no >>>> solutions. I'd >>>> MG> gladly downgrade to an earlier version of QuickTime if I knew >>>> how (I'm >>>> MG> not using QuickTime), but haven't discovered any way to do it. >>> Did you (re)install the QuickTime SDK *after* installing QuickTime >>> 7? That >>> might help. >> No, that's not going to help. QtKit didn't even exist for 10.3, >> PyObjC shouldn't be trying to build it on that platform. > > That's what I thought as well. Gues what I found in /System/Library/ > Frameworks? sw_vers claims this is a 10.3.9 system (completely up-to- > date according to sofwareupdate), and yet it has QTKit.framework. > > BTW. PyObjC builds completely fine on this system, including the > QTKit bindings. > > Ronald > >> Comment it out of the setup.py or something. >> >> -bob >> >> _______________________________________________ >> Pythonmac-SIG maillist - Pythonmac-SIG at python.org >> http://mail.python.org/mailman/listinfo/pythonmac-sig > > _______________________________________________ > Pythonmac-SIG maillist - Pythonmac-SIG at python.org > http://mail.python.org/mailman/listinfo/pythonmac-sig > From bob at redivi.com Wed Jul 12 18:14:01 2006 From: bob at redivi.com (Bob Ippolito) Date: Wed, 12 Jul 2006 09:14:01 -0700 Subject: [Pythonmac-SIG] Building python 2.4.3 on OSX 10.3.9 In-Reply-To: <44B50C5F.90206@hotmail.com> References: <44AEA5EE.5040509@hotmail.com> <44B05C62.7080502@hotmail.com> <44B2739A.1040001@hotmail.com> <995A18BC-1AD5-4C15-8DE0-E38BD48CA777@mac.com> <44B50C5F.90206@hotmail.com> Message-ID: <498E2068-DB46-4087-9371-D88DB768B65E@redivi.com> On Jul 12, 2006, at 7:51 AM, Michael Glassford wrote: > 2) When I run python (either the one I built, from > /usr/local/bin/python2.4, or the one installed by the universal binary > installer at > /Library/Frameworks/Python.framework/Versions/2.4/python2.4), and > "import appscript", for example, I get this error: > > > """ > Traceback (most recent call last): > File "", line 1, in ? > File "/usr/local/lib/python2.4/site-packages/appscript/ > __init__.py", > line 16, in ? > from specifier import app, CommandError > File "/usr/local/lib/python2.4/site-packages/appscript/ > specifier.py", > line 9, in ? > import aem > File "/usr/local/lib/python2.4/site-packages/aem/__init__.py", line > 25, in ? > from send import * > File "/usr/local/lib/python2.4/site-packages/aem/send/__init__.py", > line 90, in ? > raise RuntimeError, "Can't send Apple events: no access to Window > Manager. (aem-based scripts must be run within a GUI process; e.g. use > 'pythonw', not 'python', if running script in shell)" > RuntimeError: Can't send Apple events: no access to Window Manager. > (aem-based scripts must be run within a GUI process; e.g. use > 'pythonw', > not 'python', if running script in shell) > """ > > If I run /Library/Frameworks/Python.framework/Versions/2.4/ > pythonw2.4, I > get the same error. > > What could make this not work properly? First of all, the "pythonw2.4" path you list doesn't exist, and second it's not what you're running anyway! Look at the site-packages dir in the exception, that's a normal unix install, not a framework install. You need a framework install (./configure --enable-framework && sudo make frameworkinstall). -bob From glassfordm at gmail.com Wed Jul 12 20:28:47 2006 From: glassfordm at gmail.com (Michael Glassford) Date: Wed, 12 Jul 2006 14:28:47 -0400 Subject: [Pythonmac-SIG] Building python 2.4.3 on OSX 10.3.9 In-Reply-To: <498E2068-DB46-4087-9371-D88DB768B65E@redivi.com> References: <44AEA5EE.5040509@hotmail.com> <44B05C62.7080502@hotmail.com> <44B2739A.1040001@hotmail.com> <995A18BC-1AD5-4C15-8DE0-E38BD48CA777@mac.com> <44B50C5F.90206@hotmail.com> <498E2068-DB46-4087-9371-D88DB768B65E@redivi.com> Message-ID: <44B53F5F.1010401@hotmail.com> Bob Ippolito wrote: > On Jul 12, 2006, at 7:51 AM, Michael Glassford wrote: > >> 2) When I run python (either the one I built, from >> /usr/local/bin/python2.4, or the one installed by the universal binary >> installer at >> /Library/Frameworks/Python.framework/Versions/2.4/python2.4), and >> "import appscript", for example, I get this error: >> >> >> """ >> Traceback (most recent call last): >> File "", line 1, in ? >> File "/usr/local/lib/python2.4/site-packages/appscript/ >> __init__.py", >> line 16, in ? >> from specifier import app, CommandError >> File "/usr/local/lib/python2.4/site-packages/appscript/ >> specifier.py", >> line 9, in ? >> import aem >> File "/usr/local/lib/python2.4/site-packages/aem/__init__.py", line >> 25, in ? >> from send import * >> File "/usr/local/lib/python2.4/site-packages/aem/send/__init__.py", >> line 90, in ? >> raise RuntimeError, "Can't send Apple events: no access to Window >> Manager. (aem-based scripts must be run within a GUI process; e.g. use >> 'pythonw', not 'python', if running script in shell)" >> RuntimeError: Can't send Apple events: no access to Window Manager. >> (aem-based scripts must be run within a GUI process; e.g. use >> 'pythonw', >> not 'python', if running script in shell) >> """ >> >> If I run /Library/Frameworks/Python.framework/Versions/2.4/ >> pythonw2.4, I >> get the same error. >> >> What could make this not work properly? > > First of all, the "pythonw2.4" path you list doesn't exist, Sorry, instead of copying the path from the machine where it happened to the one that I'm emailing from, I typed it out and inadvertently left out the "/bin" that should have been at the end. It should have been "Library/Frameworks/Python.framework/Versions/2.4/bin/pythonw2.4". > and > second it's not what you're running anyway! > Look at the site-packages > dir in the exception, that's a normal unix install, not a framework > install. Yes, as I said I ran three different executables and got the same error from each. This is only one of the three errors. Presumably the others would have had different site-packages paths. Unfortunately, the output is long gone and I can't reproduce this problem again except with /usr/local/bin/python2.4; however, I ran each more than once just to make sure, using the full path each time, so I don't see how I could have been mistaken. In any case... > You need a framework install (./configure --enable-framework > && sudo make frameworkinstall). Is there somewhere that I should have learned about this option? When I did this, all of the unit tests passed. When I run /usr/local/bin/python2.4 I still get this error: """ Traceback (most recent call last): File "", line 1, in ? File "/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/appscript/__init__.py", line 16, in ? from specifier import app, CommandError File "/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/appscript/specifier.py", line 9, in ? import aem File "/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/aem/__init__.py", line 25, in ? from send import * File "/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/aem/send/__init__.py", line 90, in ? raise RuntimeError, "Can't send Apple events: no access to Window Manager. (aem-based scripts must be run within a GUI process; e.g. use 'pythonw', not 'python', if running script in shell)" RuntimeError: Can't send Apple events: no access to Window Manager. (aem-based scripts must be run within a GUI process; e.g. use 'pythonw', not 'python', if running script in shell) """ However, /usr/local/bin/pythonw2.4 appears to work OK now. This behavior is different from the Python installed on Tiger by the 2.4 universal binary installer (where there is no pythonw and python has access to the window manager), but at least I have something that seems to work now. Thanks everybody for all of the help in this frustrating situation. If you have any suggested reading (online or otherwise) that would have helped me understand the workings of OSX, Python, etc. enough to figure out more of this myself, I'd be glad to hear of it. Mike From glassfordm at hotmail.com Wed Jul 12 20:28:47 2006 From: glassfordm at hotmail.com (Michael Glassford) Date: Wed, 12 Jul 2006 14:28:47 -0400 Subject: [Pythonmac-SIG] Building python 2.4.3 on OSX 10.3.9 In-Reply-To: <498E2068-DB46-4087-9371-D88DB768B65E@redivi.com> References: <44AEA5EE.5040509@hotmail.com> <44B05C62.7080502@hotmail.com> <44B2739A.1040001@hotmail.com> <995A18BC-1AD5-4C15-8DE0-E38BD48CA777@mac.com> <44B50C5F.90206@hotmail.com> <498E2068-DB46-4087-9371-D88DB768B65E@redivi.com> Message-ID: <44B53F5F.1010401@hotmail.com> Bob Ippolito wrote: > On Jul 12, 2006, at 7:51 AM, Michael Glassford wrote: > >> 2) When I run python (either the one I built, from >> /usr/local/bin/python2.4, or the one installed by the universal binary >> installer at >> /Library/Frameworks/Python.framework/Versions/2.4/python2.4), and >> "import appscript", for example, I get this error: >> >> >> """ >> Traceback (most recent call last): >> File "", line 1, in ? >> File "/usr/local/lib/python2.4/site-packages/appscript/ >> __init__.py", >> line 16, in ? >> from specifier import app, CommandError >> File "/usr/local/lib/python2.4/site-packages/appscript/ >> specifier.py", >> line 9, in ? >> import aem >> File "/usr/local/lib/python2.4/site-packages/aem/__init__.py", line >> 25, in ? >> from send import * >> File "/usr/local/lib/python2.4/site-packages/aem/send/__init__.py", >> line 90, in ? >> raise RuntimeError, "Can't send Apple events: no access to Window >> Manager. (aem-based scripts must be run within a GUI process; e.g. use >> 'pythonw', not 'python', if running script in shell)" >> RuntimeError: Can't send Apple events: no access to Window Manager. >> (aem-based scripts must be run within a GUI process; e.g. use >> 'pythonw', >> not 'python', if running script in shell) >> """ >> >> If I run /Library/Frameworks/Python.framework/Versions/2.4/ >> pythonw2.4, I >> get the same error. >> >> What could make this not work properly? > > First of all, the "pythonw2.4" path you list doesn't exist, Sorry, instead of copying the path from the machine where it happened to the one that I'm emailing from, I typed it out and inadvertently left out the "/bin" that should have been at the end. It should have been "Library/Frameworks/Python.framework/Versions/2.4/bin/pythonw2.4". > and > second it's not what you're running anyway! > Look at the site-packages > dir in the exception, that's a normal unix install, not a framework > install. Yes, as I said I ran three different executables and got the same error from each. This is only one of the three errors. Presumably the others would have had different site-packages paths. Unfortunately, the output is long gone and I can't reproduce this problem again except with /usr/local/bin/python2.4; however, I ran each more than once just to make sure, using the full path each time, so I don't see how I could have been mistaken. In any case... > You need a framework install (./configure --enable-framework > && sudo make frameworkinstall). Is there somewhere that I should have learned about this option? When I did this, all of the unit tests passed. When I run /usr/local/bin/python2.4 I still get this error: """ Traceback (most recent call last): File "", line 1, in ? File "/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/appscript/__init__.py", line 16, in ? from specifier import app, CommandError File "/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/appscript/specifier.py", line 9, in ? import aem File "/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/aem/__init__.py", line 25, in ? from send import * File "/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/aem/send/__init__.py", line 90, in ? raise RuntimeError, "Can't send Apple events: no access to Window Manager. (aem-based scripts must be run within a GUI process; e.g. use 'pythonw', not 'python', if running script in shell)" RuntimeError: Can't send Apple events: no access to Window Manager. (aem-based scripts must be run within a GUI process; e.g. use 'pythonw', not 'python', if running script in shell) """ However, /usr/local/bin/pythonw2.4 appears to work OK now. This behavior is different from the Python installed on Tiger by the 2.4 universal binary installer (where there is no pythonw and python has access to the window manager), but at least I have something that seems to work now. Thanks everybody for all of the help in this frustrating situation. If you have any suggested reading (online or otherwise) that would have helped me understand the workings of OSX, Python, etc. enough to figure out more of this myself, I'd be glad to hear of it. Mike From bob at redivi.com Wed Jul 12 20:43:57 2006 From: bob at redivi.com (Bob Ippolito) Date: Wed, 12 Jul 2006 11:43:57 -0700 Subject: [Pythonmac-SIG] Building python 2.4.3 on OSX 10.3.9 In-Reply-To: <44B53F5F.1010401@hotmail.com> References: <44AEA5EE.5040509@hotmail.com> <44B05C62.7080502@hotmail.com> <44B2739A.1040001@hotmail.com> <995A18BC-1AD5-4C15-8DE0-E38BD48CA777@mac.com> <44B50C5F.90206@hotmail.com> <498E2068-DB46-4087-9371-D88DB768B65E@redivi.com> <44B53F5F.1010401@hotmail.com> Message-ID: On Jul 12, 2006, at 11:28 AM, Michael Glassford wrote: > Bob Ippolito wrote: >> On Jul 12, 2006, at 7:51 AM, Michael Glassford wrote: >>> >> and second it's not what you're running anyway! Look at the site- >> packages dir in the exception, that's a normal unix install, not >> a framework install. > > Yes, as I said I ran three different executables and got the same > error from each. This is only one of the three errors. Presumably > the others would have had different site-packages paths. > Unfortunately, the output is long gone and I can't reproduce this > problem again except with /usr/local/bin/python2.4; however, I ran > each more than once just to make sure, using the full path each > time, so I don't see how I could have been mistaken. In any case... > > > You need a framework install (./configure --enable-framework >> && sudo make frameworkinstall). > > Is there somewhere that I should have learned about this option? Mac/OSX/README in the sources, ./configure --help, or mailing list archives. Where would you have expected to learn about the option? Did you read documentation somewhere before building? > When I did this, all of the unit tests passed. When I run /usr/ > local/bin/python2.4 I still get this error: > > """ ... > RuntimeError: Can't send Apple events: no access to Window Manager. > (aem-based scripts must be run within a GUI process; e.g. use > 'pythonw', not 'python', if running script in shell) > """ > > However, /usr/local/bin/pythonw2.4 appears to work OK now. This is expected for that version of Python. > This behavior is different from the Python installed on Tiger by > the 2.4 universal binary installer (where there is no pythonw and > python has access to the window manager), but at least I have > something that seems to work now. Yes, it is different than Universal Python because you compiled different sources. Universal Python 2.4.3 is a fork of Python that includes several Mac-specific features that aren't in the mainline sources until Python 2.5. The Universal Python repository is at: http://svn.pythonmac.org/python24/python24-fat/ Universal Python 2.4.3 does have "pythonw", for compatibility, but it is the same as what you get when you run "python". Technically, both the "python" and "pythonw" executables for Universal Python are a compiled equivalent to the previously shell script "pythonw", which re-execs the Python interpreter with a different argv[0] (inside an app bundle). -bob From bob at redivi.com Thu Jul 13 05:26:08 2006 From: bob at redivi.com (Bob Ippolito) Date: Wed, 12 Jul 2006 20:26:08 -0700 Subject: [Pythonmac-SIG] Install In-Reply-To: References: Message-ID: <5FE8A4C0-0DE4-4C71-B294-AAB9E8EC7BAE@redivi.com> On Jul 12, 2006, at 8:06 PM, Robert Anton Patterson wrote: > Dear Bob: > > Thanks for your help but still have problems. > > I've reinstalled SQL and actually downgraded it to > > Version 4 - sudo python setup.py install > > As this the same version on my server. > > Next I've re-installed the GCC library off my the OS X CD > > [Kolkata:~/desktop/mysql-python] anton% gcc -v > Reading specs from /usr/libexec/gcc/darwin/ppc/3.3/specs > Thread model: posix > gcc version 3.3 20030304 (Apple Computer, Inc. build 1640) That's still not the version of GCC you should have. gcc -v should be 4.0.1 by default, and gcc-3.3 -v should be build 1819. It sounds like you might be installing an OS X 10.3 compiler on OS X 10.4 or something. Don't do that. Get the latest Xcode from connect.apple.com and install that. If it says 3.3 still, then use sudo gcc_select 4. -bob From jkebinger at gmail.com Thu Jul 13 14:28:05 2006 From: jkebinger at gmail.com (jamesk) Date: Thu, 13 Jul 2006 05:28:05 -0700 (PDT) Subject: [Pythonmac-SIG] Errors in Numpy running matplotlib Message-ID: <5306988.post@talk.nabble.com> I'm get a bus error running matplotlib - the error occurs just from importing pylab . I'm running 10.4.7 on an Intel mac. All of the python libraries I'm using came from the macpython site. Following the suggestions from an earlier post, I ran gdb to get a backtrace as follows: gdb --args /usr/local/bin/python -c "import pylab" Here's the trace: Reading symbols for shared libraries . done Reading symbols for shared libraries . done Program received signal EXC_BAD_ACCESS, Could not access memory. Reason: KERN_PROTECTION_FAILURE at address: 0x014a9bc4 0x0104759a in PyArray_AxisConverter (obj=0xe458, axis=0x14a9bc4) at numpy/core/src/multiarraymodule.c:117 117 numpy/core/src/multiarraymodule.c: No such file or directory. in numpy/core/src/multiarraymodule.c If I switch to Numeric, the problem goes away, so It looks like its a bad build/install of numpy. -James -- View this message in context: http://www.nabble.com/Errors-in-Numpy-running-matplotlib-tf1936938.html#a5306988 Sent from the Python - pythonmac-sig forum at Nabble.com. From kw at kevin-walzer.com Thu Jul 13 22:44:30 2006 From: kw at kevin-walzer.com (Kevin Walzer) Date: Thu, 13 Jul 2006 16:44:30 -0400 Subject: [Pythonmac-SIG] py2app and universal TkAqua In-Reply-To: <09D800AC-B6B6-4852-8E58-7E555C2B4D64@redivi.com> References: <44AD9779.4000206@kevin-walzer.com> <09D800AC-B6B6-4852-8E58-7E555C2B4D64@redivi.com> Message-ID: <44B6B0AE.5010003@kevin-walzer.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Bob Ippolito wrote: > > On Jul 6, 2006, at 4:06 PM, Kevin Walzer wrote: > >> I have been unable to build the "hello-tk" demo that ships with py2app >> if I am building against a "universal" build of Tcl/Tk. >> >> Here is my setup: >> >> from distutils.core import setup >> import py2app >> >> setup( >> app=['hello.py'], >> options=dict( >> py2app=dict( >> archs="ppc,i386", >> >> frameworks=["/Library/Frameworks/Tcl.framework","/Library/Frameworks/Tk.framework"] >> >> ) >> ) >> ) > > I gave up on that broken universal support in 0.2.x and cleaned up what > I had in the trunk (0.3). The way it hooks into distutils now (via > setuptools) is totally different so it needs a change to your setup files. > > 1. remove your existing installation of py2app:: > > rm -rf > /Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/py2app > rm > /Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/py2app.pth > > 2. install setuptools > > > 3. sudo easy_install py2app > 4. Change the setup.py:: > > # used to be "from distutils.core import setup" > from setuptools import setup > setup( > app=['hello.py'], > # this is actually useless... > options=dict(py2app=dict(frameworks=['Tcl', 'Tk'])), > # this is new > setup_requires=['py2app'], > ) > > Explicitly specifying the Tcl and Tk frameworks is pointless because the > Tkinter extension either links to them or it doesn't. If it does link to > them, py2app will find them and include them. If it doesn't link to them > (or it links to the /System version, for example) then it still won't > use them even if they are present in the app bundle. > > FYI, the repositories for py2app, macholib, bdist_mpkg, altgraph have > all moved to svn.pythonmac.org, e.g.: > http://svn.pythonmac.org/py2app/py2app/trunk/ > > I didn't bother trying to preserve the history, so don't bother trying > to svn switch. > > -bob > This new approach seems to work well. I've tested it not just with the basic demo but with a different script that incorporates a Tk-specific extension with a Python wrapper (Tile). Thank you. My only reason for wanting to use a universal build of Tcl/Tk is to avoid things breaking if the application runs on a later version of OS X with a later version of Tcl/Tk installed in /System. Can the tkinter module accommodate a later 8.4.x build of Tcl/Tk without breaking? - -- Kevin Walzer Poetic Code http://www.kevin-walzer.com -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.1 (Darwin) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFEtrCtrTC5hIgjqTMRAjOAAJ4hDc9dgyNuPFdFokL7ImAdw0cU6wCghGba T4jqS+qsNxx5N9haOfERjZc= =Yf0E -----END PGP SIGNATURE----- From bob at redivi.com Thu Jul 13 23:01:22 2006 From: bob at redivi.com (Bob Ippolito) Date: Thu, 13 Jul 2006 14:01:22 -0700 Subject: [Pythonmac-SIG] py2app and universal TkAqua In-Reply-To: <44B6B0AE.5010003@kevin-walzer.com> References: <44AD9779.4000206@kevin-walzer.com> <09D800AC-B6B6-4852-8E58-7E555C2B4D64@redivi.com> <44B6B0AE.5010003@kevin-walzer.com> Message-ID: <1DA280FA-F7C6-4121-A30A-5B219B6E987D@redivi.com> On Jul 13, 2006, at 1:44 PM, Kevin Walzer wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > Bob Ippolito wrote: >> >> On Jul 6, 2006, at 4:06 PM, Kevin Walzer wrote: >> >>> I have been unable to build the "hello-tk" demo that ships with >>> py2app >>> if I am building against a "universal" build of Tcl/Tk. >>> >>> Here is my setup: >>> >>> from distutils.core import setup >>> import py2app >>> >>> setup( >>> app=['hello.py'], >>> options=dict( >>> py2app=dict( >>> archs="ppc,i386", >>> >>> frameworks=["/Library/Frameworks/Tcl.framework","/Library/ >>> Frameworks/Tk.framework"] >>> >>> ) >>> ) >>> ) >> >> I gave up on that broken universal support in 0.2.x and cleaned up >> what >> I had in the trunk (0.3). The way it hooks into distutils now (via >> setuptools) is totally different so it needs a change to your >> setup files. >> >> 1. remove your existing installation of py2app:: >> >> rm -rf >> /Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/ >> py2app >> rm >> /Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/ >> py2app.pth >> >> 2. install setuptools >> > setuptools-install/> >> >> 3. sudo easy_install py2app >> 4. Change the setup.py:: >> >> # used to be "from distutils.core import setup" >> from setuptools import setup >> setup( >> app=['hello.py'], >> # this is actually useless... >> options=dict(py2app=dict(frameworks=['Tcl', 'Tk'])), >> # this is new >> setup_requires=['py2app'], >> ) >> >> Explicitly specifying the Tcl and Tk frameworks is pointless >> because the >> Tkinter extension either links to them or it doesn't. If it does >> link to >> them, py2app will find them and include them. If it doesn't link >> to them >> (or it links to the /System version, for example) then it still won't >> use them even if they are present in the app bundle. >> >> FYI, the repositories for py2app, macholib, bdist_mpkg, altgraph have >> all moved to svn.pythonmac.org, e.g.: >> http://svn.pythonmac.org/py2app/py2app/trunk/ >> >> I didn't bother trying to preserve the history, so don't bother >> trying >> to svn switch. >> >> -bob >> > > This new approach seems to work well. I've tested it not just with the > basic demo but with a different script that incorporates a Tk-specific > extension with a Python wrapper (Tile). Thank you. > > My only reason for wanting to use a universal build of Tcl/Tk is to > avoid things breaking if the application runs on a later version of > OS X > with a later version of Tcl/Tk installed in /System. Can the tkinter > module accommodate a later 8.4.x build of Tcl/Tk without breaking? It probably can, but you'd have to jigger its install_name in order to make that happen. In your project you could probably do this: cp `python -c 'print __import__("_tkinter").__file__'` . install_name_tool \ -change /System/Library/Frameworks/Tcl.framework/Versions/8.4/Tcl \ /Library/Frameworks/Tcl.framework/Versions/8.4/Tcl \ -change /System/Library/Frameworks/Tk.framework/Versions/8.4/Tk \ /Library/Frameworks/Tk.framework/Versions/8.4/Tk \ _tkinter.so That will make a copy of _tkinter.so and rewrite its load commands such that it points at your version of Tcl/Tk instead of the system's. Since it will be a sibling of your main script, it will be on sys.path before the standard library and py2app should pick it up instead of the stdlib version of _tkinter. macholib will see the Tcl and Tk frameworks and should do the right thing. -bob From kw at kevin-walzer.com Fri Jul 14 00:14:22 2006 From: kw at kevin-walzer.com (Kevin Walzer) Date: Thu, 13 Jul 2006 18:14:22 -0400 Subject: [Pythonmac-SIG] py2app and universal TkAqua In-Reply-To: <1DA280FA-F7C6-4121-A30A-5B219B6E987D@redivi.com> References: <44AD9779.4000206@kevin-walzer.com> <09D800AC-B6B6-4852-8E58-7E555C2B4D64@redivi.com> <44B6B0AE.5010003@kevin-walzer.com> <1DA280FA-F7C6-4121-A30A-5B219B6E987D@redivi.com> Message-ID: <44B6C5BE.2010804@kevin-walzer.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Bob Ippolito wrote: > > On Jul 13, 2006, at 1:44 PM, Kevin Walzer wrote: > >> -----BEGIN PGP SIGNED MESSAGE----- >> Hash: SHA1 >> >> Bob Ippolito wrote: >>> >>> On Jul 6, 2006, at 4:06 PM, Kevin Walzer wrote: >>> >>>> I have been unable to build the "hello-tk" demo that ships with py2app >>>> if I am building against a "universal" build of Tcl/Tk. >>>> >>>> Here is my setup: >>>> >>>> from distutils.core import setup >>>> import py2app >>>> >>>> setup( >>>> app=['hello.py'], >>>> options=dict( >>>> py2app=dict( >>>> archs="ppc,i386", >>>> >>>> frameworks=["/Library/Frameworks/Tcl.framework","/Library/Frameworks/Tk.framework"] >>>> >>>> >>>> ) >>>> ) >>>> ) >>> >>> I gave up on that broken universal support in 0.2.x and cleaned up what >>> I had in the trunk (0.3). The way it hooks into distutils now (via >>> setuptools) is totally different so it needs a change to your setup >>> files. >>> >>> 1. remove your existing installation of py2app:: >>> >>> rm -rf >>> /Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/py2app >>> rm >>> /Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/py2app.pth >>> >>> >>> 2. install setuptools >>> >>> >>> >>> 3. sudo easy_install py2app >>> 4. Change the setup.py:: >>> >>> # used to be "from distutils.core import setup" >>> from setuptools import setup >>> setup( >>> app=['hello.py'], >>> # this is actually useless... >>> options=dict(py2app=dict(frameworks=['Tcl', 'Tk'])), >>> # this is new >>> setup_requires=['py2app'], >>> ) >>> >>> Explicitly specifying the Tcl and Tk frameworks is pointless because the >>> Tkinter extension either links to them or it doesn't. If it does link to >>> them, py2app will find them and include them. If it doesn't link to them >>> (or it links to the /System version, for example) then it still won't >>> use them even if they are present in the app bundle. >>> >>> FYI, the repositories for py2app, macholib, bdist_mpkg, altgraph have >>> all moved to svn.pythonmac.org, e.g.: >>> http://svn.pythonmac.org/py2app/py2app/trunk/ >>> >>> I didn't bother trying to preserve the history, so don't bother trying >>> to svn switch. >>> >>> -bob >>> >> >> This new approach seems to work well. I've tested it not just with the >> basic demo but with a different script that incorporates a Tk-specific >> extension with a Python wrapper (Tile). Thank you. >> >> My only reason for wanting to use a universal build of Tcl/Tk is to >> avoid things breaking if the application runs on a later version of OS X >> with a later version of Tcl/Tk installed in /System. Can the tkinter >> module accommodate a later 8.4.x build of Tcl/Tk without breaking? > > It probably can, but you'd have to jigger its install_name in order to > make that happen. > > In your project you could probably do this: > > cp `python -c 'print __import__("_tkinter").__file__'` . > install_name_tool \ > -change /System/Library/Frameworks/Tcl.framework/Versions/8.4/Tcl \ > /Library/Frameworks/Tcl.framework/Versions/8.4/Tcl \ > -change /System/Library/Frameworks/Tk.framework/Versions/8.4/Tk \ > /Library/Frameworks/Tk.framework/Versions/8.4/Tk \ > _tkinter.so > > That will make a copy of _tkinter.so and rewrite its load commands such > that it points at your version of Tcl/Tk instead of the system's. Since > it will be a sibling of your main script, it will be on sys.path before > the standard library and py2app should pick it up instead of the stdlib > version of _tkinter. macholib will see the Tcl and Tk frameworks and > should do the right thing. > > -bob That works. Thanks. - -- Kevin Walzer Poetic Code http://www.kevin-walzer.com -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.1 (Darwin) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFEtsW+rTC5hIgjqTMRAvg8AJ4jfD+UGJY3OnXLe4Iax0wMqvXeZACgkrPI JlsyplIxmYhYywuInIYydBc= =hZO4 -----END PGP SIGNATURE----- From Chris.Barker at noaa.gov Fri Jul 14 00:19:30 2006 From: Chris.Barker at noaa.gov (Christopher Barker) Date: Thu, 13 Jul 2006 15:19:30 -0700 Subject: [Pythonmac-SIG] Errors in Numpy running matplotlib In-Reply-To: <5306988.post@talk.nabble.com> References: <5306988.post@talk.nabble.com> Message-ID: <44B6C6F2.2080209@noaa.gov> jamesk wrote: > I'm get a bus error running matplotlib - the error occurs just from importing > pylab . I'm running 10.4.7 on an Intel mac. All of the python libraries I'm > using came from the macpython site. Do you mean: http://www.pythonmac.org/packages/py24-fat/index.html If so, I built the NumPy that is there, bu have not yet tried it with MPL. Who built the MPL package there? What version of numpy did you build it against? What else did you built it against? It would be nice to keep a set of: numpy, Numeric, numarray, wxPython and MPL that all work together on that site. I haven't built MPL for a while, so I don't know what it takes, but the rest of them should be pretty straightforward. -Chris > Following the suggestions from an earlier post, I ran gdb to get a backtrace > as follows: gdb --args /usr/local/bin/python -c "import pylab" > > > Here's the trace: > > Reading symbols for shared libraries . done > Reading symbols for shared libraries . done > > Program received signal EXC_BAD_ACCESS, Could not access memory. > Reason: KERN_PROTECTION_FAILURE at address: 0x014a9bc4 > 0x0104759a in PyArray_AxisConverter (obj=0xe458, axis=0x14a9bc4) at > numpy/core/src/multiarraymodule.c:117 > 117 numpy/core/src/multiarraymodule.c: No such file or directory. > in numpy/core/src/multiarraymodule.c > > > If I switch to Numeric, the problem goes away, so It looks like its a bad > build/install of numpy. > > -James -- Christopher Barker, Ph.D. Oceanographer NOAA/OR&R/HAZMAT (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 stefan at feelthemachine.com Fri Jul 14 10:51:39 2006 From: stefan at feelthemachine.com (Stefan Holmer) Date: Fri, 14 Jul 2006 10:51:39 +0200 Subject: [Pythonmac-SIG] Problem with open_app Action Event Message-ID: <44B75B1B.50603@feelthemachine.com> Hi I'm trying to open pictures with my program using right click and "Open with...". It works when the program is already started, but when the program gets started with the "Open with..." I don't receive an Action Event at all it seems. Why is this? And how do I fix it? Thanks, Stefan From telliott99 at mac.com Fri Jul 14 00:57:28 2006 From: telliott99 at mac.com (Tom Elliott) Date: Thu, 13 Jul 2006 18:57:28 -0400 Subject: [Pythonmac-SIG] (no subject) Message-ID: Hi, Some time ago I asked this list for help with a "Newbie problem" which was really about Cocoa rather than PyObjC: to determine which button of a set of radio buttons (NSMatrix) was selected. Bob Ippolito kindly suggested the following elegant filter solution (given radioMatrix as an outlet, and getRadio_() as the action to PyAppDelegate: def getRadio_(self): selectedCells = filter(lambda cell: cell.intValue() == 1, self.radioMatrix.cells()) This actually seemed to work 1.5 years ago. I can't verify that now easily. Today I had occasion to go back to this code and it clearly has a problem. The list of cells with intValue() == 1 includes both the currently selected cell and the previously selected one. Each time I select a new button, I get two positives from the filter, unless I choose the same button twice in a row. Even selectedCells() is supposed to return both selected and *highlighted* cells, according to the docs. In my tests, selectedCells() returns the correct value, but it seems better to use selectedCell(). Or, selectedRow() (for a single column matrix) can also be queried to get the correct value. I don't know if this is surprising or it's obvious to everybody. FYI. Thanks for all your help. Someday I intend to write a FAVSQ for PyObjC (FA very simple Q). I think it's wonderful what you've done, but even simple things have taken me quite a while to figure out. And I think a helpful thing would be to dissect out very simple examples of all common situations. Tom Elliott -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/pythonmac-sig/attachments/20060713/275b1621/attachment.htm From jkebinger at gmail.com Fri Jul 14 15:27:12 2006 From: jkebinger at gmail.com (James Kebinger) Date: Fri, 14 Jul 2006 09:27:12 -0400 Subject: [Pythonmac-SIG] Errors in Numpy running matplotlib In-Reply-To: <44B6C6F2.2080209@noaa.gov> References: <5306988.post@talk.nabble.com> <44B6C6F2.2080209@noaa.gov> Message-ID: <6d88dde20607140627s2d3c2074xc0bf60e0b22c04e6@mail.gmail.com> Thanks for responding. Every library I'm using came prebuild from http://www.pythonmac.or/packages/py24-fat/index.html. I don't know who built them or when. To be clear, this problem is happening at runtime, not while building anything. It would indeed be nice for the repository to host a set of libraries that work together. I'd be happy to lend a hand in this if there are directions for building the universal binaries and installers. -James On 7/13/06, Christopher Barker wrote: > > jamesk wrote: > > I'm get a bus error running matplotlib - the error occurs just from > importing > > pylab . I'm running 10.4.7 on an Intel mac. All of the python libraries > I'm > > using came from the macpython site. > > Do you mean: > > http://www.pythonmac.org/packages/py24-fat/index.html > > If so, I built the NumPy that is there, bu have not yet tried it with > MPL. Who built the MPL package there? What version of numpy did you > build it against? What else did you built it against? > > It would be nice to keep a set of: numpy, Numeric, numarray, wxPython > and MPL that all work together on that site. I haven't built MPL for a > while, so I don't know what it takes, but the rest of them should be > pretty straightforward. > > -Chris > > > > > Following the suggestions from an earlier post, I ran gdb to get a > backtrace > > as follows: gdb --args /usr/local/bin/python -c "import pylab" > > > > > > Here's the trace: > > > > Reading symbols for shared libraries . done > > Reading symbols for shared libraries . done > > > > Program received signal EXC_BAD_ACCESS, Could not access memory. > > Reason: KERN_PROTECTION_FAILURE at address: 0x014a9bc4 > > 0x0104759a in PyArray_AxisConverter (obj=0xe458, axis=0x14a9bc4) at > > numpy/core/src/multiarraymodule.c:117 > > 117 numpy/core/src/multiarraymodule.c: No such file or directory. > > in numpy/core/src/multiarraymodule.c > > > > > > If I switch to Numeric, the problem goes away, so It looks like its a > bad > > build/install of numpy. > > > > -James > > > -- > Christopher Barker, Ph.D. > Oceanographer > > NOAA/OR&R/HAZMAT (206) 526-6959 voice > 7600 Sand Point Way NE (206) 526-6329 fax > Seattle, WA 98115 (206) 526-6317 main reception > > Chris.Barker at noaa.gov > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/pythonmac-sig/attachments/20060714/7db20ab1/attachment.htm From glassfordm at gmail.com Fri Jul 14 16:42:29 2006 From: glassfordm at gmail.com (Michael Glassford) Date: Fri, 14 Jul 2006 10:42:29 -0400 Subject: [Pythonmac-SIG] Building python 2.4.3 on OSX 10.3.9 In-Reply-To: References: <44AEA5EE.5040509@hotmail.com> <44B05C62.7080502@hotmail.com> <44B2739A.1040001@hotmail.com> <995A18BC-1AD5-4C15-8DE0-E38BD48CA777@mac.com> <44B50C5F.90206@hotmail.com> <498E2068-DB46-4087-9371-D88DB768B65E@redivi.com> <44B53F5F.1010401@hotmail.com> Message-ID: <44B7AD55.3020900@hotmail.com> Bob Ippolito wrote: > On Jul 12, 2006, at 11:28 AM, Michael Glassford wrote: > >> Bob Ippolito wrote: >>> On Jul 12, 2006, at 7:51 AM, Michael Glassford wrote: >>> and second it's not what you're running anyway! Look at the site- >>> packages dir in the exception, that's a normal unix install, not >>> a framework install. >> Yes, as I said I ran three different executables and got the same >> error from each. This is only one of the three errors. Presumably >> the others would have had different site-packages paths. >> Unfortunately, the output is long gone and I can't reproduce this >> problem again except with /usr/local/bin/python2.4; however, I ran >> each more than once just to make sure, using the full path each >> time, so I don't see how I could have been mistaken. In any case... >> >>> You need a framework install (./configure --enable-framework >>> && sudo make frameworkinstall). >> Is there somewhere that I should have learned about this option? > > Mac/OSX/README in the sources, ./configure --help, I didn't know about either of these; thanks. > or mailing list archives. > Where would you have expected to learn about the option? Ideally there would be a note easily found from the Python source download page telling me that the option existed and that I would likely want to use it (or under what circumstances I would want to use it). > Did you read documentation somewhere before building? Some of it. There's a lot of documentation in a lot of places, and I failed to find all of it. >> When I did this, all of the unit tests passed. When I run /usr/ >> local/bin/python2.4 I still get this error: >> >> """ > ... >> RuntimeError: Can't send Apple events: no access to Window Manager. >> (aem-based scripts must be run within a GUI process; e.g. use >> 'pythonw', not 'python', if running script in shell) >> """ >> >> However, /usr/local/bin/pythonw2.4 appears to work OK now. > > This is expected for that version of Python. > >> This behavior is different from the Python installed on Tiger by >> the 2.4 universal binary installer (where there is no pythonw and >> python has access to the window manager), but at least I have >> something that seems to work now. > > Yes, it is different than Universal Python because you compiled > different sources. Universal Python 2.4.3 is a fork of Python that > includes several Mac-specific features that aren't in the mainline > sources until Python 2.5. The Universal Python repository is at: > http://svn.pythonmac.org/python24/python24-fat/ OK, thanks. I didn't realize that. The version I used should be OK for building an application on 10.3.9 that will run on 10.3.9, right? > Universal Python 2.4.3 does have "pythonw", for compatibility, I had one system where pythonw for 2.4.3 was missing (i.e. "python" ran 2.4.3 but "pythonw" ran 2.3.5), but can't find it again now. If I run across it again I'll try to figure out how this happened. > but it > is the same as what you get when you run "python". Technically, both > the "python" and "pythonw" executables for Universal Python are a > compiled equivalent to the previously shell script "pythonw", which > re-execs the Python interpreter with a different argv[0] (inside an > app bundle). I did understand this, but thanks for the explanation. Mike From glassfordm at hotmail.com Fri Jul 14 16:42:29 2006 From: glassfordm at hotmail.com (Michael Glassford) Date: Fri, 14 Jul 2006 10:42:29 -0400 Subject: [Pythonmac-SIG] Building python 2.4.3 on OSX 10.3.9 In-Reply-To: References: <44AEA5EE.5040509@hotmail.com> <44B05C62.7080502@hotmail.com> <44B2739A.1040001@hotmail.com> <995A18BC-1AD5-4C15-8DE0-E38BD48CA777@mac.com> <44B50C5F.90206@hotmail.com> <498E2068-DB46-4087-9371-D88DB768B65E@redivi.com> <44B53F5F.1010401@hotmail.com> Message-ID: <44B7AD55.3020900@hotmail.com> Bob Ippolito wrote: > On Jul 12, 2006, at 11:28 AM, Michael Glassford wrote: > >> Bob Ippolito wrote: >>> On Jul 12, 2006, at 7:51 AM, Michael Glassford wrote: >>> and second it's not what you're running anyway! Look at the site- >>> packages dir in the exception, that's a normal unix install, not >>> a framework install. >> Yes, as I said I ran three different executables and got the same >> error from each. This is only one of the three errors. Presumably >> the others would have had different site-packages paths. >> Unfortunately, the output is long gone and I can't reproduce this >> problem again except with /usr/local/bin/python2.4; however, I ran >> each more than once just to make sure, using the full path each >> time, so I don't see how I could have been mistaken. In any case... >> >>> You need a framework install (./configure --enable-framework >>> && sudo make frameworkinstall). >> Is there somewhere that I should have learned about this option? > > Mac/OSX/README in the sources, ./configure --help, I didn't know about either of these; thanks. > or mailing list archives. > Where would you have expected to learn about the option? Ideally there would be a note easily found from the Python source download page telling me that the option existed and that I would likely want to use it (or under what circumstances I would want to use it). > Did you read documentation somewhere before building? Some of it. There's a lot of documentation in a lot of places, and I failed to find all of it. >> When I did this, all of the unit tests passed. When I run /usr/ >> local/bin/python2.4 I still get this error: >> >> """ > ... >> RuntimeError: Can't send Apple events: no access to Window Manager. >> (aem-based scripts must be run within a GUI process; e.g. use >> 'pythonw', not 'python', if running script in shell) >> """ >> >> However, /usr/local/bin/pythonw2.4 appears to work OK now. > > This is expected for that version of Python. > >> This behavior is different from the Python installed on Tiger by >> the 2.4 universal binary installer (where there is no pythonw and >> python has access to the window manager), but at least I have >> something that seems to work now. > > Yes, it is different than Universal Python because you compiled > different sources. Universal Python 2.4.3 is a fork of Python that > includes several Mac-specific features that aren't in the mainline > sources until Python 2.5. The Universal Python repository is at: > http://svn.pythonmac.org/python24/python24-fat/ OK, thanks. I didn't realize that. The version I used should be OK for building an application on 10.3.9 that will run on 10.3.9, right? > Universal Python 2.4.3 does have "pythonw", for compatibility, I had one system where pythonw for 2.4.3 was missing (i.e. "python" ran 2.4.3 but "pythonw" ran 2.3.5), but can't find it again now. If I run across it again I'll try to figure out how this happened. > but it > is the same as what you get when you run "python". Technically, both > the "python" and "pythonw" executables for Universal Python are a > compiled equivalent to the previously shell script "pythonw", which > re-execs the Python interpreter with a different argv[0] (inside an > app bundle). I did understand this, but thanks for the explanation. Mike From bob at redivi.com Fri Jul 14 19:07:22 2006 From: bob at redivi.com (Bob Ippolito) Date: Fri, 14 Jul 2006 10:07:22 -0700 Subject: [Pythonmac-SIG] Building python 2.4.3 on OSX 10.3.9 In-Reply-To: <44B7AD55.3020900@hotmail.com> References: <44AEA5EE.5040509@hotmail.com> <44B05C62.7080502@hotmail.com> <44B2739A.1040001@hotmail.com> <995A18BC-1AD5-4C15-8DE0-E38BD48CA777@mac.com> <44B50C5F.90206@hotmail.com> <498E2068-DB46-4087-9371-D88DB768B65E@redivi.com> <44B53F5F.1010401@hotmail.com> <44B7AD55.3020900@hotmail.com> Message-ID: On Jul 14, 2006, at 7:42 AM, Michael Glassford wrote: > Bob Ippolito wrote: >> On Jul 12, 2006, at 11:28 AM, Michael Glassford wrote: >>> Bob Ippolito wrote: >>>> On Jul 12, 2006, at 7:51 AM, Michael Glassford wrote: >>>> and second it's not what you're running anyway! Look at the >>>> site- packages dir in the exception, that's a normal unix >>>> install, not a framework install. >>> Yes, as I said I ran three different executables and got the >>> same error from each. This is only one of the three errors. >>> Presumably the others would have had different site-packages >>> paths. Unfortunately, the output is long gone and I can't >>> reproduce this problem again except with /usr/local/bin/ >>> python2.4; however, I ran each more than once just to make sure, >>> using the full path each time, so I don't see how I could have >>> been mistaken. In any case... >>> >>>> You need a framework install (./configure --enable-framework >>>> && sudo make frameworkinstall). >>> Is there somewhere that I should have learned about this option? >> Mac/OSX/README in the sources, ./configure --help, > > I didn't know about either of these; thanks. > >> or mailing list archives. > > Where would you have expected to learn about the option? > > Ideally there would be a note easily found from the Python source > download page telling me that the option existed and that I would > likely want to use it (or under what circumstances I would want to > use it). There's a lot of configure options, I'm not sure this one deserves special mention on the sources page. It doesn't apply very often. Extremely few people need to build a framework Python. >>> This behavior is different from the Python installed on Tiger by >>> the 2.4 universal binary installer (where there is no pythonw >>> and python has access to the window manager), but at least I >>> have something that seems to work now. >> Yes, it is different than Universal Python because you compiled >> different sources. Universal Python 2.4.3 is a fork of Python >> that includes several Mac-specific features that aren't in the >> mainline sources until Python 2.5. The Universal Python >> repository is at: >> http://svn.pythonmac.org/python24/python24-fat/ > > OK, thanks. I didn't realize that. The version I used should be OK > for building an application on 10.3.9 that will run on 10.3.9, right? Yes. >> Universal Python 2.4.3 does have "pythonw", for compatibility, > > I had one system where pythonw for 2.4.3 was missing (i.e. "python" > ran 2.4.3 but "pythonw" ran 2.3.5), but can't find it again now. If > I run across it again I'll try to figure out how this happened. Well, it wasn't a system with Universal Python 2.4.3. -bob From bob at redivi.com Fri Jul 14 19:21:31 2006 From: bob at redivi.com (Bob Ippolito) Date: Fri, 14 Jul 2006 10:21:31 -0700 Subject: [Pythonmac-SIG] Problem with open_app Action Event In-Reply-To: <44B75B1B.50603@feelthemachine.com> References: <44B75B1B.50603@feelthemachine.com> Message-ID: On Jul 14, 2006, at 1:51 AM, Stefan Holmer wrote: > I'm trying to open pictures with my program using right click and > "Open > with...". It works when the program is already started, but when the > program gets started with the "Open with..." I don't receive an Action > Event at all it seems. > > Why is this? And how do I fix it? First you have to give enough information so that we have *some* idea what you're talking about. Most importantly, is this a PyObjC app, wxWindows, etc. and how was the application built? -bob From Chris.Barker at noaa.gov Fri Jul 14 20:36:04 2006 From: Chris.Barker at noaa.gov (Christopher Barker) Date: Fri, 14 Jul 2006 11:36:04 -0700 Subject: [Pythonmac-SIG] Errors in Numpy running matplotlib In-Reply-To: <6d88dde20607140627s2d3c2074xc0bf60e0b22c04e6@mail.gmail.com> References: <5306988.post@talk.nabble.com> <44B6C6F2.2080209@noaa.gov> <6d88dde20607140627s2d3c2074xc0bf60e0b22c04e6@mail.gmail.com> Message-ID: <44B7E414.6030801@noaa.gov> James Kebinger wrote: > Thanks for responding. Every library I'm using came prebuild from > http://www.pythonmac.or/packages/py24-fat/index.html. I don't know who > built them or when. Nor do I, but I'm having the same problem as you with them, on a PC Mac. So I'm working on re-building it. > It would indeed be nice for the repository to host a set of > libraries that work together. Yes, we need to be careful about that. maybe .eggs would work better, as I think they can check dependencies, but mpkgs are so easy to build and install. > I'd be happy to lend a hand in this if there > are directions for building the universal binaries and installers. It's quite easy, at least when everything "just works". 1) Make sure you have the universal build Python 2) get Py2App (from that same site) 3) % bdist_mpkg ( in the directory where the setup.py for your package lives ). Then look in the "dist" directory for the mpkg. Matplotlib is trickier, as it requires all sorts of dependencies, both Python packages and not. And as you've seen, the versions have to match. I'm working on it now. I have a written up what I've done in the past, it's in the MPL package you can find on pythonmac.org for OS-X 10.9 and Python 2.3.5 -Chris -- Christopher Barker, Ph.D. Oceanographer NOAA/OR&R/HAZMAT (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 stefan at feelthemachine.com Fri Jul 14 20:43:53 2006 From: stefan at feelthemachine.com (Stefan Holmer) Date: Fri, 14 Jul 2006 20:43:53 +0200 Subject: [Pythonmac-SIG] Problem with open_app Action Event In-Reply-To: References: <44B75B1B.50603@feelthemachine.com> Message-ID: <44B7E5E9.1010006@feelthemachine.com> I'm writing the application in Python using the MiniAEFrame module which comes with MacPython. I've built it mostly like the example test class in MiniAEFrame named _Test. Although, I noticed that I had to change the code "aevt" to "tvea" and "oapp" to "codo", don't know why though? Have these codes been changed? I've bound the method "open_app" to the "tvea"/"codo" event and it's being called when I do "open with..." on a file while the program is running. But when the program isn't running, it starts, though the "open_app" method isn't called. I also have a method "other" bound to "****"/"****" which just reports that an unhandled event has been caught, and it's not reporting anything either. Does this information help, or do you need to know something else? My code looks like this: import MacOS, EasyDialogs from MiniAEFrame import AEServer, MiniApplication import Carbon class MyApp(AEServer, MiniApplication): def __init__(self): MiniApplication.__init__(self) AEServer.__init__(self) self.installaehandler('tvea', 'codo', self.open_app) self.installaehandler('****', '****', self.other) self.mainloop() def open_app(self, _object, _class, _type, **args): EasyDialogs.Message("open_app") def other(self, _object=None, _class=None, _type=None, **args): EasyDialogs.Message("other: " + _class + " " + _type) MyApp() Bob Ippolito skrev: > > On Jul 14, 2006, at 1:51 AM, Stefan Holmer wrote: > >> I'm trying to open pictures with my program using right click and "Open >> with...". It works when the program is already started, but when the >> program gets started with the "Open with..." I don't receive an Action >> Event at all it seems. >> >> Why is this? And how do I fix it? > > First you have to give enough information so that we have *some* idea > what you're talking about. Most importantly, is this a PyObjC app, > wxWindows, etc. and how was the application built? > > -bob > > From njriley at uiuc.edu Fri Jul 14 21:17:51 2006 From: njriley at uiuc.edu (Nicholas Riley) Date: Fri, 14 Jul 2006 14:17:51 -0500 Subject: [Pythonmac-SIG] Problem with open_app Action Event In-Reply-To: <44B7E5E9.1010006@feelthemachine.com> References: <44B75B1B.50603@feelthemachine.com> <44B7E5E9.1010006@feelthemachine.com> Message-ID: <20060714191750.GA43881@uiuc.edu> On Fri, Jul 14, 2006 at 08:43:53PM +0200, Stefan Holmer wrote: > I'm writing the application in Python using the MiniAEFrame module which > comes with MacPython. I've built it mostly like the example test class > in MiniAEFrame named _Test. Try using aemreceive, part of appscript (http://freespace.virgin.net/hamish.sanderson/appscript.html) instead of MiniAEFrame - it's a much better version. A script I wrote using aemreceive is here: It's extremely special-purpose, but should give you some ideas. There are also some examples (and documentation) included with appscript. -- Nicholas Riley | From Chris.Barker at noaa.gov Fri Jul 14 22:47:06 2006 From: Chris.Barker at noaa.gov (Christopher Barker) Date: Fri, 14 Jul 2006 13:47:06 -0700 Subject: [Pythonmac-SIG] Matplotlib, other libs and the Universal Python Message-ID: <44B802CA.6030001@noaa.gov> Hi all, I'm working on Building a Matplotlib that will work with the Universal Python. I was going along just fine, following the procedure that I've used before, but low and behold, I've run into a problem. MPL Requires libpng and a version of libfreetype that doesn't come with OS-X. In the past, I built static versions of these, put them in a place where distutils will find them, and presto! However, I have a PPC Mac, so I now have PPC libs, and that's won't link with the Intel binaries. At least that's what I think the problem is. In any case, I know that will be a problem. So, while I dig around the net for ways to build a universal static libs from libpng and libfreetype, does anyone have any hints for me? Of ready to go packages of these? -Chris -- Christopher Barker, Ph.D. Oceanographer NOAA/OR&R/HAZMAT (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 stefan at feelthemachine.com Fri Jul 14 22:54:42 2006 From: stefan at feelthemachine.com (Stefan Holmer) Date: Fri, 14 Jul 2006 22:54:42 +0200 Subject: [Pythonmac-SIG] Problem with open_app Action Event In-Reply-To: <20060714191750.GA43881@uiuc.edu> References: <44B75B1B.50603@feelthemachine.com> <44B7E5E9.1010006@feelthemachine.com> <20060714191750.GA43881@uiuc.edu> Message-ID: <44B80492.2040808@feelthemachine.com> Nicholas, I feel pretty stupid, but I actually can't find any information in the appscript documentation about how to listen for and bind a function to an apple event? Can you enlighten me a bit? Nicholas Riley skrev: > On Fri, Jul 14, 2006 at 08:43:53PM +0200, Stefan Holmer wrote: > >> I'm writing the application in Python using the MiniAEFrame module which >> comes with MacPython. I've built it mostly like the example test class >> in MiniAEFrame named _Test. >> > > Try using aemreceive, part of appscript > (http://freespace.virgin.net/hamish.sanderson/appscript.html) instead > of MiniAEFrame - it's a much better version. > > A script I wrote using aemreceive is here: > > > > It's extremely special-purpose, but should give you some ideas. > > There are also some examples (and documentation) included with appscript. > > From bob at redivi.com Fri Jul 14 23:20:25 2006 From: bob at redivi.com (Bob Ippolito) Date: Fri, 14 Jul 2006 14:20:25 -0700 Subject: [Pythonmac-SIG] Matplotlib, other libs and the Universal Python In-Reply-To: <44B802CA.6030001@noaa.gov> References: <44B802CA.6030001@noaa.gov> Message-ID: On Jul 14, 2006, at 1:47 PM, Christopher Barker wrote: > Hi all, > > I'm working on Building a Matplotlib that will work with the Universal > Python. > > I was going along just fine, following the procedure that I've used > before, but low and behold, I've run into a problem. > > MPL Requires libpng and a version of libfreetype that doesn't come > with > OS-X. > > In the past, I built static versions of these, put them in a place > where > distutils will find them, and presto! > > However, I have a PPC Mac, so I now have PPC libs, and that's won't > link > with the Intel binaries. At least that's what I think the problem > is. In > any case, I know that will be a problem. > > So, while I dig around the net for ways to build a universal static > libs > from libpng and libfreetype, does anyone have any hints for me? > > Of ready to go packages of these? I use the script that SDL uses, gcc-fat.sh. It's a compiler frontend that compiles 10.2 PPC with gcc3.3 and 10.4 i386 with gcc4. Not compatible with everything, but definitely works with libpng. There's a copy of it sitting in here: http://cvs.icculus.org/smpeg/ -bob From stefan at feelthemachine.com Sat Jul 15 01:15:02 2006 From: stefan at feelthemachine.com (Stefan Holmer) Date: Sat, 15 Jul 2006 01:15:02 +0200 Subject: [Pythonmac-SIG] Problem with open_app Action Event In-Reply-To: <20060714191750.GA43881@uiuc.edu> References: <44B75B1B.50603@feelthemachine.com> <44B7E5E9.1010006@feelthemachine.com> <20060714191750.GA43881@uiuc.edu> Message-ID: <44B82576.6040908@feelthemachine.com> I'm now trying to use argvemulator to collect the Event. When I set ArgvCollector to trig on 'odoc' it gives me some odd path inside my .app-directory. If I modify the code for ArgvCollector and make it trigger on 'odoc' and 'codo' I get my the correct path for the file I'm trying to open, but when ArgvCollector.mainloop() is done, the whole program crashes without telling me why. First of all, why do I have to trig on 'codo'? Seems like all my event codes are reversed! Does it have something to do with different endians on intel and ppc? If so, are there an intel compatible version of argvemulator? Stefan Nicholas Riley skrev: > On Fri, Jul 14, 2006 at 08:43:53PM +0200, Stefan Holmer wrote: > >> I'm writing the application in Python using the MiniAEFrame module which >> comes with MacPython. I've built it mostly like the example test class >> in MiniAEFrame named _Test. >> > > Try using aemreceive, part of appscript > (http://freespace.virgin.net/hamish.sanderson/appscript.html) instead > of MiniAEFrame - it's a much better version. > > A script I wrote using aemreceive is here: > > > > It's extremely special-purpose, but should give you some ideas. > > There are also some examples (and documentation) included with appscript. > > From Chris.Barker at noaa.gov Sat Jul 15 01:17:29 2006 From: Chris.Barker at noaa.gov (Christopher Barker) Date: Fri, 14 Jul 2006 16:17:29 -0700 Subject: [Pythonmac-SIG] Matplotlib, other libs and the Universal Python In-Reply-To: References: <44B802CA.6030001@noaa.gov> Message-ID: <44B82609.1080405@noaa.gov> Bob Ippolito wrote: > I use the script that SDL uses, gcc-fat.sh. It's a compiler frontend > that compiles 10.2 PPC with gcc3.3 and 10.4 i386 with gcc4. Not > compatible with everything, but definitely works with libpng. That looks promising. I've got it, but noticed that it's using gcc-3.3 on PPC, for 10.2 compatibility. Is the Universal Python 2.4.3 built this way? Will it work anyway? -- I guess I'll find out. Why not use gcc4 on PPC in this case, as we're only supporting 10.3.9 and above, and really only supporting 10.4 well? I'm off to try it out... -Chris -- Christopher Barker, Ph.D. Oceanographer NOAA/OR&R/HAZMAT (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 Sat Jul 15 01:48:14 2006 From: Chris.Barker at noaa.gov (Christopher Barker) Date: Fri, 14 Jul 2006 16:48:14 -0700 Subject: [Pythonmac-SIG] Matplotlib, other libs and the Universal Python In-Reply-To: References: <44B802CA.6030001@noaa.gov> Message-ID: <44B82D3E.6050803@noaa.gov> Bob Ippolito wrote: > I use the script that SDL uses, gcc-fat.sh. It's a compiler frontend > that compiles 10.2 PPC with gcc3.3 and 10.4 i386 with gcc4. Not > compatible with everything, but definitely works with libpng. Not for me, but I have no idea what I'm doing. I tried: ./configure CC="sh gcc-fat.sh" and got: checking for gcc... sh gcc-fat.sh checking for C compiler default output file name... configure: error: C compiler cannot create executables See `config.log' for more details. config.log wasn't helpful So I tried making gcc-fat.sh executable, and: ./configure CC=./gcc-fat.sh Same problem. It makes me wish I actually understood this stuff! Off to try some more things.... -Chris -- Christopher Barker, Ph.D. Oceanographer NOAA/OR&R/HAZMAT (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 bob at redivi.com Sat Jul 15 01:56:43 2006 From: bob at redivi.com (Bob Ippolito) Date: Fri, 14 Jul 2006 16:56:43 -0700 Subject: [Pythonmac-SIG] Problem with open_app Action Event In-Reply-To: <44B82576.6040908@feelthemachine.com> References: <44B75B1B.50603@feelthemachine.com> <44B7E5E9.1010006@feelthemachine.com> <20060714191750.GA43881@uiuc.edu> <44B82576.6040908@feelthemachine.com> Message-ID: Yes, Python 2.3 on Mac OS X 10.4 i386 is indeed broken for most things in Carbon.*, especially Apple Events. Use Universal Python 2.4.3. http://pythonmac.org/packages/py24-fat/ -bob On Jul 14, 2006, at 4:15 PM, Stefan Holmer wrote: > I'm now trying to use argvemulator to collect the Event. When I set > ArgvCollector to trig on 'odoc' it gives me some odd path inside my > .app-directory. If I modify the code for ArgvCollector and make it > trigger on 'odoc' and 'codo' I get my the correct path for the file > I'm > trying to open, but when ArgvCollector.mainloop() is done, the whole > program crashes without telling me why. > > First of all, why do I have to trig on 'codo'? Seems like all my event > codes are reversed! Does it have something to do with different > endians > on intel and ppc? If so, are there an intel compatible version of > argvemulator? > > Stefan > > Nicholas Riley skrev: >> On Fri, Jul 14, 2006 at 08:43:53PM +0200, Stefan Holmer wrote: >> >>> I'm writing the application in Python using the MiniAEFrame >>> module which >>> comes with MacPython. I've built it mostly like the example test >>> class >>> in MiniAEFrame named _Test. >>> >> >> Try using aemreceive, part of appscript >> (http://freespace.virgin.net/hamish.sanderson/appscript.html) instead >> of MiniAEFrame - it's a much better version. >> >> A script I wrote using aemreceive is here: >> >> > RetroStatus.py> >> >> It's extremely special-purpose, but should give you some ideas. >> >> There are also some examples (and documentation) included with >> appscript. >> >> > _______________________________________________ > Pythonmac-SIG maillist - Pythonmac-SIG at python.org > http://mail.python.org/mailman/listinfo/pythonmac-sig From bob at redivi.com Sat Jul 15 02:03:38 2006 From: bob at redivi.com (Bob Ippolito) Date: Fri, 14 Jul 2006 17:03:38 -0700 Subject: [Pythonmac-SIG] Matplotlib, other libs and the Universal Python In-Reply-To: <44B82D3E.6050803@noaa.gov> References: <44B802CA.6030001@noaa.gov> <44B82D3E.6050803@noaa.gov> Message-ID: <47FA326C-983E-46E0-9D6D-E6ECEC49A704@redivi.com> On Jul 14, 2006, at 4:48 PM, Christopher Barker wrote: > Bob Ippolito wrote: >> I use the script that SDL uses, gcc-fat.sh. It's a compiler frontend >> that compiles 10.2 PPC with gcc3.3 and 10.4 i386 with gcc4. Not >> compatible with everything, but definitely works with libpng. > > Not for me, but I have no idea what I'm doing. I tried: > > ./configure CC="sh gcc-fat.sh" > > and got: > > checking for gcc... sh gcc-fat.sh > checking for C compiler default output file name... configure: > error: C > compiler cannot create executables > See `config.log' for more details. > > config.log wasn't helpful > > So I tried making gcc-fat.sh executable, and: > > ./configure CC=./gcc-fat.sh > > Same problem. > > It makes me wish I actually understood this stuff! > > Off to try some more things.... I dunno, I'm pretty sure it worked for me. I definitely have a universal libpng that I built myself. Here it is: http://undefined.org/python/libpng-1.1.2-universal.tgz -bob From Chris.Barker at noaa.gov Sat Jul 15 02:19:32 2006 From: Chris.Barker at noaa.gov (Christopher Barker) Date: Fri, 14 Jul 2006 17:19:32 -0700 Subject: [Pythonmac-SIG] Someone had PIL trouble on i386 10.4.6 Python 2.4 IIRC--I succeeded this evening In-Reply-To: <1060B325-FE92-4CC9-88ED-6F754699C747@mac.com> References: <20060415181953.GA10371@crayon.invisible-island.net> <2mirp8l9jv.fsf@starship.python.net> <44454A6D.2030601@noaa.gov> <93B3C6F7-78EE-432E-A569-70DCF6A7F638@redivi.com> <44466A01.8080903@noaa.gov> <38833B9B-8083-4635-9381-6BCEBBC91DCA@redivi.com> <4446BF4C.1010508@noaa.gov> <1060B325-FE92-4CC9-88ED-6F754699C747@mac.com> Message-ID: <44B83494.4060704@noaa.gov> Ronald Oussoren wrote: >>> I'll have to package up my package build script one of these days ;-) Did you ever package up your build script? > Its one level higher: a script that uses bdist_egg and bdist_mpkg to build > binary packages given a list of recipes. >> I like binary packages on > pythonmac.org, but don't like the fact that most of them seem to build > by hand and that some required manual prodding to get them to work. Me too, I've tweaked matplotlib one times to many, and now I can't figure out how to get fat static libs of the dependencies. It's time to get a script written that "just builds it" Anything you've got, I'll take! -Chris -- Christopher Barker, Ph.D. Oceanographer NOAA/OR&R/HAZMAT (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 cwmoad at gmail.com Sat Jul 15 03:08:09 2006 From: cwmoad at gmail.com (Charlie Moad) Date: Fri, 14 Jul 2006 20:08:09 -0500 Subject: [Pythonmac-SIG] Matplotlib, other libs and the Universal Python In-Reply-To: <44B802CA.6030001@noaa.gov> References: <44B802CA.6030001@noaa.gov> Message-ID: <6382066a0607141808s5664ec75t6406c525950b844b@mail.gmail.com> On 7/14/06, Christopher Barker wrote: > Hi all, > > I'm working on Building a Matplotlib that will work with the Universal > Python. > > I was going along just fine, following the procedure that I've used > before, but low and behold, I've run into a problem. > > MPL Requires libpng and a version of libfreetype that doesn't come with > OS-X. > > In the past, I built static versions of these, put them in a place where > distutils will find them, and presto! > > However, I have a PPC Mac, so I now have PPC libs, and that's won't link > with the Intel binaries. At least that's what I think the problem is. In > any case, I know that will be a problem. > > So, while I dig around the net for ways to build a universal static libs > from libpng and libfreetype, does anyone have any hints for me? > > Of ready to go packages of these? Hey Chris, I built fat versions of matplotlib-0.87.3 that are on the sourceforge download page. I statically linked in png and freetype and I did all this on a ppc machine. It is really easy to build these dependency libs. Just make sure, "-arch ppc -arch i386" is in you CFLAGS. This will cause everything to be built fat. I haven't got around to the 0.87.4 mac builds yet. I can assure you it is very similar to just building for ppc though. The universal build of python adds those compiler flags for you, so you don't need to worry about them when using distutils. Let me know if you want any help. - Charlie From cwmoad at gmail.com Sat Jul 15 03:13:51 2006 From: cwmoad at gmail.com (Charlie Moad) Date: Fri, 14 Jul 2006 20:13:51 -0500 Subject: [Pythonmac-SIG] Errors in Numpy running matplotlib In-Reply-To: <44B7E414.6030801@noaa.gov> References: <5306988.post@talk.nabble.com> <44B6C6F2.2080209@noaa.gov> <6d88dde20607140627s2d3c2074xc0bf60e0b22c04e6@mail.gmail.com> <44B7E414.6030801@noaa.gov> Message-ID: <6382066a0607141813m72edaf35ne18f0dadc34aa0a0@mail.gmail.com> On 7/14/06, Christopher Barker wrote: > James Kebinger wrote: > > Thanks for responding. Every library I'm using came prebuild from > > http://www.pythonmac.or/packages/py24-fat/index.html. I don't know who > > built them or when. > > Nor do I, but I'm having the same problem as you with them, on a PC Mac. > So I'm working on re-building it. > > > It would indeed be nice for the repository to host a set of > > libraries that work together. > > Yes, we need to be careful about that. maybe .eggs would work better, as > I think they can check dependencies, but mpkgs are so easy to build and > install. > > > I'd be happy to lend a hand in this if there > > are directions for building the universal binaries and installers. > > It's quite easy, at least when everything "just works". > > 1) Make sure you have the universal build Python > > 2) get Py2App (from that same site) > > 3) % bdist_mpkg ( in the directory where the setup.py for your package > lives ). > > Then look in the "dist" directory for the mpkg. > > Matplotlib is trickier, as it requires all sorts of dependencies, both > Python packages and not. And as you've seen, the versions have to match. > > I'm working on it now. I have a written up what I've done in the past, > it's in the MPL package you can find on pythonmac.org for OS-X 10.9 and > Python 2.3.5 I built the matplotlib on the listing and it requires numpy-0.9.6. I have ran into issues in the past with the multiarray module conflicting between Numeric and numpy. As I said in the other mpl thread, let me know if you need any help. - Charlie From bob at redivi.com Sat Jul 15 06:34:13 2006 From: bob at redivi.com (Bob Ippolito) Date: Fri, 14 Jul 2006 21:34:13 -0700 Subject: [Pythonmac-SIG] Install In-Reply-To: References: Message-ID: On Jul 11, 2006, at 3:14 PM, Robert Anton Patterson wrote: > Hi I'm trying to install MySQLdb-1.2.1 on Mac OS X and would > appreciate > anyone's help on the matter. Ben Gollmer just contributed a universal build of MySQLdb-1.2.1 for Python 2.4, you can download it here: http://pythonmac.org/packages/py24-fat/ -bob From stefan at feelthemachine.com Sat Jul 15 10:54:03 2006 From: stefan at feelthemachine.com (Stefan Holmer) Date: Sat, 15 Jul 2006 10:54:03 +0200 Subject: [Pythonmac-SIG] Problem with open_app Action Event In-Reply-To: References: <44B75B1B.50603@feelthemachine.com> <44B7E5E9.1010006@feelthemachine.com> <20060714191750.GA43881@uiuc.edu> <44B82576.6040908@feelthemachine.com> Message-ID: <44B8AD2B.3080308@feelthemachine.com> As far as I know, I am using Python 2.4.3. Maybe 2.3 hasn't been uninstalled? Bob Ippolito skrev: > Yes, Python 2.3 on Mac OS X 10.4 i386 is indeed broken for most things > in Carbon.*, especially Apple Events. Use Universal Python 2.4.3. > > http://pythonmac.org/packages/py24-fat/ > > -bob > > > On Jul 14, 2006, at 4:15 PM, Stefan Holmer wrote: > >> I'm now trying to use argvemulator to collect the Event. When I set >> ArgvCollector to trig on 'odoc' it gives me some odd path inside my >> .app-directory. If I modify the code for ArgvCollector and make it >> trigger on 'odoc' and 'codo' I get my the correct path for the file I'm >> trying to open, but when ArgvCollector.mainloop() is done, the whole >> program crashes without telling me why. >> >> First of all, why do I have to trig on 'codo'? Seems like all my event >> codes are reversed! Does it have something to do with different endians >> on intel and ppc? If so, are there an intel compatible version of >> argvemulator? >> >> Stefan >> >> Nicholas Riley skrev: >>> On Fri, Jul 14, 2006 at 08:43:53PM +0200, Stefan Holmer wrote: >>> >>>> I'm writing the application in Python using the MiniAEFrame module >>>> which >>>> comes with MacPython. I've built it mostly like the example test class >>>> in MiniAEFrame named _Test. >>>> >>> >>> Try using aemreceive, part of appscript >>> (http://freespace.virgin.net/hamish.sanderson/appscript.html) instead >>> of MiniAEFrame - it's a much better version. >>> >>> A script I wrote using aemreceive is here: >>> >>> >>> >>> It's extremely special-purpose, but should give you some ideas. >>> >>> There are also some examples (and documentation) included with >>> appscript. >>> >>> >> _______________________________________________ >> Pythonmac-SIG maillist - Pythonmac-SIG at python.org >> http://mail.python.org/mailman/listinfo/pythonmac-sig > > From bob at redivi.com Sat Jul 15 11:36:37 2006 From: bob at redivi.com (Bob Ippolito) Date: Sat, 15 Jul 2006 02:36:37 -0700 Subject: [Pythonmac-SIG] Problem with open_app Action Event In-Reply-To: <44B8AD2B.3080308@feelthemachine.com> References: <44B75B1B.50603@feelthemachine.com> <44B7E5E9.1010006@feelthemachine.com> <20060714191750.GA43881@uiuc.edu> <44B82576.6040908@feelthemachine.com> <44B8AD2B.3080308@feelthemachine.com> Message-ID: <49150FDD-B201-4F94-8E80-832523D2E0BC@redivi.com> You definitely DO NOT want to uninstall 2.3. The quickest way to figure out which Python installation you're using is to start python and see what it says. Perhaps you should look into it... maybe even re-install universal python 2.4.3 to make sure. -bob On Jul 15, 2006, at 1:54 AM, Stefan Holmer wrote: > As far as I know, I am using Python 2.4.3. Maybe 2.3 hasn't been > uninstalled? > > Bob Ippolito skrev: >> Yes, Python 2.3 on Mac OS X 10.4 i386 is indeed broken for most >> things in Carbon.*, especially Apple Events. Use Universal Python >> 2.4.3. >> >> http://pythonmac.org/packages/py24-fat/ >> >> -bob >> >> >> On Jul 14, 2006, at 4:15 PM, Stefan Holmer wrote: >> >>> I'm now trying to use argvemulator to collect the Event. When I set >>> ArgvCollector to trig on 'odoc' it gives me some odd path inside my >>> .app-directory. If I modify the code for ArgvCollector and make it >>> trigger on 'odoc' and 'codo' I get my the correct path for the >>> file I'm >>> trying to open, but when ArgvCollector.mainloop() is done, the whole >>> program crashes without telling me why. >>> >>> First of all, why do I have to trig on 'codo'? Seems like all my >>> event >>> codes are reversed! Does it have something to do with different >>> endians >>> on intel and ppc? If so, are there an intel compatible version of >>> argvemulator? >>> >>> Stefan >>> >>> Nicholas Riley skrev: >>>> On Fri, Jul 14, 2006 at 08:43:53PM +0200, Stefan Holmer wrote: >>>> >>>>> I'm writing the application in Python using the MiniAEFrame >>>>> module which >>>>> comes with MacPython. I've built it mostly like the example >>>>> test class >>>>> in MiniAEFrame named _Test. >>>>> >>>> >>>> Try using aemreceive, part of appscript >>>> (http://freespace.virgin.net/hamish.sanderson/appscript.html) >>>> instead >>>> of MiniAEFrame - it's a much better version. >>>> >>>> A script I wrote using aemreceive is here: >>>> >>>> >>> RetroStatus.py> >>>> >>>> It's extremely special-purpose, but should give you some ideas. >>>> >>>> There are also some examples (and documentation) included with >>>> appscript. >>>> >>>> >>> _______________________________________________ >>> Pythonmac-SIG maillist - Pythonmac-SIG at python.org >>> http://mail.python.org/mailman/listinfo/pythonmac-sig >> >> From stefan at feelthemachine.com Sat Jul 15 11:44:32 2006 From: stefan at feelthemachine.com (Stefan Holmer) Date: Sat, 15 Jul 2006 11:44:32 +0200 Subject: [Pythonmac-SIG] Problem with open_app Action Event In-Reply-To: <49150FDD-B201-4F94-8E80-832523D2E0BC@redivi.com> References: <44B75B1B.50603@feelthemachine.com> <44B7E5E9.1010006@feelthemachine.com> <20060714191750.GA43881@uiuc.edu> <44B82576.6040908@feelthemachine.com> <44B8AD2B.3080308@feelthemachine.com> <49150FDD-B201-4F94-8E80-832523D2E0BC@redivi.com> Message-ID: <44B8B900.1030806@feelthemachine.com> Ok, well, then I'm pretty sure I'm actually using 2.4.3. Bob Ippolito skrev: > You definitely DO NOT want to uninstall 2.3. > > The quickest way to figure out which Python installation you're using > is to start python and see what it says. Perhaps you should look into > it... maybe even re-install universal python 2.4.3 to make sure. > > -bob > > On Jul 15, 2006, at 1:54 AM, Stefan Holmer wrote: > >> As far as I know, I am using Python 2.4.3. Maybe 2.3 hasn't been >> uninstalled? >> >> Bob Ippolito skrev: >>> Yes, Python 2.3 on Mac OS X 10.4 i386 is indeed broken for most >>> things in Carbon.*, especially Apple Events. Use Universal Python >>> 2.4.3. >>> >>> http://pythonmac.org/packages/py24-fat/ >>> >>> -bob >>> >>> >>> On Jul 14, 2006, at 4:15 PM, Stefan Holmer wrote: >>> >>>> I'm now trying to use argvemulator to collect the Event. When I set >>>> ArgvCollector to trig on 'odoc' it gives me some odd path inside my >>>> .app-directory. If I modify the code for ArgvCollector and make it >>>> trigger on 'odoc' and 'codo' I get my the correct path for the file >>>> I'm >>>> trying to open, but when ArgvCollector.mainloop() is done, the whole >>>> program crashes without telling me why. >>>> >>>> First of all, why do I have to trig on 'codo'? Seems like all my event >>>> codes are reversed! Does it have something to do with different >>>> endians >>>> on intel and ppc? If so, are there an intel compatible version of >>>> argvemulator? >>>> >>>> Stefan >>>> >>>> Nicholas Riley skrev: >>>>> On Fri, Jul 14, 2006 at 08:43:53PM +0200, Stefan Holmer wrote: >>>>> >>>>>> I'm writing the application in Python using the MiniAEFrame >>>>>> module which >>>>>> comes with MacPython. I've built it mostly like the example test >>>>>> class >>>>>> in MiniAEFrame named _Test. >>>>>> >>>>> >>>>> Try using aemreceive, part of appscript >>>>> (http://freespace.virgin.net/hamish.sanderson/appscript.html) instead >>>>> of MiniAEFrame - it's a much better version. >>>>> >>>>> A script I wrote using aemreceive is here: >>>>> >>>>> >>>>> >>>>> >>>>> It's extremely special-purpose, but should give you some ideas. >>>>> >>>>> There are also some examples (and documentation) included with >>>>> appscript. >>>>> >>>>> >>>> _______________________________________________ >>>> Pythonmac-SIG maillist - Pythonmac-SIG at python.org >>>> http://mail.python.org/mailman/listinfo/pythonmac-sig >>> >>> > > From hengist.podd at virgin.net Sat Jul 15 13:42:16 2006 From: hengist.podd at virgin.net (has) Date: Sat, 15 Jul 2006 12:42:16 +0100 Subject: [Pythonmac-SIG] Problem with open_app Action Event In-Reply-To: References: Message-ID: <65C130D3-7EAC-4106-A802-37332B74B9FF@virgin.net> Stefan Holmer wrote: > Ok, well, then I'm pretty sure I'm actually using 2.4.3. I sent Ronald a patch for argvemulator in May. I believe it's in the 2.5 beta; I don't know if it's been applied to any 2.4.x releases yet; you'd need to ask. All the other AE modules except Carbon.AE are completely broken on Intel due to endianness issues (and some on PPC too due to other bugs), but are unlikely to be fixed as they're all crude and crusty and obsoleted by appscript/aem/aemreceive anyway. If you want to do basic AE handling, use aemreceive. The Appscript Installer dmg includes an Appscript Resources pkg; this will install the aemreceive docs and tutorial at /Applications/Utilities/appscript/ Documentation/aemreceive. has -- http://freespace.virgin.net/hamish.sanderson/ From ronaldoussoren at mac.com Sat Jul 15 17:15:15 2006 From: ronaldoussoren at mac.com (Ronald Oussoren) Date: Sat, 15 Jul 2006 17:15:15 +0200 Subject: [Pythonmac-SIG] Problem with open_app Action Event In-Reply-To: <65C130D3-7EAC-4106-A802-37332B74B9FF@virgin.net> References: <65C130D3-7EAC-4106-A802-37332B74B9FF@virgin.net> Message-ID: On Jul 15, 2006, at 1:42 PM, has wrote: > Stefan Holmer wrote: > >> Ok, well, then I'm pretty sure I'm actually using 2.4.3. > > I sent Ronald a patch for argvemulator in May. I believe it's in the > 2.5 beta; I don't know if it's been applied to any 2.4.x releases > yet; you'd need to ask. It's not in any 2.4 release, it's not even in the 2.4-universal tree yet. I don't have time to work on that tree at the moment, and would prefer to merge that tree into the 2.4.x branch of the official repository (as much is possible, some changes aren't acceptable for the 2.4.x branch). > > All the other AE modules except Carbon.AE are completely broken on > Intel due to endianness issues (and some on PPC too due to other > bugs), but are unlikely to be fixed as they're all crude and crusty > and obsoleted by appscript/aem/aemreceive anyway. Right, don't use aepack, aetools and aetypes. Those modules are broken on Intel and crufty enough that I don't intent to spent time on understanding them. Too be blunt, for Python 2.6 we should start some effort to remove cruft from the mac part of the standard library and that probably includes more than just apple-event support. Ronald From stefan at feelthemachine.com Sat Jul 15 18:29:09 2006 From: stefan at feelthemachine.com (Stefan Holmer) Date: Sat, 15 Jul 2006 18:29:09 +0200 Subject: [Pythonmac-SIG] Problem with open_app Action Event In-Reply-To: <65C130D3-7EAC-4106-A802-37332B74B9FF@virgin.net> References: <65C130D3-7EAC-4106-A802-37332B74B9FF@virgin.net> Message-ID: <44B917D5.1040506@feelthemachine.com> So, I've rewritten using aemreceive.sfba instead, though I've still got the problem where I'm not caching an event when I'm trying to "open with..." when the program is closed. If the program has already been started, this works fine. This is the line which installs the eventhandler: installeventhandler(open_app, 'aevtodoc', ('----', 'AliasList', ArgListOf(kAE.typeAlias))) and the handler looks like this: def open_app(AliasList): EasyDialogs.Message("open_app") Do I have to look for another event, or what's the problem? has skrev: > Stefan Holmer wrote: > > >> Ok, well, then I'm pretty sure I'm actually using 2.4.3. >> > > I sent Ronald a patch for argvemulator in May. I believe it's in the > 2.5 beta; I don't know if it's been applied to any 2.4.x releases > yet; you'd need to ask. > > All the other AE modules except Carbon.AE are completely broken on > Intel due to endianness issues (and some on PPC too due to other > bugs), but are unlikely to be fixed as they're all crude and crusty > and obsoleted by appscript/aem/aemreceive anyway. > > If you want to do basic AE handling, use aemreceive. The Appscript > Installer dmg includes an Appscript Resources pkg; this will install > the aemreceive docs and tutorial at /Applications/Utilities/appscript/ > Documentation/aemreceive. > > has > From bob at redivi.com Sat Jul 15 18:31:46 2006 From: bob at redivi.com (Bob Ippolito) Date: Sat, 15 Jul 2006 09:31:46 -0700 Subject: [Pythonmac-SIG] Problem with open_app Action Event In-Reply-To: <65C130D3-7EAC-4106-A802-37332B74B9FF@virgin.net> References: <65C130D3-7EAC-4106-A802-37332B74B9FF@virgin.net> Message-ID: <8D704A05-1F8C-4BEE-8958-C1A16B7139C5@redivi.com> On Jul 15, 2006, at 4:42 AM, has wrote: > Stefan Holmer wrote: > >> Ok, well, then I'm pretty sure I'm actually using 2.4.3. > > I sent Ronald a patch for argvemulator in May. I believe it's in the > 2.5 beta; I don't know if it's been applied to any 2.4.x releases > yet; you'd need to ask. Where is this patch? You should put it in sourceforge if you ever want to see it in Python. Emails are terribly easy to lose if you can't deal with them immediately, and Ronald isn't the only person who can deal with these things. Personally I'm interested in getting a working argvemulator into py2app ASAP, and am too lazy to write it myself. -bob From ronaldoussoren at mac.com Sat Jul 15 18:52:48 2006 From: ronaldoussoren at mac.com (Ronald Oussoren) Date: Sat, 15 Jul 2006 18:52:48 +0200 Subject: [Pythonmac-SIG] Problem with open_app Action Event In-Reply-To: <8D704A05-1F8C-4BEE-8958-C1A16B7139C5@redivi.com> References: <65C130D3-7EAC-4106-A802-37332B74B9FF@virgin.net> <8D704A05-1F8C-4BEE-8958-C1A16B7139C5@redivi.com> Message-ID: On Jul 15, 2006, at 6:31 PM, Bob Ippolito wrote: > > On Jul 15, 2006, at 4:42 AM, has wrote: > >> Stefan Holmer wrote: >> >>> Ok, well, then I'm pretty sure I'm actually using 2.4.3. >> >> I sent Ronald a patch for argvemulator in May. I believe it's in the >> 2.5 beta; I don't know if it's been applied to any 2.4.x releases >> yet; you'd need to ask. > > Where is this patch? You should put it in sourceforge if you ever > want to see it in Python. I should have been slightly more clear, the patch is in the python repository in both the trunk and 2.4 maintainance, it is not in the universal tree. I don't really intent to do any more work on that tree, the universal patches for 2.5 need to be backported to 2.4-main instead. I've mostly done that, but haven't checked those changes in yet. Getting those in is a good goal for this weekend. BTW. I ended up applying a slightly different patch to avoid backward incompatibilities (the timeout argument). > Emails are terribly easy to lose if you > can't deal with them immediately, and Ronald isn't the only person > who can deal with these things. Tell me about it, it took me considerable time to recover the e-mail with has' original patch because he didn't upload it as a patch to the SF tracker. > > Personally I'm interested in getting a working argvemulator into > py2app ASAP, and am too lazy to write it myself. Get the one in python2.5, that definitely works. It uses an eventloop from the OS7 era, but that's just because I didn't want to research how to do a CarbonEvt loop that times out after a second. Ronald From charles.hartman at conncoll.edu Sat Jul 15 18:47:59 2006 From: charles.hartman at conncoll.edu (Charles Hartman) Date: Sat, 15 Jul 2006 12:47:59 -0400 Subject: [Pythonmac-SIG] how big is fat? Message-ID: <4B42E985-5B01-4C84-BC98-989D150E7056@conncoll.edu> I have an app from a year ago that needed one tweak. When I build it on a PowerBook G4 with Python 2.4.1 (Mar 23 2005 build) and wxPython 2.6.3.0, using --strip in the 'python setup.py py2app' command, I get an executable of 16Mb. (For some reason I don't understand, this is already 5Mb bigger than the executable I built a few months ago.) When I build it on an Intel iMac with Python 2.4.3 (Apr 7 2006 buld) and wxPython 2.6.3.2rc1, the app is fifty megabytes. Two really simple questions: 1. Get Info says the executable built on the Intel Mac, with Universal versions of Python and wxPython, is an "Application (PowerPC)" -- why doesn't it say "Application (Universal)"? 2. What's behind the bloat? Is it simply that it is a Universal app, though Get Info doesn't recognize it as that? And is there anything to be done about it? Charles Hartman From hengist.podd at virgin.net Sat Jul 15 19:16:27 2006 From: hengist.podd at virgin.net (has) Date: Sat, 15 Jul 2006 18:16:27 +0100 Subject: [Pythonmac-SIG] Problem with open_app Action Event In-Reply-To: <44B917D5.1040506@feelthemachine.com> References: <65C130D3-7EAC-4106-A802-37332B74B9FF@virgin.net> <44B917D5.1040506@feelthemachine.com> Message-ID: Stefan Holmer wrote: > So, I've rewritten using aemreceive.sfba instead, though I've still > got the problem where I'm not caching an event when I'm trying to > "open with..." when the program is closed. I think LaunchServices can sometimes be a bit sluggish registering new apps. Also, have you checked you've set up any file associations (CFBundleDocumentTypes) in its Info.plist correctly? HTH has -- http://freespace.virgin.net/hamish.sanderson/ From bob at redivi.com Sat Jul 15 19:21:39 2006 From: bob at redivi.com (Bob Ippolito) Date: Sat, 15 Jul 2006 10:21:39 -0700 Subject: [Pythonmac-SIG] how big is fat? In-Reply-To: <4B42E985-5B01-4C84-BC98-989D150E7056@conncoll.edu> References: <4B42E985-5B01-4C84-BC98-989D150E7056@conncoll.edu> Message-ID: <62B453F4-8525-4B3B-8D35-4A421D062532@redivi.com> On Jul 15, 2006, at 9:47 AM, Charles Hartman wrote: > I have an app from a year ago that needed one tweak. When I build it > on a PowerBook G4 with Python 2.4.1 (Mar 23 2005 build) and wxPython > 2.6.3.0, using --strip in the 'python setup.py py2app' command, I get > an executable of 16Mb. (For some reason I don't understand, this is > already 5Mb bigger than the executable I built a few months ago.) > > When I build it on an Intel iMac with Python 2.4.3 (Apr 7 2006 buld) > and wxPython 2.6.3.2rc1, the app is fifty megabytes. > > Two really simple questions: > > 1. Get Info says the executable built on the Intel Mac, with > Universal versions of Python and wxPython, is an "Application > (PowerPC)" -- why doesn't it say "Application (Universal)"? > > 2. What's behind the bloat? Is it simply that it is a Universal app, > though Get Info doesn't recognize it as that? And is there anything > to be done about it? You must not be using py2app 0.3. I can't help you unless you are using the latest version. There are several known bugs in all other versions of py2app that could cause both of these problems. See this message for installation instructions. http://mail.python.org/pipermail/pythonmac-sig/2006-July/017766.html -bob From stefan at feelthemachine.com Sat Jul 15 19:44:26 2006 From: stefan at feelthemachine.com (Stefan Holmer) Date: Sat, 15 Jul 2006 19:44:26 +0200 Subject: [Pythonmac-SIG] Problem with open_app Action Event In-Reply-To: References: <65C130D3-7EAC-4106-A802-37332B74B9FF@virgin.net> <44B917D5.1040506@feelthemachine.com> Message-ID: <44B9297A.2040404@feelthemachine.com> The icon does highlight when I drag a jpg-file over it. And it works fine just dragging a jpg-file to the dock-icon when the program has been started, but if the program has not been started it doesn't work. This is really bugging me, can't understand what makes the difference... has skrev: > Stefan Holmer wrote: > > >> So, I've rewritten using aemreceive.sfba instead, though I've still >> got the problem where I'm not caching an event when I'm trying to >> "open with..." when the program is closed. >> > > I think LaunchServices can sometimes be a bit sluggish registering > new apps. Also, have you checked you've set up any file associations > (CFBundleDocumentTypes) in its Info.plist correctly? > > HTH > > has > From charles.hartman at conncoll.edu Sat Jul 15 19:48:58 2006 From: charles.hartman at conncoll.edu (Charles Hartman) Date: Sat, 15 Jul 2006 13:48:58 -0400 Subject: [Pythonmac-SIG] how big is fat? In-Reply-To: <62B453F4-8525-4B3B-8D35-4A421D062532@redivi.com> References: <4B42E985-5B01-4C84-BC98-989D150E7056@conncoll.edu> <62B453F4-8525-4B3B-8D35-4A421D062532@redivi.com> Message-ID: <939004B7-8A18-4467-986A-94881971AE25@conncoll.edu> Absolutely right -- thanks, Bob! That brings it down to 16Mb. By the way, Get Info still reports it as a PowerPC app (when built with Universal Python and wxPython and the new py2app, on an Intel iMac). How come? Should I worry about that? Might it be a good idea to remove the reference link from undefined.org/python to the older py2app? I had forgotten the twists & turns, and that's where I went to check that I had the latest py2app. Charles Hartman On Jul 15, 2006, at 1:21 PM, Bob Ippolito wrote: > > On Jul 15, 2006, at 9:47 AM, Charles Hartman wrote: > >> I have an app from a year ago that needed one tweak. When I build it >> on a PowerBook G4 with Python 2.4.1 (Mar 23 2005 build) and wxPython >> 2.6.3.0, using --strip in the 'python setup.py py2app' command, I get >> an executable of 16Mb. (For some reason I don't understand, this is >> already 5Mb bigger than the executable I built a few months ago.) >> >> When I build it on an Intel iMac with Python 2.4.3 (Apr 7 2006 buld) >> and wxPython 2.6.3.2rc1, the app is fifty megabytes. >> >> Two really simple questions: >> >> 1. Get Info says the executable built on the Intel Mac, with >> Universal versions of Python and wxPython, is an "Application >> (PowerPC)" -- why doesn't it say "Application (Universal)"? >> >> 2. What's behind the bloat? Is it simply that it is a Universal app, >> though Get Info doesn't recognize it as that? And is there anything >> to be done about it? > > You must not be using py2app 0.3. I can't help you unless you are > using the latest version. There are several known bugs in all other > versions of py2app that could cause both of these problems. > > See this message for installation instructions. > http://mail.python.org/pipermail/pythonmac-sig/2006-July/017766.html > > -bob > From bob at redivi.com Sat Jul 15 19:58:54 2006 From: bob at redivi.com (Bob Ippolito) Date: Sat, 15 Jul 2006 10:58:54 -0700 Subject: [Pythonmac-SIG] how big is fat? In-Reply-To: <939004B7-8A18-4467-986A-94881971AE25@conncoll.edu> References: <4B42E985-5B01-4C84-BC98-989D150E7056@conncoll.edu> <62B453F4-8525-4B3B-8D35-4A421D062532@redivi.com> <939004B7-8A18-4467-986A-94881971AE25@conncoll.edu> Message-ID: On Jul 15, 2006, at 10:48 AM, Charles Hartman wrote: > Absolutely right -- thanks, Bob! That brings it down to 16Mb. By > the way, Get Info still reports it as a PowerPC app (when built > with Universal Python and wxPython and the new py2app, on an Intel > iMac). How come? Should I worry about that? Says universal here, don't know what the problem is with your app. It does strangely enough default to open using Rosetta though, no idea why it's doing that. > Might it be a good idea to remove the reference link from > undefined.org/python to the older py2app? I had forgotten the > twists & turns, and that's where I went to check that I had the > latest py2app. I'll get around to that someday. -bob From bob at redivi.com Sat Jul 15 20:05:12 2006 From: bob at redivi.com (Bob Ippolito) Date: Sat, 15 Jul 2006 11:05:12 -0700 Subject: [Pythonmac-SIG] how big is fat? In-Reply-To: References: <4B42E985-5B01-4C84-BC98-989D150E7056@conncoll.edu> <62B453F4-8525-4B3B-8D35-4A421D062532@redivi.com> <939004B7-8A18-4467-986A-94881971AE25@conncoll.edu> Message-ID: <3990E5B7-F73D-4A7A-B69C-B48F056EC013@redivi.com> On Jul 15, 2006, at 10:58 AM, Bob Ippolito wrote: > > On Jul 15, 2006, at 10:48 AM, Charles Hartman wrote: > >> Absolutely right -- thanks, Bob! That brings it down to 16Mb. By >> the way, Get Info still reports it as a PowerPC app (when built >> with Universal Python and wxPython and the new py2app, on an Intel >> iMac). How come? Should I worry about that? > > Says universal here, don't know what the problem is with your app. It > does strangely enough default to open using Rosetta though, no idea > why it's doing that. Looks like I had set LSPrefersPPC to True by default. If you want apps to run natively by default you can set that to False in the plist, patch your py2app, or wait for the next release. -bob From charles.hartman at conncoll.edu Sat Jul 15 22:41:25 2006 From: charles.hartman at conncoll.edu (Charles Hartman) Date: Sat, 15 Jul 2006 16:41:25 -0400 Subject: [Pythonmac-SIG] how big is fat? In-Reply-To: <3990E5B7-F73D-4A7A-B69C-B48F056EC013@redivi.com> References: <4B42E985-5B01-4C84-BC98-989D150E7056@conncoll.edu> <62B453F4-8525-4B3B-8D35-4A421D062532@redivi.com> <939004B7-8A18-4467-986A-94881971AE25@conncoll.edu> <3990E5B7-F73D-4A7A-B69C-B48F056EC013@redivi.com> Message-ID: On Jul 15, 2006, at 2:05 PM, Bob Ippolito wrote: >> Says universal here, don't know what the problem is with your app. It >> does strangely enough default to open using Rosetta though, no idea >> why it's doing that. > > Looks like I had set LSPrefersPPC to True by default. If you want > apps to run natively by default you can set that to False in the > plist, patch your py2app, or wait for the next release. Great -- I put this into the plist = dict( . . . ) in my setup.py, and that makes the app show up Universal in Get Info. Peculiarly, though, in Get Info the option "Open using Rosetta" is checked by default. When I uncheck that, I do seem to get a speed gain that might indicate native operation. Is there another way of doing this -- I can't see anything else in Info.plist that looks right. Or is it some system setting I've got that's weird? -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/pythonmac-sig/attachments/20060715/bb0b6496/attachment.htm From bob at redivi.com Sat Jul 15 22:46:46 2006 From: bob at redivi.com (Bob Ippolito) Date: Sat, 15 Jul 2006 13:46:46 -0700 Subject: [Pythonmac-SIG] how big is fat? In-Reply-To: References: <4B42E985-5B01-4C84-BC98-989D150E7056@conncoll.edu> <62B453F4-8525-4B3B-8D35-4A421D062532@redivi.com> <939004B7-8A18-4467-986A-94881971AE25@conncoll.edu> <3990E5B7-F73D-4A7A-B69C-B48F056EC013@redivi.com> Message-ID: On Jul 15, 2006, at 1:41 PM, Charles Hartman wrote: > > On Jul 15, 2006, at 2:05 PM, Bob Ippolito wrote: > >>> Says universal here, don't know what the problem is with your >>> app. It >>> does strangely enough default to open using Rosetta though, no idea >>> why it's doing that. >> >> Looks like I had set LSPrefersPPC to True by default. If you want >> apps to run natively by default you can set that to False in the >> plist, patch your py2app, or wait for the next release. > > Great -- I put this into the plist = dict( . . . ) in my setup.py, > and that makes the app show up Universal in Get Info. Peculiarly, > though, in Get Info the option "Open using Rosetta" is checked by > default. When I uncheck that, I do seem to get a speed gain that > might indicate native operation. Is there another way of doing this > -- I can't see anything else in Info.plist that looks right. Or is > it some system setting I've got that's weird? Either it's cached, or it's a bug in OS X. Either seems likely. -bob -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/pythonmac-sig/attachments/20060715/3cd48aed/attachment.html From Joel.Levine at Dartmouth.EDU Sat Jul 15 07:27:01 2006 From: Joel.Levine at Dartmouth.EDU (Joel Levine) Date: 15 Jul 2006 01:27:01 EDT Subject: [Pythonmac-SIG] Installing NumPy Message-ID: <65078409@newdancer.Dartmouth.EDU> A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 739 bytes Desc: not available Url : http://mail.python.org/pipermail/pythonmac-sig/attachments/20060715/3c4a8883/attachment.bin From hraban at fiee.net Sun Jul 16 13:28:45 2006 From: hraban at fiee.net (Henning Hraban Ramm) Date: Sun, 16 Jul 2006 13:28:45 +0200 Subject: [Pythonmac-SIG] detecting mounted disks Message-ID: How can I detect if an entry in MacOSX's /Volumes (or more generally: any mount point in a UNIX-like OS) is... - a local harddisk - a network volume - a CD/DVD-ROM - something other (USB stick...) ? I guess I could get some info from 'mount', but isn't there already a Python function? o.path's ismount and isdir aren't enough. Greetlings from Lake Constance! Hraban --- http://www.fiee.net http://www.cacert.org (I'm an assurer) From kw at kevin-walzer.com Sun Jul 16 16:30:52 2006 From: kw at kevin-walzer.com (Kevin Walzer) Date: Sun, 16 Jul 2006 10:30:52 -0400 Subject: [Pythonmac-SIG] Installing NumPy In-Reply-To: <65078409@newdancer.Dartmouth.EDU> References: <65078409@newdancer.Dartmouth.EDU> Message-ID: <44BA4D9C.2010500@kevin-walzer.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Joel Levine wrote: > I am trying to get up and running under Mac10.4 with the Intel chip. > > My old code runs on my 10.3 machine. On this machine, it can not find > Numeric. > > That's reasonable: It isn't there. > > If I copy the contents of my old Numeric folder to a proper location, > Python simply dies when I try to import. It will be obvious that I'm not > experienced with Unix: I'm guessing that the old folder contained > compiled code that doesn't belong on that machine. > > So -- I downloaded NumPy. I've put it in a folder of its own, for > safety. The instructions tell me to install with the command: > > python setup.py install > > But I'm running into a permission problem. I get > > error: could not create 'build': Permission denied > > > Any suggestion? > Try installing the universal build of Python 2.4.3 and rebuilding numpy. Simply moving binaries from 10.3 PPC to 10.4 Mactel won't work; they're not compatible. If you want to simply build numpy on your new machine with the Python installed there, try adding a "sudo" to python setup.py install; that should solve the permissions issue. - -- Kevin Walzer Poetic Code http://www.kevin-walzer.com -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.1 (Darwin) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFEuk2crTC5hIgjqTMRAnsVAJwPN1Q6uiNZBI1KWEwX3tre647KTgCgiMJZ YuZiUaXRBJzpd8d0iOzOHAA= =4vha -----END PGP SIGNATURE----- From bob at redivi.com Sun Jul 16 19:06:40 2006 From: bob at redivi.com (Bob Ippolito) Date: Sun, 16 Jul 2006 10:06:40 -0700 Subject: [Pythonmac-SIG] detecting mounted disks In-Reply-To: References: Message-ID: On Jul 16, 2006, at 4:28 AM, Henning Hraban Ramm wrote: > How can I detect if an entry in MacOSX's /Volumes (or more generally: > any mount point in a UNIX-like OS) is... > - a local harddisk > - a network volume > - a CD/DVD-ROM > - something other (USB stick...) > ? > > I guess I could get some info from 'mount', but isn't there already a > Python function? > o.path's ismount and isdir aren't enough. You'd probably have to get that information from IOKit, which isn't wrapped by Python at all. -bob From hraban at fiee.net Sun Jul 16 19:46:18 2006 From: hraban at fiee.net (Henning Hraban Ramm) Date: Sun, 16 Jul 2006 19:46:18 +0200 Subject: [Pythonmac-SIG] detecting mounted disks In-Reply-To: References: Message-ID: <6184F42E-50B9-41FC-96E5-50A76A8C0B80@fiee.net> Am 2006-07-16 um 19:06 schrieb Bob Ippolito: > On Jul 16, 2006, at 4:28 AM, Henning Hraban Ramm wrote: > >> How can I detect if an entry in MacOSX's /Volumes (or more generally: >> any mount point in a UNIX-like OS) is... >> - a local harddisk >> - a network volume >> - a CD/DVD-ROM >> - something other (USB stick...) >> ? >> >> I guess I could get some info from 'mount', but isn't there already a >> Python function? >> o.path's ismount and isdir aren't enough. > > You'd probably have to get that information from IOKit, which isn't > wrapped by Python at all. For now I'm content with 'mount': import subprocess, tempfile, re, pprint tf = tempfile.TemporaryFile() subprocess.Popen('/sbin/mount', stdout=tf) tf.seek(0) mountlines = tf.readlines() tf.close() reMountLine = re.compile('(.+) on (/[^\s]*)( \((.+)\))?', re.I) mounts = [] for ml in mountlines: m = reMountLine.match(ml) if not m: next g = m.groups() type = 'unknown' modes = g[3] if modes: modes = modes.split(', ') if ((g[0].startswith('/dev/')) and ('local' in modes)): type = 'hd' elif g[1] == '/dev': type = 'dev' elif g[0].startswith('automount'): type = 'automount' if 'nodev' in modes: type = 'changeable' if 'read-only' in modes: type = 'cd' mounts.append([g[1], g[0], modes, type]) pp = pprint.PrettyPrinter() pp.pprint(mounts) Greetlings from Lake Constance! Hraban --- http://www.fiee.net http://www.cacert.org (I'm an assurer) From josh.p.marshall at gmail.com Mon Jul 17 02:22:07 2006 From: josh.p.marshall at gmail.com (Josh Marshall) Date: Mon, 17 Jul 2006 10:22:07 +1000 Subject: [Pythonmac-SIG] Packaging numpy with py2app Message-ID: <660C6421-8C71-4B4D-A2CC-33C3FF089DF9@gmail.com> Back in December last year, I was building a PyObjC application that embedded numpy (scipy_core at the time), scipy and matplotlib. I ran into a few issues doing so, some of which were resolved. One was the inability for scipy to run from a zipped site-packages. I worked around this by expanding the embedded site-packages.zip into a site- packages directory in the same location. For reference, the thread can be found at: http://www.scipy.net/pipermail/scipy-dev/2005-December/004551.html Come a few months later, I have needed to update to the latest version of numpy (and therefore scipy and matplotlib). I have not yet updated to the universal build of Python, still running 2.4.1, although I will do so if it is known to fix any issues. (I don't have too much time at the moment, and building the latest versions of numpy and matplotlib for a universal build scares me). I managed to get it working again, which required: 1) Setting packages=['matplotlib','numpy'] in setup.py's options for py2app. 2) Modifying the py2app/apptemplate/lib/site.py file to include 'sys.path.append(_parent + '/site-packages')' before the same line with .zip appended to the file name. 3) Adding setup_options['options']['py2app']['includes'].extend (['pytz.zoneinfo.UTC']) to the setup.py, this is required by matplotlib. I believe (2) is a bug in py2app (I am running 0.3.1). Packages included using 'packages=' are not added to site-packages.zip, but rather are in their own site-packages directory. I am not sure whether this is the intended behaviour or a bug, but it is good for me, since numpy and matplotlib won't run when compressed. Now, it seems I am doomed to continue to have to find work-arounds to get numpy and matplotlib working in a standalone .app. Is there a chance we can come up with a py2app recipe for numpy, matplotlib and scipy? What other alternatives are there? Regards, Josh From bob at redivi.com Mon Jul 17 02:46:06 2006 From: bob at redivi.com (Bob Ippolito) Date: Sun, 16 Jul 2006 17:46:06 -0700 Subject: [Pythonmac-SIG] Packaging numpy with py2app In-Reply-To: <660C6421-8C71-4B4D-A2CC-33C3FF089DF9@gmail.com> References: <660C6421-8C71-4B4D-A2CC-33C3FF089DF9@gmail.com> Message-ID: On Jul 16, 2006, at 5:22 PM, Josh Marshall wrote: > Back in December last year, I was building a PyObjC application that > embedded numpy (scipy_core at the time), scipy and matplotlib. I ran > into a few issues doing so, some of which were resolved. One was the > inability for scipy to run from a zipped site-packages. I worked > around this by expanding the embedded site-packages.zip into a site- > packages directory in the same location. For reference, the thread > can be found at: > http://www.scipy.net/pipermail/scipy-dev/2005-December/004551.html > > Come a few months later, I have needed to update to the latest > version of numpy (and therefore scipy and matplotlib). I have not yet > updated to the universal build of Python, still running 2.4.1, > although I will do so if it is known to fix any issues. (I don't have > too much time at the moment, and building the latest versions of > numpy and matplotlib for a universal build scares me). If you're still using 2.4.1 you're going to want to add LSPrefersPPC=True to the plist. Otherwise your app will not run on i386, because it will not know to use Rosetta. > I managed to get it working again, which required: > 1) Setting packages=['matplotlib','numpy'] in setup.py's options for > py2app. That could be handled with recipes, or with eggs when py2app grows support for that. Recipes or workarounds are the only way until then. > 2) Modifying the py2app/apptemplate/lib/site.py file to include > 'sys.path.append(_parent + '/site-packages')' before the same line > with .zip appended to the file name. That's a bug, but not the right fix. Trunk is fixed. > 3) Adding setup_options['options']['py2app']['includes'].extend > (['pytz.zoneinfo.UTC']) to the setup.py, this is required by > matplotlib. That should be part of a matplotlib recipe. > Now, it seems I am doomed to continue to have to find work-arounds to > get numpy and matplotlib working in a standalone .app. Is there a > chance we can come up with a py2app recipe for numpy, matplotlib and > scipy? What other alternatives are there? Sure, someone can write the recipes and send me a patch. I don't currently use matplotlib, numpy, or scipy nor do I have an example I can test with so I'm not going to do it. -bob From cwmoad at gmail.com Mon Jul 17 04:18:44 2006 From: cwmoad at gmail.com (Charlie Moad) Date: Sun, 16 Jul 2006 22:18:44 -0400 Subject: [Pythonmac-SIG] matplotlib fat binary Message-ID: <6382066a0607161918j19f0fa9cha1aa2a34796e98e0@mail.gmail.com> Could you please update the py24-fat listing with the latest matplotlib build? https://sourceforge.net/project/showfiles.php?group_id=80706&package_id=82474&release_id=431354 Thanks, Charlie From M.Laloux at mrw.wallonie.be Mon Jul 17 12:38:01 2006 From: M.Laloux at mrw.wallonie.be (LALOUX Martin) Date: Mon, 17 Jul 2006 12:38:01 +0200 Subject: [Pythonmac-SIG] Installing NumPy Message-ID: <6.1.2.0.0.20060717123448.02d95e30@pop.promibra.intra.mrw.wallonie.be> why not try ? http://www.scipy.org/Installing_SciPy/Mac_OS_X?highlight=%28%28----%28-%2A%29%28%5Cr%29%3F%5Cn%29%28.%2A%29CategoryInstallation%5Cb%29 From Chris.Barker at noaa.gov Mon Jul 17 18:59:55 2006 From: Chris.Barker at noaa.gov (Christopher Barker) Date: Mon, 17 Jul 2006 09:59:55 -0700 Subject: [Pythonmac-SIG] Installing NumPy In-Reply-To: <6.1.2.0.0.20060717123448.02d95e30@pop.promibra.intra.mrw.wallonie.be> References: <6.1.2.0.0.20060717123448.02d95e30@pop.promibra.intra.mrw.wallonie.be> Message-ID: <44BBC20B.1010203@noaa.gov> LALOUX Martin wrote: > why not try ? or even better: http://www.pythonmac.org/packages/py24-fat/index.html numpy 0.9.8 is right there. -CHB -- Christopher Barker, Ph.D. Oceanographer NOAA/OR&R/HAZMAT (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 Mon Jul 17 19:29:28 2006 From: Chris.Barker at noaa.gov (Christopher Barker) Date: Mon, 17 Jul 2006 10:29:28 -0700 Subject: [Pythonmac-SIG] matplotlib fat binary In-Reply-To: <6382066a0607161918j19f0fa9cha1aa2a34796e98e0@mail.gmail.com> References: <6382066a0607161918j19f0fa9cha1aa2a34796e98e0@mail.gmail.com> Message-ID: <44BBC8F8.70001@noaa.gov> Charlie Moad wrote: Thanks, Charlie, you beat me to it. With a quick test, It looks like it works with all the stuff on pythonmac.org (tk, wx, numpy, Numeric, and a numarray I'm about to add there) Bob: when you get a chance, upload this baby to pythonmac.org. I'm about to send you a numarray package. We do need to make sure it stays compatible with all the other stuff at the pythonmac site -- mostly that means updating numpy and MPL together. -Chris -- Christopher Barker, Ph.D. Oceanographer NOAA/OR&R/HAZMAT (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 Mon Jul 17 19:47:45 2006 From: Chris.Barker at noaa.gov (Christopher Barker) Date: Mon, 17 Jul 2006 10:47:45 -0700 Subject: [Pythonmac-SIG] how big is fat? In-Reply-To: <62B453F4-8525-4B3B-8D35-4A421D062532@redivi.com> References: <4B42E985-5B01-4C84-BC98-989D150E7056@conncoll.edu> <62B453F4-8525-4B3B-8D35-4A421D062532@redivi.com> Message-ID: <44BBCD41.2040406@noaa.gov> Bob Ippolito wrote: > You must not be using py2app 0.3. I can't help you unless you are > using the latest version. > See this message for installation instructions. > http://mail.python.org/pipermail/pythonmac-sig/2006-July/017766.html There is a package for Py2App 0.2.5 on pythonmac.org. Perhaps that should be removed, and ideally, replaced with the latest version. thanks, -Chris -- Christopher Barker, Ph.D. Oceanographer NOAA/OR&R/HAZMAT (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 Mon Jul 17 19:52:30 2006 From: Chris.Barker at noaa.gov (Christopher Barker) Date: Mon, 17 Jul 2006 10:52:30 -0700 Subject: [Pythonmac-SIG] how big is fat? In-Reply-To: <44BBCD41.2040406@noaa.gov> References: <4B42E985-5B01-4C84-BC98-989D150E7056@conncoll.edu> <62B453F4-8525-4B3B-8D35-4A421D062532@redivi.com> <44BBCD41.2040406@noaa.gov> Message-ID: <44BBCE5E.8000700@noaa.gov> And by the way, Is there a reason not to have a setuptools mpgk on pythonmac.org? -Chris -- Christopher Barker, Ph.D. Oceanographer NOAA/OR&R/HAZMAT (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 josh.p.marshall at gmail.com Mon Jul 17 22:53:53 2006 From: josh.p.marshall at gmail.com (Josh Marshall) Date: Tue, 18 Jul 2006 06:53:53 +1000 Subject: [Pythonmac-SIG] Memory errors implementing an NSCell to show colors in an NSTableView Message-ID: I have been trying to get an application using PyObjC to display colors in an NSTableView. In my searching around, it seems the consensus is "NSColorWell isn't an NSCell, create your own subclass of NSCell which just shows the color." So, with no further information, I tried this with an NSCell subclass: class MyColorCell(NSCell): currentColor = objc.ivar('currentColor') def setObjectValue_(self, objectValue): self.currentColor = objectValue def drawInteriorWithFrame_inView_(self, cellFrame, controlView): if self.currentColor is not None: self.currentColor.drawSwatchInRect_(cellFrame) and in my app delegate I have: class ColorCellExampleAppDelegate(NibClassBuilder.AutoBaseClass): colors = objc.ivar('colors') # array containing created model objects colorArrayController = objc.ivar('colorArrayController') # bound so we can use addObject_() newColorWell = objc.ivar('newColorWell') colorTableColumn = objc.ivar('colorTableColumn') # use to set the data cell. def applicationDidFinishLaunching_(self, notification): self.colorCell = MyColorCell.alloc().init() self.colorTableColumn.setDataCell_(self.colorCell) def addNewColor_(self, sender): # bound to add button newColor = MyModelColorValue.alloc().initWithColor_ (self.newColorWell.color()) self.colorArrayController.addObject_(newColor) The model object definition is: class MyModelColorValue(NSObject): color = objc.ivar('color') def initWithColor_(self, color): self.color = color.copy() return self The problem comes once I try to click on the colors in the list, the program just barfs. It looks like an object is getting freed where it shouldn't. I'm getting either objc: FREED(id): message isKindOfClass: sent to freed object=0x11cd510 or just a plain "Bus error" before it dies. Looking at the stack trace, the first few lines are: 0 <<00000000>> 0xfffeff18 objc_msgSend_rtp + 24 1 com.apple.AppKit 0x93905594 -[NSValueBinder displayValueForObjectValue:] + 204 2 com.apple.AppKit 0x93904b7c -[NSValueBinder _adjustObject:mode:observedController:observedKeyPath:context:editableSt ate:adjustState:] + 968 3 com.apple.AppKit 0x9392fd04 -[NSValueBinder updateTableColumnDataCell:forDisplayAtIndex:] + 140 4 com.apple.AppKit 0x939304d0 -[NSTextValueBinder updateTableColumnDataCell:forDisplayAtIndex:] + 88 5 com.apple.AppKit 0x9392fc5c -[_NSBindingAdaptor tableColumn:willDisplayCell:row:] + 108 6 com.apple.AppKit 0x9378d7c4 -[NSTableView _sendDelegateWillDisplayCell:forColumn:row:] + 88 7 com.apple.AppKit 0x9378d204 -[NSTableView _drawContentsAtRow:column:clipRect:] + 396 8 com.apple.AppKit 0x9378cbf8 -[NSTableView drawRow:clipRect:] + 220 I have a sample project demonstrating the error, but I can't attach it for some reason, so if you want it, email me.. I would appreciate it if someone can tell what is going on, or can point me towards getting started in debugging memory errors in PyObjC. Thanks, Josh From bob at redivi.com Tue Jul 18 00:13:49 2006 From: bob at redivi.com (Bob Ippolito) Date: Mon, 17 Jul 2006 15:13:49 -0700 Subject: [Pythonmac-SIG] how big is fat? In-Reply-To: <44BBCD41.2040406@noaa.gov> References: <4B42E985-5B01-4C84-BC98-989D150E7056@conncoll.edu> <62B453F4-8525-4B3B-8D35-4A421D062532@redivi.com> <44BBCD41.2040406@noaa.gov> Message-ID: <32A6D73B-81D2-4F93-8137-3773D2A1B6FF@redivi.com> On Jul 17, 2006, at 10:47 AM, Christopher Barker wrote: > Bob Ippolito wrote: >> You must not be using py2app 0.3. I can't help you unless you are >> using the latest version. > > >> See this message for installation instructions. >> http://mail.python.org/pipermail/pythonmac-sig/2006-July/017766.html > > There is a package for Py2App 0.2.5 on pythonmac.org. Perhaps that > should be removed, and ideally, replaced with the latest version. At some point, yeah, it's on my list. -bob From bob at redivi.com Tue Jul 18 00:16:04 2006 From: bob at redivi.com (Bob Ippolito) Date: Mon, 17 Jul 2006 15:16:04 -0700 Subject: [Pythonmac-SIG] how big is fat? In-Reply-To: <44BBCE5E.8000700@noaa.gov> References: <4B42E985-5B01-4C84-BC98-989D150E7056@conncoll.edu> <62B453F4-8525-4B3B-8D35-4A421D062532@redivi.com> <44BBCD41.2040406@noaa.gov> <44BBCE5E.8000700@noaa.gov> Message-ID: <623F4854-CB5F-4735-9826-07D49DE7FDA0@redivi.com> On Jul 17, 2006, at 10:52 AM, Christopher Barker wrote: > And by the way, > > Is there a reason not to have a setuptools mpgk on pythonmac.org? Yes, there probably never will be. setuptools should be installed using its own means so it can properly upgrade itself. bdist_mpkg packages aren't really compatible with eggs (though 0.4 does install egg_info metadata). -bob From Chris.Barker at noaa.gov Tue Jul 18 01:21:54 2006 From: Chris.Barker at noaa.gov (Christopher Barker) Date: Mon, 17 Jul 2006 16:21:54 -0700 Subject: [Pythonmac-SIG] [Numpy-discussion] Packaging numpy with py2app In-Reply-To: References: <660C6421-8C71-4B4D-A2CC-33C3FF089DF9@gmail.com> Message-ID: <44BC1B92.4090009@noaa.gov> Josh, Have you gotten this working yet? I can't get a very simple numpy-using script to work. MPL will come later for me. > On Jul 16, 2006, at 5:22 PM, Josh Marshall wrote: >> I managed to get it working again, which required: >> 1) Setting packages=['matplotlib','numpy'] in setup.py's options for >> py2app. where did you so this? I have this simple setup.py: #!/usr/bin/env python2.4 """ Usage: % python setup.py py2app """ from distutils.core import setup import py2app setup( app = [dict(script = 'NumpyTest.py', packages = ['numpy'] )], Have I added the packages in the wrong place? I get errors that look like this when I try to run it: AttributeError: 'module' object has no attribute 'dtype' Warning: unrecognized command line flag -psn_0_74448897 No scipy-style subpackage 'core' found in /Users/cbarker/junk/dist/NumpyTest.app/Contents/Resources/lib/python2.4/site-packages.zip/numpy. Ignoring: No module named _internal ... Traceback (most recent call last): File "/Users/cbarker/junk/dist/NumpyTest.app/Contents/Resources/__boot__.py", line 31, in ? _run('NumpyTest.py') File "/Users/cbarker/junk/dist/NumpyTest.app/Contents/Resources/__boot__.py", line 28, in _run execfile(path, globals(), globals()) File "/Users/cbarker/junk/dist/NumpyTest.app/Contents/Resources/NumpyTest.py", line 3, in ? import numpy as N File "numpy/__init__.pyc", line 35, in ? File "numpy/_import_tools.pyc", line 173, in __call__ File "numpy/_import_tools.pyc", line 68, in _init_info_modules File "", line 1, in ? File "numpy/random/__init__.pyc", line 3, in ? File "numpy/random/mtrand.pyc", line 18, in ? File "numpy/random/mtrand.pyc", line 11, in __load File "numpy.pxi", line 32, in mtrand AttributeError: 'module' object has no attribute 'dtype' Bob Ippolito wrote: > That's a bug, but not the right fix. Trunk is fixed. I tried this with svn trunk too, and got the same results. By the way, I tried building svn trunk with bdist_mpkg, and giving the resulting package to someone else, and it didn't work. It couldn't import py2app, and when I looked at waht was installed, it didn't look right. If you have a setup.py that works for you, could you please post the whole thing? > nor do I have an example I > can test with so I'm not going to do it. It's certainly easy enough to give you examples! but it's up to us to write the recipes anyway. -thanks, -Chris -- Christopher Barker, Ph.D. Oceanographer NOAA/OR&R/HAZMAT (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 Jul 18 01:34:06 2006 From: Chris.Barker at noaa.gov (Christopher Barker) Date: Mon, 17 Jul 2006 16:34:06 -0700 Subject: [Pythonmac-SIG] [Numpy-discussion] Packaging numpy with py2app In-Reply-To: <44BC1B92.4090009@noaa.gov> References: <660C6421-8C71-4B4D-A2CC-33C3FF089DF9@gmail.com> <44BC1B92.4090009@noaa.gov> Message-ID: <44BC1E6E.9020502@noaa.gov> OK, As is usual with this stuff, I've figured it out. I poked into some of the py2app examples, and found one with py2app options set. Here's what works (at least with svn trunk, I haven't tried it with 0.3.1): #!/usr/bin/env python2.4 """ setup.py - script for building Simple CameoWeb test Usage: % python setup.py py2app """ from distutils.core import setup import py2app setup( app = [dict(script = 'NumpyTest.py', packages = ['numpy'] #plist = plist, )], options=dict(py2app=dict( #includes=['testpkg.*'], packages=['numpy'], )), setup_requires=["py2app"], ) What is "setup_requires" I just stuck it in there, as it was in all the examples. Even if we don't get a recipe for all this, we should at least add something like this to the examples. Note: I haven't done anything real with this, just a tiny sample. All I know is that numpy can be imported, and an array created. -Chris -- Christopher Barker, Ph.D. Oceanographer NOAA/OR&R/HAZMAT (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 bob at redivi.com Tue Jul 18 01:36:56 2006 From: bob at redivi.com (Bob Ippolito) Date: Mon, 17 Jul 2006 16:36:56 -0700 Subject: [Pythonmac-SIG] [Numpy-discussion] Packaging numpy with py2app In-Reply-To: <44BC1B92.4090009@noaa.gov> References: <660C6421-8C71-4B4D-A2CC-33C3FF089DF9@gmail.com> <44BC1B92.4090009@noaa.gov> Message-ID: On Jul 17, 2006, at 4:21 PM, Christopher Barker wrote: >> On Jul 16, 2006, at 5:22 PM, Josh Marshall wrote: > >>> I managed to get it working again, which required: >>> 1) Setting packages=['matplotlib','numpy'] in setup.py's options for >>> py2app. > > where did you so this? I have this simple setup.py: > > #!/usr/bin/env python2.4 > """ > Usage: > % python setup.py py2app > """ > from distutils.core import setup > import py2app > > setup( > app = [dict(script = 'NumpyTest.py', > packages = ['numpy'] > )], > > > Have I added the packages in the wrong place? I get errors that look > like this when I try to run it: Wrong place. setup(app=[...], options=dict(py2app=dict(packages=['numpy']))) > Warning: unrecognized command line flag -psn_0_74448897 You might want to add argv_emulation to that py2app options dict. But that probably only works on PPC in 0.3.1 and may be entirely broken on both architectures in the trunk (new entirely untested argv emulation code). > Bob Ippolito wrote: >> That's a bug, but not the right fix. Trunk is fixed. > > I tried this with svn trunk too, and got the same results. Well, your setup.py was broken. Barring a recipe for numpy, you'd have gotten the same results with any version of py2app. > By the way, I tried building svn trunk with bdist_mpkg, and giving the > resulting package to someone else, and it didn't work. It couldn't > import py2app, and when I looked at waht was installed, it didn't look > right. Expected behavior. The mpkg isn't going to contain the dependencies (setuptools, altgraph, bdist_mpkg, macholib, modulegraph). Don't do that, use only easy_install/setuptools to install it. I probably won't "fix" that any time soon. -bob From bob at redivi.com Tue Jul 18 01:49:14 2006 From: bob at redivi.com (Bob Ippolito) Date: Mon, 17 Jul 2006 16:49:14 -0700 Subject: [Pythonmac-SIG] [Numpy-discussion] Packaging numpy with py2app In-Reply-To: <44BC1E6E.9020502@noaa.gov> References: <660C6421-8C71-4B4D-A2CC-33C3FF089DF9@gmail.com> <44BC1B92.4090009@noaa.gov> <44BC1E6E.9020502@noaa.gov> Message-ID: <51B08665-6077-4E6F-875D-D217990B1714@redivi.com> On Jul 17, 2006, at 4:34 PM, Christopher Barker wrote: > OK, > > As is usual with this stuff, I've figured it out. I poked into some of > the py2app examples, and found one with py2app options set. Here's > what > works (at least with svn trunk, I haven't tried it with 0.3.1): > > #!/usr/bin/env python2.4 > """ > setup.py - script for building Simple CameoWeb test > > Usage: > % python setup.py py2app > """ > from distutils.core import setup > import py2app > > setup( > app = [dict(script = 'NumpyTest.py', > packages = ['numpy'] > #plist = plist, > )], > options=dict(py2app=dict( > #includes=['testpkg.*'], > packages=['numpy'], > )), > setup_requires=["py2app"], > ) > > What is "setup_requires" I just stuck it in there, as it was in all > the > examples. http://peak.telecommunity.com/DevCenter/setuptools#new-and-changed- setup-keywords """ setup_requires A string or list of strings specifying what other distributions need to be present in order for the setup script to run. setuptools will attempt to obtain these (even going so far as to download them using EasyInstall) before processing the rest of the setup script or commands. This argument is needed if you are using distutils extensions as part of your build process; for example, extensions that process setup() arguments and turn them into EGG-INFO metadata files. (Note: projects listed in setup_requires will NOT be automatically installed on the system where the setup script is being run. They are simply downloaded to the setup directory if they're not locally available already. If you want them to be installed, as well as being available when the setup script is run, you should add them to install_requires and setup_requires.) """ If someone has setuptools installed but not py2app, this would also ensure that py2app is downloaded and usable. It also makes absolutely sure that setuptools sees the py2app egg's entry points and adds the "py2app" command and "app" and "plugin" keywords to setup(). Your script isn't strictly correct either, it should be: from setuptools import setup setup(...) None of the examples explicitly import py2app or distutils (except the wxGlade one, which imports py2app to add a recipe). -bob From jacobian.33809303 at bloglines.com Tue Jul 18 05:49:58 2006 From: jacobian.33809303 at bloglines.com (jacobian.33809303 at bloglines.com) Date: 18 Jul 2006 03:49:58 -0000 Subject: [Pythonmac-SIG] Psycopg2 package fails on Intel Mac Message-ID: <1153194598.263045349.29590.sendItem@bloglines.com> Howdy folks -- It appears that the psycopg2 package at pythonmac.org/packages doesn't work on (my) MacIntel: jacob at dorkbook:~$ python Python 2.4.3 (#1, Apr 7 2006, 10:54:33) [GCC 4.0.1 (Apple Computer, Inc. build 5250)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> import psycopg2 Traceback (most recent call last): File "", line 1, in ? File "/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/psycopg2/__init__.py", line 60, in ? from _psycopg import BINARY, NUMBER, STRING, DATETIME, ROWID ImportError: Failure linking new module: /Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/psycopg2/_psycopg.so: Symbol not found: _krb5_free_principal Referenced from: /Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/psycopg2/_psycopg.so Expected in: dynamic lookup The universal packages page on the wiki makes it seem as if I should expect this package not to work, but I'm not sure if that's up-to-date. Am I doing something wrong, or is this breakage expected? Also: if someone can point me towards what's been done on psycopg2 so far I'd happily spend some time hacking on building it from source. I've given it about 10 minutes and not gotten anywhere, but as long as I'm not duplicating effort I'll keep poking. Thanks! Jacob From bob at redivi.com Tue Jul 18 06:01:34 2006 From: bob at redivi.com (Bob Ippolito) Date: Mon, 17 Jul 2006 21:01:34 -0700 Subject: [Pythonmac-SIG] [Numpy-discussion] Packaging numpy with py2app In-Reply-To: <60E2AEE1-9BF1-4B62-A9DC-7A497310A681@gmail.com> References: <660C6421-8C71-4B4D-A2CC-33C3FF089DF9@gmail.com> <44BC1B92.4090009@noaa.gov> <44BC1E6E.9020502@noaa.gov> <51B08665-6077-4E6F-875D-D217990B1714@redivi.com> <60E2AEE1-9BF1-4B62-A9DC-7A497310A681@gmail.com> Message-ID: On Jul 17, 2006, at 7:01 PM, Josh Marshall wrote: > Hi Chris, Bob, > > It really wasn't that difficult in the end to write the recipes. > I've attached them below. Note that these are tested against > py2app-0.3.1 (with my site-packages monkey patch) since I can't > seem to reach the svn repository at the moment. Should be back up. DreamHost has been having problems. I'll see about getting these in tonight. > However, I'm not happy with including all 10 MB of pytz for > matplotlib, when the only missed file (since it is referenced by > keyword in matplotlib/dates.py) is 4 kB. The other alternative (if > leaving it out of the recipe) is to have "includes = > ['pytz.zoneinfo.UTC']" in py2app_options in setup.py, which kind of > defeats the purpose of having a recipe. pytz is already included in > site-packages.zip, but since the UTC file is referenced by keyword, > it's not included. > So Bob, how can I specify 'include's in a recipe, or alternatively; > only refer to part of a package in the recipe? To do "includes", you need to manipulate the modulegraph instance. Take a look at the docutils recipe for an example. 'packages' is in the return value because that need to be dealt with by py2app, not modulegraph. > Eventually it would be nice to figure out how to get these into > site-packages.zip, as uncompressed numpy is 5 MB, matplotlib is 10 > and scipy is 15. But that's more an issue for the numpy discussion > group, to do when I have more time. Applications are usually distributed compressed, the on-disk size isn't too much of a concern for most people... > I've also attached my little matplotlib Cocoa-embedding test > application, reduced to bare essentials. Hope it's useful for > people testing. > > Oh, and any reason why I can't send mail to pythonmac- > sig at python.org? I'm always getting a PERM_FAILURE: SMTP Error > (state 12): 554 permanent error. You probably have to be subscribed? -bob From bob at redivi.com Tue Jul 18 06:20:01 2006 From: bob at redivi.com (Bob Ippolito) Date: Mon, 17 Jul 2006 21:20:01 -0700 Subject: [Pythonmac-SIG] Psycopg2 package fails on Intel Mac In-Reply-To: <1153194598.263045349.29590.sendItem@bloglines.com> References: <1153194598.263045349.29590.sendItem@bloglines.com> Message-ID: On Jul 17, 2006, at 8:49 PM, jacobian.33809303 at bloglines.com wrote: > Howdy folks -- > > It appears that the psycopg2 package at pythonmac.org/packages > doesn't work on (my) MacIntel: > > jacob at dorkbook:~$ python > Python > 2.4.3 (#1, Apr 7 2006, 10:54:33) > [GCC 4.0.1 (Apple Computer, Inc. build > 5250)] on darwin > Type "help", "copyright", "credits" or "license" for > more information. >>>> import psycopg2 > Traceback (most recent call > last): > File "", line 1, in ? > File "/Library/Frameworks/Python.framework/Versions/2.4/lib/ > python2.4/site-packages/psycopg2/__init__.py", > line 60, in ? > from _psycopg import BINARY, NUMBER, STRING, DATETIME, > ROWID > ImportError: Failure linking new module: /Library/Frameworks/ > Python.framework/Versions/2.4/lib/python2.4/site-packages/psycopg2/ > _psycopg.so: > Symbol not found: _krb5_free_principal > Referenced from: /Library/Frameworks/Python.framework/ > Versions/2.4/lib/python2.4/site-packages/psycopg2/_psycopg.so > > Expected in: dynamic lookup > > The universal packages page on the wiki > makes it seem as if I should expect this package not to work, but > I'm not > sure if that's up-to-date. > > Am I doing something wrong, or is this breakage > expected? That's weird, I thought that was the package I was using, but it's not. I'll upload another one. > Also: if someone can point me towards what's been done on psycopg2 > so far I'd happily spend some time hacking on building it from > source. I've > given it about 10 minutes and not gotten anywhere, but as long as > I'm not > duplicating effort I'll keep poking. http://initd.org/svn/psycopg/psycopg2/tags/2_0_BETA_8 Index: setup.py =================================================================== --- setup.py (revision 789) +++ setup.py (working copy) @@ -134,6 +134,7 @@ def finalize_darwin(self): """Finalize build system configuration on darwin platform.""" + self.libraries.append('krb5') self.libraries.append('ssl') self.libraries.append('crypto') -bob From josh.p.marshall at gmail.com Tue Jul 18 07:01:15 2006 From: josh.p.marshall at gmail.com (Josh Marshall) Date: Tue, 18 Jul 2006 15:01:15 +1000 Subject: [Pythonmac-SIG] [Numpy-discussion] Packaging numpy with py2app In-Reply-To: References: <660C6421-8C71-4B4D-A2CC-33C3FF089DF9@gmail.com> <44BC1B92.4090009@noaa.gov> <44BC1E6E.9020502@noaa.gov> <51B08665-6077-4E6F-875D-D217990B1714@redivi.com> <60E2AEE1-9BF1-4B62-A9DC-7A497310A681@gmail.com> Message-ID: <213C1E2D-AE4D-4578-9E22-FB49C1ACAA75@gmail.com> Thanks Bob, On 18/07/2006, at 2:01 PM, Bob Ippolito wrote: > To do "includes", you need to manipulate the modulegraph instance. > Take a look at the docutils recipe for an example. 'packages' is in > the return value because that need to be dealt with by py2app, not > modulegraph. Can you change the recipe for matplotlib to be: def check(cmd, mf): m = mf.findNode('matplotlib') if m is None or m.filename is None: return None mf.import_hook('pytz.zoneinfo', m, ['UTC']) return dict( packages = ['matplotlib'] ) This does the trick with no workarounds. If anyone needs to actual work with the plotting of time-zone relative dates in matplotlib in embedded Cocoa, it'll die. However, the likelihood of this occurring is low, but for future reference for the Googlers of the future; add the time-zones you need to the list in import_hook, ie ['UTC', 'Australia.Sydney']. > Applications are usually distributed compressed, the on-disk size > isn't too much of a concern for most people... True, I just compressed the .app and it shrunk from 40 MB to 14, so no problems there. The other thing to get down the compressed size is for me to figure out how to exclude stuff I don't need. The question does stand though, how would I go about including the package 'scipy', but omitting 'scipy.weave'? My other concern was getting around to doing this as a universal binary and have an enormous file. What sort of file size increases am I looking at? I presume it'll just be the libraries that double in size, and the Python code should remain the same? >> Oh, and any reason why I can't send mail to pythonmac- >> sig at python.org? I'm always getting a PERM_FAILURE: SMTP Error >> (state 12): 554 permanent error. > > You probably have to be subscribed? I am subscribed via sourceforge. The emails go about 75%, and fail the rest. Bizarre. From bob at redivi.com Tue Jul 18 07:15:06 2006 From: bob at redivi.com (Bob Ippolito) Date: Mon, 17 Jul 2006 22:15:06 -0700 Subject: [Pythonmac-SIG] [Numpy-discussion] Packaging numpy with py2app In-Reply-To: <213C1E2D-AE4D-4578-9E22-FB49C1ACAA75@gmail.com> References: <660C6421-8C71-4B4D-A2CC-33C3FF089DF9@gmail.com> <44BC1B92.4090009@noaa.gov> <44BC1E6E.9020502@noaa.gov> <51B08665-6077-4E6F-875D-D217990B1714@redivi.com> <60E2AEE1-9BF1-4B62-A9DC-7A497310A681@gmail.com> <213C1E2D-AE4D-4578-9E22-FB49C1ACAA75@gmail.com> Message-ID: On Jul 17, 2006, at 10:01 PM, Josh Marshall wrote: > Thanks Bob, > > On 18/07/2006, at 2:01 PM, Bob Ippolito wrote: >> To do "includes", you need to manipulate the modulegraph instance. >> Take a look at the docutils recipe for an example. 'packages' is >> in the return value because that need to be dealt with by py2app, >> not modulegraph. > Can you change the recipe for matplotlib to be: > > def check(cmd, mf): > m = mf.findNode('matplotlib') > if m is None or m.filename is None: > return None > mf.import_hook('pytz.zoneinfo', m, ['UTC']) > return dict( > packages = ['matplotlib'] > ) > > > This does the trick with no workarounds. > > If anyone needs to actual work with the plotting of time-zone > relative dates in matplotlib in embedded Cocoa, it'll die. However, > the likelihood of this occurring is low, but for future reference > for the Googlers of the future; add the time-zones you need to the > list in import_hook, ie ['UTC', 'Australia.Sydney']. If you were actually doing that, you should write the imports yourself. The right place to put that metadata is in your code with import statements, because that's cross-platform and cross-packager. py2exe and cx_Freeze will understand import statements too. >> Applications are usually distributed compressed, the on-disk size >> isn't too much of a concern for most people... > > True, I just compressed the .app and it shrunk from 40 MB to 14, so > no problems there. The other thing to get down the compressed size > is for me to figure out how to exclude stuff I don't need. The > question does stand though, how would I go about including the > package 'scipy', but omitting 'scipy.weave'? You can't do that so long as scipy is wholly included with the packages option. The packages option does "cp -r" effectively, I'm not going to complicate it for this use case. I might accept a patch if it wasn't too horrible, but the effort is better spent making scipy work in a zip archive. > My other concern was getting around to doing this as a universal > binary and have an enormous file. What sort of file size increases > am I looking at? I presume it'll just be the libraries that double > in size, and the Python code should remain the same? The file size increase is what you'd expect -- a bit less than double. x86 code is somewhat smaller than PPC because it has more instructions to choose from and they're variable length. The Python code is shared, but that's very rarely the bulk. Plus it gets compressed unless explicitly excluded with packages, where platform code isn't compressed. -bob From simon at brunningonline.net Tue Jul 18 14:18:10 2006 From: simon at brunningonline.net (Simon Brunning) Date: Tue, 18 Jul 2006 13:18:10 +0100 Subject: [Pythonmac-SIG] Setting the Screen Saver Message-ID: <8c7f10c60607180518k59d6ff3bu9ca5bc412b0f2580@mail.gmail.com> Is there a way of setting the OS X screen saver using Python? The System Preferences ap looks like it's AppleScript (and hence appscript) drivable, but I can't work out how to make it actually change any settings. I've also found the screen saver plist, but it's binary rather than XML, so I'd rather not go there if I can avoind it. Besides, I don't know if changing the plisty would take immediate effect. Any hints? -- Cheers, Simon B, simon at brunningonline.net, http://www.brunningonline.net/simon/blog/ From hengist.podd at virgin.net Tue Jul 18 19:48:10 2006 From: hengist.podd at virgin.net (has) Date: Tue, 18 Jul 2006 18:48:10 +0100 Subject: [Pythonmac-SIG] Setting the Screen Saver Message-ID: Simon Brunning wrote: > Is there a way of setting the OS X screen saver using Python? > > The System Preferences ap looks like it's AppleScript (and hence > appscript) drivable, but I can't work out how to make it actually > change any settings. System Preferences' scripting support is rudimentary. You can switch between preference panes, but that's about it. Anything more, you'll need to use GUI Scripting (with the usual caveats about brittleness, etc). has -- http://freespace.virgin.net/hamish.sanderson/ From josh.p.marshall at gmail.com Tue Jul 18 23:36:06 2006 From: josh.p.marshall at gmail.com (Josh Marshall) Date: Wed, 19 Jul 2006 07:36:06 +1000 Subject: [Pythonmac-SIG] [Numpy-discussion] Packaging numpy with py2app In-Reply-To: References: <660C6421-8C71-4B4D-A2CC-33C3FF089DF9@gmail.com> <44BC1B92.4090009@noaa.gov> <44BC1E6E.9020502@noaa.gov> <51B08665-6077-4E6F-875D-D217990B1714@redivi.com> <60E2AEE1-9BF1-4B62-A9DC-7A497310A681@gmail.com> <213C1E2D-AE4D-4578-9E22-FB49C1ACAA75@gmail.com> Message-ID: <9148A14B-7462-47EC-9262-52802E5A9CB4@gmail.com> On 18/07/2006, at 3:15 PM, Bob Ippolito wrote: >> def check(cmd, mf): >> m = mf.findNode('matplotlib') >> if m is None or m.filename is None: >> return None >> mf.import_hook('pytz.zoneinfo', m, ['UTC']) >> return dict( >> packages = ['matplotlib'] >> ) >> >> If anyone needs to actual work with the plotting of time-zone >> relative dates in matplotlib in embedded Cocoa, it'll die. >> However, the likelihood of this occurring is low, but for future >> reference for the Googlers of the future; add the time-zones you >> need to the list in import_hook, ie ['UTC', 'Australia.Sydney']. > > If you were actually doing that, you should write the imports > yourself. The right place to put that metadata is in your code with > import statements, because that's cross-platform and cross- > packager. py2exe and cx_Freeze will understand import statements too. Agreed. I searched through matplotlib and pytz, and found that you can add a straightforward import of pytz.zoneinfo.UTC rather than going through a loader function. I will submit as a patch to the matplotlib developers. I suggest leaving the line in the recipe for a while at least. > You can't do that so long as scipy is wholly included with the > packages option. The packages option does "cp -r" effectively, I'm > not going to complicate it for this use case. I might accept a > patch if it wasn't too horrible, but the effort is better spent > making scipy work in a zip archive. Agreed, although with the latest version of py2app working out of the box with the recipes, I'll probably let it slide. I spent a bit more time looking at matplotlib, and realised I just need to include the data files (fonts, rc, icons) directory in the Resources dir in the app. When I did this manually, it worked fine, since there is code to detect frozen status in the initialisation, and it searches the Resources dir. However, I can't figure out how to copy resources in the recipe. It seems in recipes, you can return in the dict: packages, flatpackages, filters, loader_files, and prescripts. Could you enlighten me on the use of each of these? Regards, Josh From acn at carbontechnologies.com Tue Jul 18 23:17:17 2006 From: acn at carbontechnologies.com (Apple Consultants Network) Date: Tue, 18 Jul 2006 17:17:17 -0400 Subject: [Pythonmac-SIG] Adding resource fork support to tarfile.py Message-ID: <804F1D6E-4A11-42D7-A499-E9774FBBC2AA@carbontechnologies.com> Dear List, I am new to the list and new to python, so please be kind :) I've recently started playing with duplicity (http://duplicity.nongnu.org) and really like the feature set that is offered by the project. However, I am being stung by the thorn in Apple's side; resource forks. duplicity uses a copy of tarfile.py to build the tar archives. And since this file does not call OS X's tar, nor does it have support for resource forks, it will only add data forks to the tar archive. So, I started looking around and found that OS X has a tarfile.py (System/Library/Frameworks/Python.framework/Versions/2.3/lib/ python2.3/) as part of the standard python install. This tarfile.py is different from the one distributed by duplicity, and at first I though I would use it in the distribution. However, using this default install shows that it too does not respect resource forks. For example, doing a simple: #!/usr/bin/python import tarfile tar = tarfile.open("sample.tar", "w") for name in ["Arial"]: tar.add(name) tar.close() produces a tar file with only the data fork. The resource fork is lost. In the case of fonts, this is bad. I am currently running 10.4.7 so I know that resource forks are supported in many unix tools such as cp, mv, tar, and others. For example, if I execute a simple tar cf archive.tar Arial, the font is intact upon expansion, tar xvf archive.tar. Also, from searches, there appears to be some level on integration between python and resources forks on the Mac through the use of "import MacOS > from Carbon import Res". From searching the archives I've found some sample code to allow the reading of the contents of a resource fork (thanks to the poster for that). However, I need to make the tarfile library respect the forks as this is how duplicity creates the archive files. Has anyone figured out a way around this limitation in python' tarfile.py library. Admittedly, I generally avoided python so this is a bit foreign to me. Any help or even clarification would be appreciated. I realize that for a person new to the language, this is a tall order. Thanks for your time. Reid -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/pythonmac-sig/attachments/20060718/323f9159/attachment.html From Chris.Barker at noaa.gov Wed Jul 19 00:48:14 2006 From: Chris.Barker at noaa.gov (Christopher Barker) Date: Tue, 18 Jul 2006 15:48:14 -0700 Subject: [Pythonmac-SIG] [Numpy-discussion] Packaging numpy with py2app In-Reply-To: <9148A14B-7462-47EC-9262-52802E5A9CB4@gmail.com> References: <660C6421-8C71-4B4D-A2CC-33C3FF089DF9@gmail.com> <44BC1B92.4090009@noaa.gov> <44BC1E6E.9020502@noaa.gov> <51B08665-6077-4E6F-875D-D217990B1714@redivi.com> <60E2AEE1-9BF1-4B62-A9DC-7A497310A681@gmail.com> <213C1E2D-AE4D-4578-9E22-FB49C1ACAA75@gmail.com> <9148A14B-7462-47EC-9262-52802E5A9CB4@gmail.com> Message-ID: <44BD652E.9030609@noaa.gov> Josh Marshall wrote: > However, I can't figure out how to copy resources in the recipe. It > seems in recipes, you can return in the dict: packages, flatpackages, > filters, loader_files, and prescripts. Could you enlighten me on the use > of each of these? I wonder what the plan should be for recipes for MPL and the like. As Bob mentioned, perhaps it's best for the developer to find a way to manually include what they want, as there is a LOT of stuff in MPL (and certainly SciPy!) and much of will not be used by a given application. It seems the only way to make a recipe that is useful would be for it to include EVERYTHING. That may not be a bad default, but there should certainly be a way to turn it off if need be. Is there an incantation to turn off a recipe? Also, I got a numpy app to work yesterday by using: packages=['numpy'] That then includes the entire numpy package. That works, but it puts in a lot of stuff I don't need (dft, linear_algebra, etc). Maybe the recipe should include only the core stuff, and let the user add the extra packages, if need be. Or should numpy be fixed so that it doesn't do weird imports? -Chris -- Christopher Barker, Ph.D. Oceanographer NOAA/OR&R/HAZMAT (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 bob at redivi.com Wed Jul 19 01:08:20 2006 From: bob at redivi.com (Bob Ippolito) Date: Tue, 18 Jul 2006 16:08:20 -0700 Subject: [Pythonmac-SIG] [Numpy-discussion] Packaging numpy with py2app In-Reply-To: <44BD652E.9030609@noaa.gov> References: <660C6421-8C71-4B4D-A2CC-33C3FF089DF9@gmail.com> <44BC1B92.4090009@noaa.gov> <44BC1E6E.9020502@noaa.gov> <51B08665-6077-4E6F-875D-D217990B1714@redivi.com> <60E2AEE1-9BF1-4B62-A9DC-7A497310A681@gmail.com> <213C1E2D-AE4D-4578-9E22-FB49C1ACAA75@gmail.com> <9148A14B-7462-47EC-9262-52802E5A9CB4@gmail.com> <44BD652E.9030609@noaa.gov> Message-ID: <97CBC37A-0AE8-491B-9875-CC854CE734D6@redivi.com> On Jul 18, 2006, at 3:48 PM, Christopher Barker wrote: > Josh Marshall wrote: >> However, I can't figure out how to copy resources in the recipe. It >> seems in recipes, you can return in the dict: packages, flatpackages, >> filters, loader_files, and prescripts. Could you enlighten me on >> the use >> of each of these? > > I wonder what the plan should be for recipes for MPL and the like. As > Bob mentioned, perhaps it's best for the developer to find a way to > manually include what they want, as there is a LOT of stuff in MPL > (and > certainly SciPy!) and much of will not be used by a given application. > > It seems the only way to make a recipe that is useful would be for > it to > include EVERYTHING. That may not be a bad default, but there should > certainly be a way to turn it off if need be. > > Is there an incantation to turn off a recipe? No > Or should numpy be fixed so that it doesn't do weird imports? bingo. -bob From cookedm at physics.mcmaster.ca Wed Jul 19 00:45:42 2006 From: cookedm at physics.mcmaster.ca (David M. Cooke) Date: Tue, 18 Jul 2006 18:45:42 -0400 Subject: [Pythonmac-SIG] Adding resource fork support to tarfile.py In-Reply-To: <804F1D6E-4A11-42D7-A499-E9774FBBC2AA@carbontechnologies.com> References: <804F1D6E-4A11-42D7-A499-E9774FBBC2AA@carbontechnologies.com> Message-ID: <218B3F58-0A02-49CE-923C-61137F6F5445@physics.mcmaster.ca> On Jul 18, 2006, at 17:17 , Apple Consultants Network wrote: > Dear List, > > I am new to the list and new to python, so please be kind :) I've > recently started playing with duplicity (http:// > duplicity.nongnu.org) and really like the feature set that is > offered by the project. However, I am being stung by the thorn in > Apple's side; resource forks. duplicity uses a copy of tarfile.py > to build the tar archives. And since this file does not call OS > X's tar, nor does it have support for resource forks, it will only > add data forks to the tar archive. > > So, I started looking around and found that OS X has a tarfile.py > (System/Library/Frameworks/Python.framework/Versions/2.3/lib/ > python2.3/) as part of the standard python install. This > tarfile.py is different from the one distributed by duplicity, and > at first I though I would use it in the distribution. However, > using this default install shows that it too does not respect > resource forks. For example, doing a simple: > > #!/usr/bin/python > > import tarfile > > tar = tarfile.open("sample.tar", "w") > for name in ["Arial"]: > tar.add(name) > tar.close() > > produces a tar file with only the data fork. The resource fork is > lost. In the case of fonts, this is bad. You've got to explicitly handle the resource fork yourself. The tar format (AFAIK) doesn't support any notion of extra metadata or forks of a file. Tiger's tar fakes it by saving the resource fork as a separate file with '._' added to the front (e.g., for 'hello.font', it stores the data fork as 'hello.font', and the resource fork as '._hello.font'). I've attached two scripts I wrote a while ago that handle the resource forks in this way. -- |>|\/|< /------------------------------------------------------------------\ |David M. Cooke http://arbutus.physics.mcmaster.ca/dmc/ |cookedm at physics.mcmaster.ca -------------- next part -------------- A non-text attachment was scrubbed... Name: maketar.py Type: text/x-python-script Size: 1917 bytes Desc: not available Url : http://mail.python.org/pipermail/pythonmac-sig/attachments/20060718/fe4e208f/attachment-0002.bin -------------- next part -------------- A non-text attachment was scrubbed... Name: extar.py Type: text/x-python-script Size: 836 bytes Desc: not available Url : http://mail.python.org/pipermail/pythonmac-sig/attachments/20060718/fe4e208f/attachment-0003.bin -------------- next part -------------- From bob at redivi.com Wed Jul 19 01:28:14 2006 From: bob at redivi.com (Bob Ippolito) Date: Tue, 18 Jul 2006 16:28:14 -0700 Subject: [Pythonmac-SIG] [Numpy-discussion] Packaging numpy with py2app In-Reply-To: <9148A14B-7462-47EC-9262-52802E5A9CB4@gmail.com> References: <660C6421-8C71-4B4D-A2CC-33C3FF089DF9@gmail.com> <44BC1B92.4090009@noaa.gov> <44BC1E6E.9020502@noaa.gov> <51B08665-6077-4E6F-875D-D217990B1714@redivi.com> <60E2AEE1-9BF1-4B62-A9DC-7A497310A681@gmail.com> <213C1E2D-AE4D-4578-9E22-FB49C1ACAA75@gmail.com> <9148A14B-7462-47EC-9262-52802E5A9CB4@gmail.com> Message-ID: <1CC7BE8A-F534-4256-A5A2-FEA2E1D2725A@redivi.com> On Jul 18, 2006, at 2:36 PM, Josh Marshall wrote: > On 18/07/2006, at 3:15 PM, Bob Ippolito wrote: >>> def check(cmd, mf): >>> m = mf.findNode('matplotlib') >>> if m is None or m.filename is None: >>> return None >>> mf.import_hook('pytz.zoneinfo', m, ['UTC']) >>> return dict( >>> packages = ['matplotlib'] >>> ) >>> >>> If anyone needs to actual work with the plotting of time-zone >>> relative dates in matplotlib in embedded Cocoa, it'll die. >>> However, the likelihood of this occurring is low, but for future >>> reference for the Googlers of the future; add the time-zones you >>> need to the list in import_hook, ie ['UTC', 'Australia.Sydney']. >> >> If you were actually doing that, you should write the imports >> yourself. The right place to put that metadata is in your code >> with import statements, because that's cross-platform and cross- >> packager. py2exe and cx_Freeze will understand import statements too. > > Agreed. I searched through matplotlib and pytz, and found that you > can add a straightforward import of pytz.zoneinfo.UTC rather than > going through a loader function. I will submit as a patch to the > matplotlib developers. I suggest leaving the line in the recipe for > a while at least. Yeah, that's fine. >> You can't do that so long as scipy is wholly included with the >> packages option. The packages option does "cp -r" effectively, I'm >> not going to complicate it for this use case. I might accept a >> patch if it wasn't too horrible, but the effort is better spent >> making scipy work in a zip archive. > > Agreed, although with the latest version of py2app working out of > the box with the recipes, I'll probably let it slide. > > I spent a bit more time looking at matplotlib, and realised I just > need to include the data files (fonts, rc, icons) directory in the > Resources dir in the app. When I did this manually, it worked fine, > since there is code to detect frozen status in the initialisation, > and it searches the Resources dir. > > However, I can't figure out how to copy resources in the recipe. It > seems in recipes, you can return in the dict: packages, > flatpackages, filters, loader_files, and prescripts. Could you > enlighten me on the use of each of these? The recipe mechanism doesn't allow for it because it doesn't generally make sense. There are very few packages that can find their resources in an alternative manner. I'm not totally opposed to adding another feature to support that use case, but throwing it directly in the resources dir seems like a bad idea to do automatically from a recipe. The files should sit under some kind of matplotlib hierarchy. It would be nicer to see matplotlib just figure out how to make their app work from a zip... pygame does, and it has fonts and icons. packages wholly includes a package as-is, outside the zip. flatpackages doesn't do anything useful, it inserts a false node into the graph to group "extra_path" packages together. PIL and PyObjC are the only two projects I can recall doing this. Changing the graph in such a way has no effect whatsoever, it's merely an aesthetic change to the graph which can be useful if you're visualizing it. filters adds a dependency filter.. a function that gets called with every modulegraph node and decides whether to include it or not. There are several of these in py2app, but none demonstrated as a recipe. It usually doesn't make sense to use this in a recipe. See py2app.filters for examples of filters. loader_files puts data files *in the zip* prescripts are code that gets put in the bootstrap. The PIL recipe has one of these. -bob From josh.p.marshall at gmail.com Wed Jul 19 02:32:06 2006 From: josh.p.marshall at gmail.com (Josh Marshall) Date: Wed, 19 Jul 2006 10:32:06 +1000 Subject: [Pythonmac-SIG] [Numpy-discussion] Packaging numpy with py2app In-Reply-To: <1CC7BE8A-F534-4256-A5A2-FEA2E1D2725A@redivi.com> References: <660C6421-8C71-4B4D-A2CC-33C3FF089DF9@gmail.com> <44BC1B92.4090009@noaa.gov> <44BC1E6E.9020502@noaa.gov> <51B08665-6077-4E6F-875D-D217990B1714@redivi.com> <60E2AEE1-9BF1-4B62-A9DC-7A497310A681@gmail.com> <213C1E2D-AE4D-4578-9E22-FB49C1ACAA75@gmail.com> <9148A14B-7462-47EC-9262-52802E5A9CB4@gmail.com> <1CC7BE8A-F534-4256-A5A2-FEA2E1D2725A@redivi.com> Message-ID: <0039ED8C-EA8A-47BE-9967-200AF66D173A@gmail.com> Thanks for the info on how the various recipes work, Bob. Very helpful. On 19/07/2006, at 9:28 AM, Bob Ippolito wrote: > The recipe mechanism doesn't allow for it because it doesn't > generally make sense. There are very few packages that can find > their resources in an alternative manner. I'm not totally opposed > to adding another feature to support that use case, but throwing it > directly in the resources dir seems like a bad idea to do > automatically from a recipe. The files should sit under some kind > of matplotlib hierarchy. It would be nicer to see matplotlib just > figure out how to make their app work from a zip... pygame does, > and it has fonts and icons. I think matplotlib can access files inside the zip, since it searches inside the following directories upon startup and is frozen-aware. MatplotlibEmbedSample.app/Contents/Resources/lib/python2.4/site- packages.zip/matplotlib/mpl-data MatplotlibEmbedSample.app/Contents/mpl-data MatplotlibEmbedSample.app/Contents/Resources/mpl-data So I have been attempting to put the data files in the zip. > loader_files puts data files *in the zip* Indeed it does. When I use the following recipe: (noting that the recipe's filename can't be "matplotlib.py", I've been using "matplotlib_recipe.py"): def check(cmd, mf): m = mf.findNode('matplotlib') if m is None or m.filename is None: return None import matplotlib, glob, os mpl_datapath = matplotlib.get_data_path() mpl_datafilelist = glob.glob(mpl_datapath + r'/*') # only include individual files from the mpl-data directory # this should exclude directories, which should only be Matplotlib.nib mpl_datafilelist = [mpl_file for mpl_file in mpl_datafilelist if os.path.isfile(mpl_file)] mf.import_hook('pytz.zoneinfo', m, ['UTC']) mf.import_hook('matplotlib.numerix', m, ['random_array']) return dict( loader_files = [ ('matplotlib', mpl_datafilelist), ], ) The data files then get put in the matplotlib directory in the zip. However, matplotlib searches in the mpl-data directory *inside* the matplotlib directory, as shown in the search paths above. I have not been able to find a way to include a directory within the matplotlib directory. If I use loader_files = [ ('matplotlib/mpl-data', mpl_datafilelist), ], py2app barfs when trying to copy the files since the directory doesn't exist. Any ideas Bob? Chris, can you please copy my email when replying to the thread? I'm getting the digest, so I don't get your messages for quite some time otherwise. Christopher Barker wrote: > I wonder what the plan should be for recipes for MPL and the like. > As Bob mentioned, perhaps it's best for the developer to find a way > to manually include what they want, as there is a LOT of stuff in > MPL (and certainly SciPy!) and much of will not be used by a given > application. If we can get numpy and scipy to work without a recipe that just includes the packages we can definitely do this. The problem here is not with py2app, but rather with numpy/scipy themselves and their crazy custom importer which doesn't work with a zipped site-packages. I am close to getting matplotlib working with a decent non-naive recipe. This means it'll only include what is being used by the application. > It seems the only way to make a recipe that is useful would be for > it to include EVERYTHING. That may not be a bad default, but there > should certainly be a way to turn it off if need be. No, a useful and "proper" recipe just adds the files that are not referenced directly through imports, ie., data files. This is what I am doing with matplotlib. > Also, I got a numpy app to work yesterday by using: > packages=['numpy'] The recipe I sent out in the zip yesterday did exactly that. Bob has added it to py2app trunk. There is a similar recipe for scipy and matplotlib as well. These will do until we get proper ones working. The packages option does include *everything*, by doing a full copy of the package. This means that source, documentation, example files, etc gets included along with the bytecode files. > That then includes the entire numpy package. That works, but it > puts in a lot of stuff I don't need (dft, linear_algebra, etc). > Maybe the recipe should include only the core stuff, and let the > user add the extra packages, if need be. AFAICT, this can't really be done. From looking at the numpy structure, there are subpackages 'testing','core','lib','linalg','dft','random','f2py', which are all loaded in the numpy __init__.py via the following: pkgload = PackageLoader() pkgload('testing','core','lib','linalg','dft','random','f2py', verbose=NUMPY_IMPORT_VERBOSE,postpone=False) The doc string for PackageLoader.__call__() says: > This function is intended to shorten the need to import many of > subpackages, say of scipy, constantly with statements such as > > import scipy.linalg, scipy.fftpack, scipy.etc... > > Instead, you can say: > > import scipy > scipy.pkgload('linalg','fftpack',...) > > or > > scipy.pkgload() so it seems like the entire purpose of PackageLoader is to make life difficult for me, just to save a few lines of typing. :) Seriously, can a numpy developer tell me why PackageLoader is necessary? > Or should numpy be fixed so that it doesn't do weird imports? The weird imports are okay, but they need to be able to work from a site-packages.zip. That's the next job. Hopefully I'll get time to look at it before numpy goes too far into beta. Scipy is a long way off. Cheers all, Josh From bob at redivi.com Wed Jul 19 02:57:29 2006 From: bob at redivi.com (Bob Ippolito) Date: Tue, 18 Jul 2006 17:57:29 -0700 Subject: [Pythonmac-SIG] [Numpy-discussion] Packaging numpy with py2app In-Reply-To: <0039ED8C-EA8A-47BE-9967-200AF66D173A@gmail.com> References: <660C6421-8C71-4B4D-A2CC-33C3FF089DF9@gmail.com> <44BC1B92.4090009@noaa.gov> <44BC1E6E.9020502@noaa.gov> <51B08665-6077-4E6F-875D-D217990B1714@redivi.com> <60E2AEE1-9BF1-4B62-A9DC-7A497310A681@gmail.com> <213C1E2D-AE4D-4578-9E22-FB49C1ACAA75@gmail.com> <9148A14B-7462-47EC-9262-52802E5A9CB4@gmail.com> <1CC7BE8A-F534-4256-A5A2-FEA2E1D2725A@redivi.com> <0039ED8C-EA8A-47BE-9967-200AF66D173A@gmail.com> Message-ID: On Jul 18, 2006, at 5:32 PM, Josh Marshall wrote: > Thanks for the info on how the various recipes work, Bob. Very > helpful. > > On 19/07/2006, at 9:28 AM, Bob Ippolito wrote: >> The recipe mechanism doesn't allow for it because it doesn't >> generally make sense. There are very few packages that can find >> their resources in an alternative manner. I'm not totally opposed >> to adding another feature to support that use case, but throwing it >> directly in the resources dir seems like a bad idea to do >> automatically from a recipe. The files should sit under some kind >> of matplotlib hierarchy. It would be nicer to see matplotlib just >> figure out how to make their app work from a zip... pygame does, >> and it has fonts and icons. > > I think matplotlib can access files inside the zip, since it searches > inside the following directories upon startup and is frozen-aware. > > MatplotlibEmbedSample.app/Contents/Resources/lib/python2.4/site- > packages.zip/matplotlib/mpl-data > MatplotlibEmbedSample.app/Contents/mpl-data > MatplotlibEmbedSample.app/Contents/Resources/mpl-data > > So I have been attempting to put the data files in the zip. > >> loader_files puts data files *in the zip* > > Indeed it does. When I use the following recipe: (noting that the > recipe's filename can't be "matplotlib.py", I've been using > "matplotlib_recipe.py"): > > def check(cmd, mf): > m = mf.findNode('matplotlib') > if m is None or m.filename is None: > return None > > import matplotlib, glob, os > mpl_datapath = matplotlib.get_data_path() > mpl_datafilelist = glob.glob(mpl_datapath + r'/*') > > # only include individual files from the mpl-data directory > # this should exclude directories, which should only be > Matplotlib.nib > mpl_datafilelist = [mpl_file for mpl_file in mpl_datafilelist > if os.path.isfile(mpl_file)] > > mf.import_hook('pytz.zoneinfo', m, ['UTC']) > mf.import_hook('matplotlib.numerix', m, ['random_array']) > return dict( > loader_files = [ > ('matplotlib', mpl_datafilelist), > ], > ) > > The data files then get put in the matplotlib directory in the zip. > However, matplotlib searches in the mpl-data directory *inside* the > matplotlib directory, as shown in the search paths above. > > I have not been able to find a way to include a directory within the > matplotlib directory. If I use > loader_files = [ > ('matplotlib/mpl-data', mpl_datafilelist), > ], > py2app barfs when trying to copy the files since the directory > doesn't exist. Any ideas Bob? This should work in svn (r13). You can easily run the development version straight from a svn checkout: svn co http://svn.pythonmac.org/py2app/py2app/trunk py2app cd py2app python setup.py develop That'll set it up such that the "installed" py2app is actually what's sitting in your svn checkout. You can make changes without re- installing or anything. -bob From josh.p.marshall at gmail.com Wed Jul 19 04:26:51 2006 From: josh.p.marshall at gmail.com (Josh Marshall) Date: Wed, 19 Jul 2006 12:26:51 +1000 Subject: [Pythonmac-SIG] [Numpy-discussion] Packaging numpy with py2app In-Reply-To: References: <660C6421-8C71-4B4D-A2CC-33C3FF089DF9@gmail.com> <44BC1B92.4090009@noaa.gov> <44BC1E6E.9020502@noaa.gov> <51B08665-6077-4E6F-875D-D217990B1714@redivi.com> <60E2AEE1-9BF1-4B62-A9DC-7A497310A681@gmail.com> <213C1E2D-AE4D-4578-9E22-FB49C1ACAA75@gmail.com> <9148A14B-7462-47EC-9262-52802E5A9CB4@gmail.com> <1CC7BE8A-F534-4256-A5A2-FEA2E1D2725A@redivi.com> <0039ED8C-EA8A-47BE-9967-200AF66D173A@gmail.com> Message-ID: <98FDFEDF-CB5D-4014-8214-653FC4CA1CCA@gmail.com> Thanks for the fix Bob. Unfortunately Matplotlib does not work with zipped data files, after all that. So, we'll leave the recipes as is, as they work for now. I suspect the way forward is to get numpy/Matplotlib/scipy working with setuptools and using pkg_resources to manage the data files. Any thoughts on this? From bob at redivi.com Wed Jul 19 05:15:29 2006 From: bob at redivi.com (Bob Ippolito) Date: Tue, 18 Jul 2006 20:15:29 -0700 Subject: [Pythonmac-SIG] [Numpy-discussion] Packaging numpy with py2app In-Reply-To: <98FDFEDF-CB5D-4014-8214-653FC4CA1CCA@gmail.com> References: <660C6421-8C71-4B4D-A2CC-33C3FF089DF9@gmail.com> <44BC1B92.4090009@noaa.gov> <44BC1E6E.9020502@noaa.gov> <51B08665-6077-4E6F-875D-D217990B1714@redivi.com> <60E2AEE1-9BF1-4B62-A9DC-7A497310A681@gmail.com> <213C1E2D-AE4D-4578-9E22-FB49C1ACAA75@gmail.com> <9148A14B-7462-47EC-9262-52802E5A9CB4@gmail.com> <1CC7BE8A-F534-4256-A5A2-FEA2E1D2725A@redivi.com> <0039ED8C-EA8A-47BE-9967-200AF66D173A@gmail.com> <98FDFEDF-CB5D-4014-8214-653FC4CA1CCA@gmail.com> Message-ID: On Jul 18, 2006, at 7:26 PM, Josh Marshall wrote: > Thanks for the fix Bob. > > Unfortunately Matplotlib does not work with zipped data files, > after all that. So, we'll leave the recipes as is, as they work for > now. > > I suspect the way forward is to get numpy/Matplotlib/scipy working > with setuptools and using pkg_resources to manage the data files. > Any thoughts on this? Yes, that is the way. -bob From robert.kern at gmail.com Wed Jul 19 06:16:50 2006 From: robert.kern at gmail.com (Robert Kern) Date: Tue, 18 Jul 2006 23:16:50 -0500 Subject: [Pythonmac-SIG] Packaging numpy with py2app In-Reply-To: <0039ED8C-EA8A-47BE-9967-200AF66D173A@gmail.com> References: <660C6421-8C71-4B4D-A2CC-33C3FF089DF9@gmail.com> <44BC1B92.4090009@noaa.gov> <44BC1E6E.9020502@noaa.gov> <51B08665-6077-4E6F-875D-D217990B1714@redivi.com> <60E2AEE1-9BF1-4B62-A9DC-7A497310A681@gmail.com> <213C1E2D-AE4D-4578-9E22-FB49C1ACAA75@gmail.com> <9148A14B-7462-47EC-9262-52802E5A9CB4@gmail.com> <1CC7BE8A-F534-4256-A5A2-FEA2E1D2725A@redivi.com> <0039ED8C-EA8A-47BE-9967-200AF66D173A@gmail.com> Message-ID: Josh Marshall wrote: > so it seems like the entire purpose of PackageLoader is to make life > difficult for me, just to save a few lines of typing. :) Seriously, > can a numpy developer tell me why PackageLoader is necessary? I can't think of a good reason why it's used in __init__.py the way it is (it used to have postpone=True). If Pearu, who wrote that bit of code, doesn't speak up by Thursday, I'll have it removed in favor of regular imports for the beta. -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad attempt to interpret it as though it had an underlying truth." -- Umberto Eco From bob at redivi.com Wed Jul 19 07:27:04 2006 From: bob at redivi.com (Bob Ippolito) Date: Tue, 18 Jul 2006 22:27:04 -0700 Subject: [Pythonmac-SIG] Packaging numpy with py2app In-Reply-To: References: <660C6421-8C71-4B4D-A2CC-33C3FF089DF9@gmail.com> <44BC1B92.4090009@noaa.gov> <44BC1E6E.9020502@noaa.gov> <51B08665-6077-4E6F-875D-D217990B1714@redivi.com> <60E2AEE1-9BF1-4B62-A9DC-7A497310A681@gmail.com> <213C1E2D-AE4D-4578-9E22-FB49C1ACAA75@gmail.com> <9148A14B-7462-47EC-9262-52802E5A9CB4@gmail.com> <1CC7BE8A-F534-4256-A5A2-FEA2E1D2725A@redivi.com> <0039ED8C-EA8A-47BE-9967-200AF66D173A@gmail.com> Message-ID: <61EE48D5-1689-4C46-9CDA-C1BF76500B5E@redivi.com> On Jul 18, 2006, at 9:16 PM, Robert Kern wrote: > Josh Marshall wrote: >> so it seems like the entire purpose of PackageLoader is to make life >> difficult for me, just to save a few lines of typing. :) Seriously, >> can a numpy developer tell me why PackageLoader is necessary? > > I can't think of a good reason why it's used in __init__.py the way > it is (it > used to have postpone=True). If Pearu, who wrote that bit of code, > doesn't speak > up by Thursday, I'll have it removed in favor of regular imports > for the beta. Note that all you need is the bytecode, it doesn't have to actually execute. So you can still use whatever custom import junk if you really want to: def _modulegraph_hints(): import foo You should do it in a dead function instead of "if 0" because dead functions will never be stripped by the compiler but dead code blocks sometimes are. -bob From ewestra at gmail.com Wed Jul 19 10:20:34 2006 From: ewestra at gmail.com (Erik Westra) Date: Wed, 19 Jul 2006 20:20:34 +1200 Subject: [Pythonmac-SIG] Universal wxPython app fails when run on second (PPC) machine In-Reply-To: <39C52B45-09FC-4743-90EE-43A190EF6FE1@mac.com> References: <39C52B45-09FC-4743-90EE-43A190EF6FE1@mac.com> Message-ID: <4890A140-CB3A-4CE4-92D8-B9E1857A59A8@gmail.com> Hello again, Sorry for taking so long to reply -- I've been swamped with other work lately. > I cannot reproduce this with the most recent version of py2app (the > one you'll get when installing pyobjc from subversion). That also > claims to be 0.2.5, but I don't know how different it is from the > one in the package repository. I had a report today from one of the people in my development team who also has a MacBook, and had exactly the same error message on his Intel-based machine: > Traceback (most recent call last): > File "/Users/awt/Risk Reporter/Risk Reporter.app/Contents/ > Resources/main.py", line 57, in main > File "Framework.pyc", line 264, in run > File "main.py", line 82, in startup > File "main.py", line 21, in __init__ > File "library/utilities/wxUtils.py", line 388, in __init__ > File "Framework.pyc", line 122, in get > File "Framework.pyc", line 350, in _getPythonModule > File "library/Workbench/Workbench.py", line 30, in ? > File "Framework.pyc", line 134, in get > File "Framework.pyc", line 350, in _getPythonModule > File "library/Workbench/PythonShell.py", line 11, in ? > File "wx/py/__init__.pyc", line 8, in ? > File "wx/py/crust.pyc", line 15, in ? > File "wx/py/editwindow.pyc", line 8, in ? > File "wx/stc.pyc", line 10, in ? > File "wx/_stc.pyc", line 18, in ? > File "wx/_stc.pyc", line 11, in __load > ImportError: Failure linking new module: /Users/awt/Risk Reporter/ > Risk Reporter.app/Contents/Resources/Python/lib-dynload/wx/_stc.so: > Library not loaded: /usr/local/lib/wxPython-ansi-2.6.3.2rc2/lib/ > libwx_macd-2.6.0.dylib > Referenced from: /Users/awt/Risk Reporter/Risk Reporter.app/ > Contents/MacOS/../Frameworks/libwx_macd_stc- 2.6.0.dylib > Reason: image not found So I don't think this is a universal binary problem, but rather a more general problem with standalone wxPython apps built using py2app, regardless of whether they are run on an Intel machine or a PPC machine. > I've tested by building the doodle example on an intel box and then > running it on a PPC box (that doesn't have wxPython installled). Doodle works fine, on both Intel and PPC. But when I tried building demo/PyCrust.py into a standalone application and running it on a separate machine, the above error message reappeared. So it's not just my particular application that's failing -- it seems to be a more general problem with any wxPython application that makes use of wx.stc. Any suggestions for how I can fix this? I'm going to try disabling the use of PyCrust in my application for now -- but it'd be good to be able to fix this properly. Thanks, - Erik. From alansliu at gmail.com Wed Jul 19 09:17:01 2006 From: alansliu at gmail.com (Alan Liu) Date: Wed, 19 Jul 2006 00:17:01 -0700 Subject: [Pythonmac-SIG] py2app -- can't import os module?! Message-ID: <9afe948e0607190017sb6a3bbat26a5317c73c848a1@mail.gmail.com> Hi, I hoping someone might recognize this right away. I have no idea what's gone wrong. I have a wxPython app that works fine on python 2.3 (vendor) and py2app. Now I'm trying to get the same to work with python 2.4.3 and wxPython 2.6.xand py2app from pyobjc-1.4-python2.4-macosx10.4.dmg. It appears to build fine but I get a very strange error when I try to execute the standalone: 'import site' failed; use -v for traceback Traceback (most recent call last): File "./ImageDaemon.py", line 3, in ? import os zipimport.ZipImportError: can't find module 'os' Any hints? Alan -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/pythonmac-sig/attachments/20060719/e16172ef/attachment.html From energias.renovables.ya at gmail.com Wed Jul 19 15:41:01 2006 From: energias.renovables.ya at gmail.com (Perico) Date: Wed, 19 Jul 2006 15:41:01 +0200 Subject: [Pythonmac-SIG] i18n Message-ID: Do anybody knows how to run i18n on pythoncard? I can run on files .py but no on .rsrc.py files Any weblink? I have browsed on the web but I haven't found anything of interest Regards -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/pythonmac-sig/attachments/20060719/12a3fc03/attachment.html From acn at carbontechnologies.com Wed Jul 19 19:52:16 2006 From: acn at carbontechnologies.com (Apple Consultants Network) Date: Wed, 19 Jul 2006 13:52:16 -0400 Subject: [Pythonmac-SIG] Adding resource fork support to tarfile.py In-Reply-To: <218B3F58-0A02-49CE-923C-61137F6F5445@physics.mcmaster.ca> References: <804F1D6E-4A11-42D7-A499-E9774FBBC2AA@carbontechnologies.com> <218B3F58-0A02-49CE-923C-61137F6F5445@physics.mcmaster.ca> Message-ID: <3443489C-A218-4368-A8EF-9EFFF55FD5BB@carbontechnologies.com> On Jul 18, 2006, at 6:45 PM, David M. Cooke wrote: > > You've got to explicitly handle the resource fork yourself. The tar > format (AFAIK) doesn't support any notion of extra metadata or > forks of a file. Tiger's tar fakes it by saving the resource fork > as a separate file with '._' added to the front (e.g., for > 'hello.font', it stores the data fork as 'hello.font', and the > resource fork as '._hello.font'). > > I've attached two scripts I wrote a while ago that handle the > resource forks in this way. > David, Thank you very much for the scripts. I am just about to dig into them today. I was afraid that this would be the case. I was hoping the support for resources forks would come for free under Tiger. Again, I really appreciate the help. Reid > -- > |>|\/|< > /------------------------------------------------------------------\ > |David M. Cooke http://arbutus.physics.mcmaster.ca/dmc/ > |cookedm at physics.mcmaster.ca > > > From bob at redivi.com Wed Jul 19 20:00:59 2006 From: bob at redivi.com (Bob Ippolito) Date: Wed, 19 Jul 2006 11:00:59 -0700 Subject: [Pythonmac-SIG] Adding resource fork support to tarfile.py In-Reply-To: <3443489C-A218-4368-A8EF-9EFFF55FD5BB@carbontechnologies.com> References: <804F1D6E-4A11-42D7-A499-E9774FBBC2AA@carbontechnologies.com> <218B3F58-0A02-49CE-923C-61137F6F5445@physics.mcmaster.ca> <3443489C-A218-4368-A8EF-9EFFF55FD5BB@carbontechnologies.com> Message-ID: <64E8A5CD-CEDD-4AA4-83CD-0E451E6CAED5@redivi.com> On Jul 19, 2006, at 10:52 AM, Apple Consultants Network wrote: > > On Jul 18, 2006, at 6:45 PM, David M. Cooke wrote: > >> >> You've got to explicitly handle the resource fork yourself. The tar >> format (AFAIK) doesn't support any notion of extra metadata or >> forks of a file. Tiger's tar fakes it by saving the resource fork >> as a separate file with '._' added to the front (e.g., for >> 'hello.font', it stores the data fork as 'hello.font', and the >> resource fork as '._hello.font'). >> >> I've attached two scripts I wrote a while ago that handle the >> resource forks in this way. >> > > David, > > Thank you very much for the scripts. I am just about to dig into > them today. I was afraid that this would be the case. I was hoping > the support for resources forks would come for free under Tiger. > Again, I really appreciate the help. One would hope, but Apple forgot to expose the hooks that they're using in the command-line tools... so third party developers still have to deal with resource forks by hand. The only difference now is that they can alternatively use the xattr API to do so, but that's not much of a win. -bob From bob at redivi.com Wed Jul 19 20:34:44 2006 From: bob at redivi.com (Bob Ippolito) Date: Wed, 19 Jul 2006 11:34:44 -0700 Subject: [Pythonmac-SIG] py2app -- can't import os module?! In-Reply-To: <9afe948e0607190017sb6a3bbat26a5317c73c848a1@mail.gmail.com> References: <9afe948e0607190017sb6a3bbat26a5317c73c848a1@mail.gmail.com> Message-ID: <8E61473D-A473-40D7-AE70-6013DB52CAE6@redivi.com> On Jul 19, 2006, at 12:17 AM, Alan Liu wrote: > I have a wxPython app that works fine on python 2.3 (vendor) and > py2app. > > Now I'm trying to get the same to work with python 2.4.3 and > wxPython 2.6.x and py2app from pyobjc-1.4-python2.4-macosx10.4.dmg. That's not the py2app to use. See here: http://mail.python.org/pipermail/pythonmac-sig/2006-July/017766.html -bob From Chris.Barker at noaa.gov Wed Jul 19 22:14:27 2006 From: Chris.Barker at noaa.gov (Christopher Barker) Date: Wed, 19 Jul 2006 13:14:27 -0700 Subject: [Pythonmac-SIG] [Numpy-discussion] Packaging numpy with py2app In-Reply-To: References: <660C6421-8C71-4B4D-A2CC-33C3FF089DF9@gmail.com> <44BC1B92.4090009@noaa.gov> <44BC1E6E.9020502@noaa.gov> <51B08665-6077-4E6F-875D-D217990B1714@redivi.com> <60E2AEE1-9BF1-4B62-A9DC-7A497310A681@gmail.com> <213C1E2D-AE4D-4578-9E22-FB49C1ACAA75@gmail.com> <9148A14B-7462-47EC-9262-52802E5A9CB4@gmail.com> <1CC7BE8A-F534-4256-A5A2-FEA2E1D2725A@redivi.com> <0039ED8C-EA8A-47BE-9967-200AF66D173A@gmail.com> Message-ID: <44BE92A3.2000205@noaa.gov> Bob Ippolito wrote: > This should work in svn (r13). You can easily run the development > version straight from a svn checkout: > > svn co http://svn.pythonmac.org/py2app/py2app/trunk py2app > cd py2app > python setup.py develop A get: Fetching external item into 'py2app2/ez_setup' svn: Can't connect to host 'svn.eby-sarna.com': Operation timed out But I thought I'd try it anyway: python setup.py develop Traceback (most recent call last): File "setup.py", line 3, in ? import ez_setup ImportError: No module named ez_setup I had this same problem the other day, and just put the latest copy of ez_setup.py that I had in there. Somehow that doesn't seem right, however. -Chris -- Christopher Barker, Ph.D. Oceanographer NOAA/OR&R/HAZMAT (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 bob at redivi.com Wed Jul 19 23:17:06 2006 From: bob at redivi.com (Bob Ippolito) Date: Wed, 19 Jul 2006 14:17:06 -0700 Subject: [Pythonmac-SIG] [Numpy-discussion] Packaging numpy with py2app In-Reply-To: <44BE92A3.2000205@noaa.gov> References: <660C6421-8C71-4B4D-A2CC-33C3FF089DF9@gmail.com> <44BC1B92.4090009@noaa.gov> <44BC1E6E.9020502@noaa.gov> <51B08665-6077-4E6F-875D-D217990B1714@redivi.com> <60E2AEE1-9BF1-4B62-A9DC-7A497310A681@gmail.com> <213C1E2D-AE4D-4578-9E22-FB49C1ACAA75@gmail.com> <9148A14B-7462-47EC-9262-52802E5A9CB4@gmail.com> <1CC7BE8A-F534-4256-A5A2-FEA2E1D2725A@redivi.com> <0039ED8C-EA8A-47BE-9967-200AF66D173A@gmail.com> <44BE92A3.2000205@noaa.gov> Message-ID: <63624E7D-4DBD-44A7-B6C0-D267F7DCD579@redivi.com> On Jul 19, 2006, at 1:14 PM, Christopher Barker wrote: > Bob Ippolito wrote: > >> This should work in svn (r13). You can easily run the development >> version straight from a svn checkout: >> svn co http://svn.pythonmac.org/py2app/py2app/trunk py2app >> cd py2app >> python setup.py develop > > A get: > > Fetching external item into 'py2app2/ez_setup' > svn: Can't connect to host 'svn.eby-sarna.com': Operation timed out > > But I thought I'd try it anyway: > > python setup.py develop > Traceback (most recent call last): > File "setup.py", line 3, in ? > import ez_setup > ImportError: No module named ez_setup > > > I had this same problem the other day, and just put the latest copy > of ez_setup.py that I had in there. Somehow that doesn't seem > right, however. Sounds like you're behind some kind of gnarly proxy or firewall that doesn't let you talk to SVN servers that aren't behind HTTP (svn protocol, TCP port 3690). I'm not going to "fix" this, because that would require me maintaining copies of ez_setup in all of my projects (which change every time setuptools is released). I suggest you talk to your network admin and plead with them to open that up. In the meantime the workaround is to download "ez_setup.py" as you have done and use --ignore-externals every time you do "svn up". -bob From alansliu at gmail.com Thu Jul 20 06:08:50 2006 From: alansliu at gmail.com (Alan Liu) Date: Wed, 19 Jul 2006 21:08:50 -0700 Subject: [Pythonmac-SIG] py2app -- can't import os module?! In-Reply-To: <8E61473D-A473-40D7-AE70-6013DB52CAE6@redivi.com> References: <9afe948e0607190017sb6a3bbat26a5317c73c848a1@mail.gmail.com> <8E61473D-A473-40D7-AE70-6013DB52CAE6@redivi.com> Message-ID: <9afe948e0607192108y4953b463vddf6025f5180cf36@mail.gmail.com> Thanks -- I had to go to *site-packages* to find my old install of py2app and now I have py2app 0.3.1 installed. I hope more stuff is supported via easy_install in the future. - Alan On 7/19/06, Bob Ippolito wrote: > > > On Jul 19, 2006, at 12:17 AM, Alan Liu wrote: > > > I have a wxPython app that works fine on python 2.3 (vendor) and > > py2app. > > > > Now I'm trying to get the same to work with python 2.4.3 and > > wxPython 2.6.x and py2app from pyobjc-1.4-python2.4-macosx10.4.dmg. > > That's not the py2app to use. > > See here: > http://mail.python.org/pipermail/pythonmac-sig/2006-July/017766.html > > -bob > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/pythonmac-sig/attachments/20060719/559e3614/attachment.htm From alansliu at gmail.com Thu Jul 20 06:25:11 2006 From: alansliu at gmail.com (Alan Liu) Date: Wed, 19 Jul 2006 21:25:11 -0700 Subject: [Pythonmac-SIG] py2app -- can't import os module?! In-Reply-To: <9afe948e0607192108y4953b463vddf6025f5180cf36@mail.gmail.com> References: <9afe948e0607190017sb6a3bbat26a5317c73c848a1@mail.gmail.com> <8E61473D-A473-40D7-AE70-6013DB52CAE6@redivi.com> <9afe948e0607192108y4953b463vddf6025f5180cf36@mail.gmail.com> Message-ID: <9afe948e0607192125n5211581bjda1273e733124ff2@mail.gmail.com> Hi Bob: Ok, I now see my problem has nothing to do with the version of py2app. I'm trying to launch a second python process. I see you commented on this over a year ago: http://mail.python.org/pipermail/pythonmac-sig/2005-April/013851.html I'll try some of your advice in that post. Thanks, - Alan On 7/19/06, Alan Liu wrote: > > Thanks -- I had to go to *site-packages* to find my old install of py2app > and now I have py2app 0.3.1 installed. > > I hope more stuff is supported via easy_install in the future. > - Alan > > > On 7/19/06, Bob Ippolito wrote: > > > > > > On Jul 19, 2006, at 12:17 AM, Alan Liu wrote: > > > > > I have a wxPython app that works fine on python 2.3 (vendor) and > > > py2app. > > > > > > Now I'm trying to get the same to work with python 2.4.3 and > > > wxPython 2.6.x and py2app from pyobjc-1.4-python2.4-macosx10.4.dmg. > > > > That's not the py2app to use. > > > > See here: > > http://mail.python.org/pipermail/pythonmac-sig/2006-July/017766.html > > > > -bob > > > > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/pythonmac-sig/attachments/20060719/92d3521e/attachment.html From rstephe at alumni.princeton.edu Thu Jul 20 08:29:45 2006 From: rstephe at alumni.princeton.edu (Robert Stephenson) Date: Wed, 19 Jul 2006 23:29:45 -0700 Subject: [Pythonmac-SIG] appscript equivalent of launch? Message-ID: As far as I can see, appscript lacks an equivalent of Applescript's launch verb, which opens an app without running it (useful for apps like Textedit or Keynote that create default documents when they run). Did I miss something, or how can you open a file without the default run action? * * * * * * * * * * * * * * * * * * * * * * * * Dr. Robert S. Stephenson * E-learning Architect * rstephe at alumni.princeton.edu * (415) 341-3784 * http://sun.science.wayne.edu/~rstephe * * Community Manager * Global Education & Learning Community on Java.net * http://gelc.org * * Chief Architect and Principal Investigator * http://OpenCourse.Org * Supporting virtual communities of e-learning developers. * * Founder * The Harvey Project * Open Course Physiology on the Web * http://HarveyProject.org * * Was I helpful? Let others know: * http://rate.affero.net/rstephe * * gpg key fingerprint: * 4255 FB43 17C8 2B80 8074 7DB6 7DD7 939B F3F6 CB92 * * * * * * * * * * * * * * * * * * * * * * * -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/pythonmac-sig/attachments/20060719/349b4924/attachment.html From njriley at uiuc.edu Thu Jul 20 13:58:07 2006 From: njriley at uiuc.edu (Nicholas Riley) Date: Thu, 20 Jul 2006 06:58:07 -0500 Subject: [Pythonmac-SIG] appscript equivalent of launch? In-Reply-To: References: Message-ID: <20060720115807.GA23330@uiuc.edu> On Wed, Jul 19, 2006 at 11:29:45PM -0700, Robert Stephenson wrote: > As far as I can see, appscript lacks an equivalent of Applescript's > launch verb, which opens an app without running it (useful for apps > like Textedit or Keynote that create default documents when they > run). Did I miss something, or how can you open a file without the > default run action? AppleScript actually does two different things when you 'launch app "XYZ"'. First, it opens the app in the background; second, it sends a "launch" event (ascr/noop) to the process. Python doesn't wrap the pieces of Launch Services needed to pass an initial Apple Event to an application, so appscript can't do this - though it could. I just updated my 'launch' tool to do this. Feel free to steal the appropriate code. Examples: % launch -Li com.apple.TextEdit - launches in foreground, no window % launch -Lbi com.apple.TextEdit - launches in background, no window, like AppleScript Note - if the application is already running, the above commands still open a window. To truly emulate AppleScript you'd need to check if the app is already running, and if so, don't do anything. -- Nicholas Riley | From hengist.podd at virgin.net Thu Jul 20 15:55:22 2006 From: hengist.podd at virgin.net (has) Date: Thu, 20 Jul 2006 14:55:22 +0100 Subject: [Pythonmac-SIG] appscript equivalent of launch? In-Reply-To: References: Message-ID: Robert Stephenson wrote: > As far as I can see, appscript lacks an equivalent of Applescript's > launch verb, which opens an app without running it (useful for apps > like Textedit or Keynote that create default documents when they > run). Did I miss something, or how can you open a file without the > default run action? Appscript does implement a built-in launch command: app('textedit').launch() However, it doesn't work at all right, so don't bother trying it. The only way I can currently think of doing it is to use AS: import osax osax.runscript('launch app "TextEdit"') If anyone knows how to launch apps without them being sent the customary run event then please let me know. has -- http://freespace.virgin.net/hamish.sanderson/ From kw at kevin-walzer.com Thu Jul 20 16:10:29 2006 From: kw at kevin-walzer.com (Kevin Walzer) Date: Thu, 20 Jul 2006 10:10:29 -0400 Subject: [Pythonmac-SIG] appscript equivalent of launch? In-Reply-To: References: Message-ID: <44BF8ED5.4040009@kevin-walzer.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 has wrote: > Robert Stephenson wrote: > >> As far as I can see, appscript lacks an equivalent of Applescript's >> launch verb, which opens an app without running it (useful for apps >> like Textedit or Keynote that create default documents when they >> run). Did I miss something, or how can you open a file without the >> default run action? > > Appscript does implement a built-in launch command: > > app('textedit').launch() > > However, it doesn't work at all right, so don't bother trying it. The > only way I can currently think of doing it is to use AS: > > import osax > osax.runscript('launch app "TextEdit"') > > > If anyone knows how to launch apps without them being sent the > customary run event then please let me know. > > has How about: import os os.system('open -a TextEdit.app') - -- Kevin Walzer Poetic Code http://www.kevin-walzer.com -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.1 (Darwin) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD4DBQFEv47VrTC5hIgjqTMRArHGAKCnoyiNNrLBccXwQqx2sb9I8LpN6ACY/Vts msULOdVrL+tdEPsVaI+gww== =QymW -----END PGP SIGNATURE----- From hengist.podd at virgin.net Thu Jul 20 16:31:16 2006 From: hengist.podd at virgin.net (has) Date: Thu, 20 Jul 2006 15:31:16 +0100 Subject: [Pythonmac-SIG] appscript equivalent of launch? In-Reply-To: <44BF8ED5.4040009@kevin-walzer.com> References: <44BF8ED5.4040009@kevin-walzer.com> Message-ID: <1C0DE3C5-D8E3-4F5E-9B75-443DE879A929@virgin.net> Kevin Walzer wrote: > import os > > os.system('open -a TextEdit.app') Still ends up sending a run event, unfortunately. The goal is to launch the app without it opening an empty document, as 'launch app "TextEdit"' does. Ta, has -- http://freespace.virgin.net/hamish.sanderson/ From Laurent.Pierron at loria.fr Thu Jul 20 16:54:48 2006 From: Laurent.Pierron at loria.fr (Laurent Pierron) Date: Thu, 20 Jul 2006 16:54:48 +0200 Subject: [Pythonmac-SIG] appscript equivalent of launch? In-Reply-To: <1C0DE3C5-D8E3-4F5E-9B75-443DE879A929@virgin.net> References: <44BF8ED5.4040009@kevin-walzer.com> <1C0DE3C5-D8E3-4F5E-9B75-443DE879A929@virgin.net> Message-ID: <759cd84655fa2864d78d8229fab62489@loria.fr> Le 20 juil. 06, ? 16:31, has a ?crit : > Kevin Walzer wrote: > >> import os >> >> os.system('open -a TextEdit.app') > > Still ends up sending a run event, unfortunately. The goal is to > launch the app without it opening an empty document, as 'launch app > "TextEdit"' does. > Try that : os.system('osascript -e \'launch application "textedit"\'') -- Laurent PIERRON From hengist.podd at virgin.net Thu Jul 20 18:33:05 2006 From: hengist.podd at virgin.net (has) Date: Thu, 20 Jul 2006 17:33:05 +0100 Subject: [Pythonmac-SIG] appscript equivalent of launch? In-Reply-To: <759cd84655fa2864d78d8229fab62489@loria.fr> References: <44BF8ED5.4040009@kevin-walzer.com> <1C0DE3C5-D8E3-4F5E-9B75-443DE879A929@virgin.net> <759cd84655fa2864d78d8229fab62489@loria.fr> Message-ID: <4EC881CA-791E-44B2-AE30-8FF93E2637A8@virgin.net> Laurent Pierron wrote: > Try that : > > os.system('osascript -e \'launch application "textedit"\'') Yeah, calling AS is a last-ditch option, but I'm hoping someone'll know how to do it via the Python standard library or an OS call. (It'd be terribly ignominious for appscript to have to resort to calling AppleScript.;) I'm going to look at Kevin's launch tool and see how it does it later on. Cheers, has -- http://freespace.virgin.net/hamish.sanderson/ From rstephe at alumni.princeton.edu Thu Jul 20 18:52:31 2006 From: rstephe at alumni.princeton.edu (Robert Stephenson) Date: Thu, 20 Jul 2006 09:52:31 -0700 Subject: [Pythonmac-SIG] appscript equivalent of launch? In-Reply-To: <4EC881CA-791E-44B2-AE30-8FF93E2637A8@virgin.net> References: <44BF8ED5.4040009@kevin-walzer.com> <1C0DE3C5-D8E3-4F5E-9B75-443DE879A929@virgin.net> <759cd84655fa2864d78d8229fab62489@loria.fr> <4EC881CA-791E-44B2-AE30-8FF93E2637A8@virgin.net> Message-ID: <39ED2747-26A7-4D89-9BA6-21BE497438BE@alumni.princeton.edu> Thanks, folks, I thought I might have missed something. I appreciate the suggestions and comments. You guys are great! - Rob On Jul 20, 2006, at 9:33 AM, has wrote: > Laurent Pierron wrote: > >> Try that : >> >> os.system('osascript -e \'launch application "textedit"\'') > > Yeah, calling AS is a last-ditch option, but I'm hoping someone'll > know how to do it via the Python standard library or an OS call. > (It'd be terribly ignominious for appscript to have to resort to > calling AppleScript.;) I'm going to look at Kevin's launch tool and > see how it does it later on. > > Cheers, > > has > -- > http://freespace.virgin.net/hamish.sanderson/ > > > _______________________________________________ > Pythonmac-SIG maillist - Pythonmac-SIG at python.org > http://mail.python.org/mailman/listinfo/pythonmac-sig > * * * * * * * * * * * * * * * * * * * * * * * * Dr. Robert S. Stephenson * E-learning Architect * rstephe at alumni.princeton.edu * (415) 341-3784 * http://sun.science.wayne.edu/~rstephe * * Community Manager * Global Education & Learning Community on Java.net * http://gelc.org * * Chief Architect and Principal Investigator * http://OpenCourse.Org * Supporting virtual communities of e-learning developers. * * Founder * The Harvey Project * Open Course Physiology on the Web * http://HarveyProject.org * * Was I helpful? Let others know: * http://rate.affero.net/rstephe * * gpg key fingerprint: * 4255 FB43 17C8 2B80 8074 7DB6 7DD7 939B F3F6 CB92 * * * * * * * * * * * * * * * * * * * * * * * -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/pythonmac-sig/attachments/20060720/75fff409/attachment.htm From kw at kevin-walzer.com Thu Jul 20 18:54:13 2006 From: kw at kevin-walzer.com (Kevin Walzer) Date: Thu, 20 Jul 2006 12:54:13 -0400 Subject: [Pythonmac-SIG] Running "freeze" on non-framework Python/universal binary issues Message-ID: <44BFB535.5020607@kevin-walzer.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 I'm trying to learn how to "freeze" an application that links against a non-framework build of Python. The basic mechanism works fine when I try a vanilla install of PPC Python 2.4 via Fink: /sw/bin/python freeze.py hello.py ...lots of messages make ....lots more messages ./hello Hello world... Kevin-Walzers-Computer:~/python24-fat/Tools/freeze kevin$ file hello hello: Mach-O executable ppc "freeze" is having problems with my non-framework "universal" build of Python 2.4, however. It seems to be gagging on the "arch" flags. Here's a typical error message: /usr/bin/ld: warning M_rfc822.o cputype (18, architecture ppc) does not match cputype (7) for specified -arch flag: i386 (file not loaded) I probably need to figure out a way to get the right flags passed on to "freeze" or "make" so that the i386 object files are built also; right now it's only outputting ppc files. Here's the command that runs: gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes - -I/usr/local/python-unix/include/python2.4 - -I/usr/local/python-unix/include/python2.4 -c M_traceback.c Any advice? (I'm trying "freeze" because py2app doesn't seem to play nicely with non-framework builds, and I have no clue how to fix it.) - -- Kevin Walzer Poetic Code http://www.kevin-walzer.com -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.1 (Darwin) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFEv7U1rTC5hIgjqTMRAi1kAKCKeL5DeE44ff873gSvdPMQnmt2BQCghN6W JFPOJi2dzH20pgNdmByZzI4= =Q1F6 -----END PGP SIGNATURE----- From kw at kevin-walzer.com Thu Jul 20 19:34:32 2006 From: kw at kevin-walzer.com (Kevin Walzer) Date: Thu, 20 Jul 2006 13:34:32 -0400 Subject: [Pythonmac-SIG] Running "freeze" on non-framework Python/universal binary issues In-Reply-To: <44BFB535.5020607@kevin-walzer.com> References: <44BFB535.5020607@kevin-walzer.com> Message-ID: <44BFBEA8.3070900@kevin-walzer.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Looks like hacking the makefile generated by freeze.py solves the problem. Copying the args from BASCFLAGS to CFLAGS results in a universal binary. CFLAGS=-arch ppc -arch i386 -isysroot /Developer/SDKs/MacOSX10.4u.sdk - -fno-strict-aliasing -Wno-long-double -no-cpp-precomp -mno-fused-madd # $(OPT) Kevin-Walzers-Computer:~/python24-fat/Tools/freeze kevin$ ./hello Hello world... Kevin-Walzers-Computer:~/python24-fat/Tools/freeze kevin$ file hello hello: Mach-O fat file with 2 architectures hello (for architecture ppc): Mach-O executable ppc hello (for architecture i386): Mach-O executable i386 Kevin-Walzers-Computer:~/python24-fat/Tools/freeze kevin$ _______________________________________________ Pythonmac-SIG maillist - Pythonmac-SIG at python.org http://mail.python.org/mailman/listinfo/pythonmac-sig - -- Kevin Walzer Poetic Code http://www.kevin-walzer.com -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.1 (Darwin) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFEv76orTC5hIgjqTMRAuq4AKCVpF1+BR4UCoQfKYTeXqprDcxz+QCeLm1Q Nxz6OS1vz9WG8evxqg7MPIo= =Dr7+ -----END PGP SIGNATURE----- From bob at redivi.com Thu Jul 20 19:50:56 2006 From: bob at redivi.com (Bob Ippolito) Date: Thu, 20 Jul 2006 10:50:56 -0700 Subject: [Pythonmac-SIG] Running "freeze" on non-framework Python/universal binary issues In-Reply-To: <44BFB535.5020607@kevin-walzer.com> References: <44BFB535.5020607@kevin-walzer.com> Message-ID: <0BCB2276-F73C-431B-A957-209008EC28BC@redivi.com> On Jul 20, 2006, at 9:54 AM, Kevin Walzer wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > I'm trying to learn how to "freeze" an application that links > against a > non-framework build of Python. The basic mechanism works fine when > I try > a vanilla install of PPC Python 2.4 via Fink: > > /sw/bin/python freeze.py hello.py > ...lots of messages > make > ....lots more messages > ./hello > Hello world... > Kevin-Walzers-Computer:~/python24-fat/Tools/freeze kevin$ file hello > hello: Mach-O executable ppc > > "freeze" is having problems with my non-framework "universal" build of > Python 2.4, however. It seems to be gagging on the "arch" flags. > Here's > a typical error message: > > /usr/bin/ld: warning M_rfc822.o cputype (18, architecture ppc) does > not > match cputype (7) for specified -arch flag: i386 (file not loaded) > > I probably need to figure out a way to get the right flags passed > on to > "freeze" or "make" so that the i386 object files are built also; right > now it's only outputting ppc files. Here's the command that runs: > > gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes > - -I/usr/local/python-unix/include/python2.4 > - -I/usr/local/python-unix/include/python2.4 -c M_traceback.c > > > Any advice? > > (I'm trying "freeze" because py2app doesn't seem to play nicely with > non-framework builds, and I have no clue how to fix it.) The other question is why the heck are you using a non-framework build? You may have better luck with cx_Freeze than the built-in freeze tool. I've never tried either on Mac OS X. -bob From bob at redivi.com Thu Jul 20 20:17:51 2006 From: bob at redivi.com (Bob Ippolito) Date: Thu, 20 Jul 2006 11:17:51 -0700 Subject: [Pythonmac-SIG] [ANN] py2app 0.3.2 Message-ID: I found some time to rewrite the documentation for py2app to correspond to 0.3.2, and I've made some minor updates since the 0.3.1 release. The only change of real note in 0.3.2 is the changes I've made to the py2applet script. It now supports taking --options, and there's a new --make-setup option (for py2applet only) that will create a template setup.py instead of building the application. e.g. "py2applet --make- setup MyApp.py datafiles..." will generate a setup.py that would do what py2applet would've done on its own. If you have 0.3.x installed, simply "easy_install -U py2app" to upgrade. If not, installation/upgrade instructions are in the docs: http://svn.pythonmac.org/py2app/py2app/trunk/doc/index.html Note that only Universal Python 2.4.3 is tested/supported at this point. Other framework builds might work, non-framework builds probably won't. Python 2.5 should work, but I believe that requires the trunk of setuptools to be installed. Also, plugin building hasn't been tested at all in the 0.3 series and is almost definitely broken (the bootstrap code in main.m probably needs to change a bit). It's also not at all documented (because I don't think it works). -bob From kw at kevin-walzer.com Thu Jul 20 20:43:10 2006 From: kw at kevin-walzer.com (Kevin Walzer) Date: Thu, 20 Jul 2006 14:43:10 -0400 Subject: [Pythonmac-SIG] Running "freeze" on non-framework Python/universal binary issues In-Reply-To: <0BCB2276-F73C-431B-A957-209008EC28BC@redivi.com> References: <44BFB535.5020607@kevin-walzer.com> <0BCB2276-F73C-431B-A957-209008EC28BC@redivi.com> Message-ID: <44BFCEBE.3010200@kevin-walzer.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Bob Ippolito wrote: > > > The other question is why the heck are you using a non-framework build? Because I'm trying to package an application that builds against X11 Tkinter. > > You may have better luck with cx_Freeze than the built-in freeze tool. > I've never tried either on Mac OS X. I've tried that briefly, it didn't seem to work, but will give it another look. - -- Kevin Walzer Poetic Code http://www.kevin-walzer.com -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.1 (Darwin) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFEv868rTC5hIgjqTMRAoxOAJ9w9c908dqgfyqb4Iy4rlGqszVBEwCgk25V Twppt930azqCQ2MSKMMRbHM= =KikO -----END PGP SIGNATURE----- From bob at redivi.com Thu Jul 20 21:19:05 2006 From: bob at redivi.com (Bob Ippolito) Date: Thu, 20 Jul 2006 12:19:05 -0700 Subject: [Pythonmac-SIG] Running "freeze" on non-framework Python/universal binary issues In-Reply-To: <44BFCEBE.3010200@kevin-walzer.com> References: <44BFB535.5020607@kevin-walzer.com> <0BCB2276-F73C-431B-A957-209008EC28BC@redivi.com> <44BFCEBE.3010200@kevin-walzer.com> Message-ID: <96866C51-39AB-4E8A-8955-4B5593BA08D7@redivi.com> On Jul 20, 2006, at 11:43 AM, Kevin Walzer wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > Bob Ippolito wrote: >> > >> >> The other question is why the heck are you using a non-framework >> build? > > Because I'm trying to package an application that builds against X11 > Tkinter. Rebuilding Python entirely seems pretty silly... it's way easier to just rebuild the _tkinter extension. You could even do it in your py2app setup.py. Just copy the sources from python. You'll probably need to do some fiddling in your main script if DISPLAY isn't set though. from setuptools import setup, Extension extensions = [ Extension('_tkinter', ['_tkinter.c', 'tkappinit.c'], define_macros=[('WITH_APPINIT', 1)], include_dirs=['/usr/X11R6/include'], library_dirs=['/usr/X11R6/lib'], libraries=['tcl8.4', 'tk8.4', 'X11'], ), ] setup( app=['MyApp.py'], extensions=extensions, setup_requires=['py2app'], ) From kaweh.kazemi at chello.at Thu Jul 20 21:32:56 2006 From: kaweh.kazemi at chello.at (Kaweh Kazemi) Date: Thu, 20 Jul 2006 21:32:56 +0200 Subject: [Pythonmac-SIG] [ANN] py2app 0.3.2 In-Reply-To: References: Message-ID: <1430102D-25F2-4C80-BE3B-FBDA0FA9DA9D@chello.at> hi, i was upgrading from a older version of py2app (pre-setuptools as far as i know), following the instruction at http://svn.pythonmac.org/ py2app/py2app/trunk/doc/index.html#installation using py2applet failed with: > $ py2applet --make-setup myapp.py > Traceback (most recent call last): > File "/usr/local/bin/py2applet", line 2, in ? > from py2app.scripts.script_py2applet import main > ImportError: No module named scripts.script_py2applet so i fixed line 2 in /usr/local/bin/py2applet to > from py2app.script_py2applet import main > i hope this was fine. i'm not sure if this was a problem with my installation or a general problem. i'm posting this if anyone else encounters this. cheers, kaweh From bob at redivi.com Thu Jul 20 22:01:22 2006 From: bob at redivi.com (Bob Ippolito) Date: Thu, 20 Jul 2006 13:01:22 -0700 Subject: [Pythonmac-SIG] [ANN] py2app 0.3.2 In-Reply-To: <1430102D-25F2-4C80-BE3B-FBDA0FA9DA9D@chello.at> References: <1430102D-25F2-4C80-BE3B-FBDA0FA9DA9D@chello.at> Message-ID: <2D37F374-03BE-4DEC-9A7C-FBE32874A44C@redivi.com> On Jul 20, 2006, at 12:32 PM, Kaweh Kazemi wrote: > hi, > > i was upgrading from a older version of py2app (pre-setuptools as > far as i know), following the instruction at http:// > svn.pythonmac.org/py2app/py2app/trunk/doc/index.html#installation > > using py2applet failed with: > >> $ py2applet --make-setup myapp.py >> Traceback (most recent call last): >> File "/usr/local/bin/py2applet", line 2, in ? >> from py2app.scripts.script_py2applet import main >> ImportError: No module named scripts.script_py2applet > > > so i fixed line 2 in /usr/local/bin/py2applet to > >> from py2app.script_py2applet import main >> > i hope this was fine. i'm not sure if this was a problem with my > installation or a general problem. i'm posting this if anyone else > encounters this. Do not use that fix. It's not at all correct (though it does happen to work in this case, mostly by chance). The problem is likely that / usr/local/bin is somehow before your python's bin path. rm /usr/local/ bin/py2applet and/or change the order of your PATH. -bob From delza at livingcode.org Thu Jul 20 22:22:32 2006 From: delza at livingcode.org (Dethe Elza) Date: Thu, 20 Jul 2006 13:22:32 -0700 Subject: [Pythonmac-SIG] ctypes for Intel-base Macs? Message-ID: <44BFE608.3070901@livingcode.org> Hi folks, I'm trying to get ctypes working on my new Macbook Pro under Python 2.4. It works under Python 2.5beta, so I assume the porting work has been done somewhere, but does not work with the downloadable version of ctypes (libffi won't build): > configure: error: "libffi has not been ported to i686-apple-darwin8.7.1." I've tried getting libffi via darwinports, but it reports the same error: > configure: error: libffi has not been ported to i386-apple-darwin8.7.1. I've tried to find the libffi shared library in Python2.5 to see if I could build ctypes around that, but all I could find was _ctypes.so. Maybe I could build around that, but I don't know what pieces I need to copy over. Any ideas for how I can get a working ctypes under 2.4 would be appreciated. Thanks! --Dethe From bob at redivi.com Thu Jul 20 22:30:45 2006 From: bob at redivi.com (Bob Ippolito) Date: Thu, 20 Jul 2006 13:30:45 -0700 Subject: [Pythonmac-SIG] ctypes for Intel-base Macs? In-Reply-To: <44BFE608.3070901@livingcode.org> References: <44BFE608.3070901@livingcode.org> Message-ID: <459FB851-4DE1-4923-8E60-7AC54AAA1BE4@redivi.com> On Jul 20, 2006, at 1:22 PM, Dethe Elza wrote: > Hi folks, > > I'm trying to get ctypes working on my new Macbook Pro under Python > 2.4. > It works under Python 2.5beta, so I assume the porting work has been > done somewhere, but does not work with the downloadable version of > ctypes (libffi won't build): > >> configure: error: "libffi has not been ported to i686-apple- >> darwin8.7.1." > > I've tried getting libffi via darwinports, but it reports the same > error: > >> configure: error: libffi has not been ported to i386-apple- >> darwin8.7.1. > > I've tried to find the libffi shared library in Python2.5 to see if I > could build ctypes around that, but all I could find was _ctypes.so. > Maybe I could build around that, but I don't know what pieces I > need to > copy over. > > Any ideas for how I can get a working ctypes under 2.4 would be > appreciated. I'm pretty sure that the version in Python 2.5 still has some i386 stack alignment bugs. Ronald has fixed them for PyObjC, but I don't think that work has migrated to ctypes yet. The version in http://svn.python.org/projects/ctypes/trunk/ctypes/ seems to be in sync with Python 2.5. -bob From delza at livingcode.org Thu Jul 20 22:45:00 2006 From: delza at livingcode.org (Dethe Elza) Date: Thu, 20 Jul 2006 13:45:00 -0700 Subject: [Pythonmac-SIG] ctypes for Intel-base Macs? In-Reply-To: <459FB851-4DE1-4923-8E60-7AC54AAA1BE4@redivi.com> References: <44BFE608.3070901@livingcode.org> <459FB851-4DE1-4923-8E60-7AC54AAA1BE4@redivi.com> Message-ID: <44BFEB4C.5080903@livingcode.org> Bob Ippolito wrote: > I'm pretty sure that the version in Python 2.5 still has some i386 stack > alignment bugs. Ronald has fixed them for PyObjC, but I don't think that > work has migrated to ctypes yet. > > The version in http://svn.python.org/projects/ctypes/trunk/ctypes/ seems > to be in sync with Python 2.5. That appears to have worked. Thanks, Bob! --Dethe From jerry.levan at eku.edu Fri Jul 21 00:53:54 2006 From: jerry.levan at eku.edu (Jerry LeVan) Date: Thu, 20 Jul 2006 18:53:54 -0400 Subject: [Pythonmac-SIG] Drag and Drop Launch of whatever.py? In-Reply-To: References: Message-ID: Hi, I can start gui python apps by the command line $: python whatever.py or if I chmod u+x whatever.py then a simple $: whatever.py will do the job. I am running python 2.4.3 on a mac ppc box with the lastest OS version. I would like a quick way to start the app by either double-click a *.py file or drag it onto a "launcher". ( CD'ing to the app folder or navigating a folder hierarchy gets aggravating... If I try to drag onto the python launcher I get a "Can't open foo.py" message. (or nothing happens) If I drag onto the IDLE Icon the file opens the editor, choosing run module will sometimes "do nothing"/Complain that the app needs pythonw"/ launch a window that that can't become frontmost... Is there a way to config PythonLauncher to launch python apps? what have I screwed up.... Thanks, Jerry From bob at redivi.com Fri Jul 21 01:10:15 2006 From: bob at redivi.com (Bob Ippolito) Date: Thu, 20 Jul 2006 16:10:15 -0700 Subject: [Pythonmac-SIG] Drag and Drop Launch of whatever.py? In-Reply-To: References: Message-ID: <2EEC3641-C89B-4D30-B472-397B1B35BC09@redivi.com> On Jul 20, 2006, at 3:53 PM, Jerry LeVan wrote: > Hi, > > I can start gui python apps by the command line > > $: python whatever.py > > or if I chmod u+x whatever.py then a simple > > $: whatever.py > > will do the job. > > I am running python 2.4.3 on a mac ppc box with the lastest OS > version. > > I would like a quick way to start the app by either double-click a > *.py file or drag it > onto a "launcher". ( CD'ing to the app folder or navigating a folder > hierarchy gets > aggravating... > > If I try to drag onto the python launcher I get a "Can't open foo.py" > message. > (or nothing happens) > > If I drag onto the IDLE Icon the file opens the editor, choosing run > module > will sometimes "do nothing"/Complain that the app needs pythonw"/ > launch a > window that that can't become frontmost... > > Is there a way to config PythonLauncher to launch python apps? what > have > I screwed up.... That's kinda strange, maybe PythonLauncher is broken. I don't think anyone has paid attention to it in a few years. You might want to try using py2app to create actual application bundles from your scripts, though. -bob From kw at kevin-walzer.com Fri Jul 21 01:18:46 2006 From: kw at kevin-walzer.com (Kevin Walzer) Date: Thu, 20 Jul 2006 19:18:46 -0400 Subject: [Pythonmac-SIG] Running "freeze" on non-framework Python/universal binary issues In-Reply-To: <96866C51-39AB-4E8A-8955-4B5593BA08D7@redivi.com> References: <44BFB535.5020607@kevin-walzer.com> <0BCB2276-F73C-431B-A957-209008EC28BC@redivi.com> <44BFCEBE.3010200@kevin-walzer.com> <96866C51-39AB-4E8A-8955-4B5593BA08D7@redivi.com> Message-ID: <44C00F56.5000608@kevin-walzer.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Bob Ippolito wrote: > > On Jul 20, 2006, at 11:43 AM, Kevin Walzer wrote: > >> -----BEGIN PGP SIGNED MESSAGE----- >> Hash: SHA1 >> >> Bob Ippolito wrote: >>> >> >>> >>> The other question is why the heck are you using a non-framework build? >> >> Because I'm trying to package an application that builds against X11 >> Tkinter. > > Rebuilding Python entirely seems pretty silly... it's way easier to just > rebuild the _tkinter extension. You could even do it in your py2app > setup.py. Just copy the sources from python. You'll probably need to do > some fiddling in your main script if DISPLAY isn't set though. > > from setuptools import setup, Extension > > extensions = [ > Extension('_tkinter', ['_tkinter.c', 'tkappinit.c'], > define_macros=[('WITH_APPINIT', 1)], > include_dirs=['/usr/X11R6/include'], > library_dirs=['/usr/X11R6/lib'], > libraries=['tcl8.4', 'tk8.4', 'X11'], > ), > ] > > setup( > app=['MyApp.py'], > extensions=extensions, > setup_requires=['py2app'], > ) > > I've already built Python to support X11 Tkinter, so that's not an issue. I finally got the built-in freeze tools to work (as a universal binary) and am running my app inside an application bundle. It uses an AppleScript launcher stub to set the DISPLAY and start up X11.app. There's some jiggering that has to be done with the installation of Tcl/Tk inside the app bundle so the frozen binary sees things correctly, but it's not too hard. After I've polished this up a bit and have released something I will document it somewhere. - -- Kevin Walzer Poetic Code http://www.kevin-walzer.com -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.1 (Darwin) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFEwA9VrTC5hIgjqTMRAkl/AJ4hVypthaBiJglH3kb3s9tvKIAwuACfd3Wb jDAiU3uXEoeBVT25Ep0DOQo= =h/WK -----END PGP SIGNATURE----- From bob at redivi.com Fri Jul 21 01:42:27 2006 From: bob at redivi.com (Bob Ippolito) Date: Thu, 20 Jul 2006 16:42:27 -0700 Subject: [Pythonmac-SIG] Running "freeze" on non-framework Python/universal binary issues In-Reply-To: <44C00F56.5000608@kevin-walzer.com> References: <44BFB535.5020607@kevin-walzer.com> <0BCB2276-F73C-431B-A957-209008EC28BC@redivi.com> <44BFCEBE.3010200@kevin-walzer.com> <96866C51-39AB-4E8A-8955-4B5593BA08D7@redivi.com> <44C00F56.5000608@kevin-walzer.com> Message-ID: <079AB69E-DB91-45F0-8791-107E1A3329E4@redivi.com> On Jul 20, 2006, at 4:18 PM, Kevin Walzer wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > Bob Ippolito wrote: >> >> On Jul 20, 2006, at 11:43 AM, Kevin Walzer wrote: >> >>> -----BEGIN PGP SIGNED MESSAGE----- >>> Hash: SHA1 >>> >>> Bob Ippolito wrote: >>>> >>> >>>> >>>> The other question is why the heck are you using a non-framework >>>> build? >>> >>> Because I'm trying to package an application that builds against X11 >>> Tkinter. >> >> Rebuilding Python entirely seems pretty silly... it's way easier >> to just >> rebuild the _tkinter extension. You could even do it in your py2app >> setup.py. Just copy the sources from python. You'll probably need >> to do >> some fiddling in your main script if DISPLAY isn't set though. >> >> from setuptools import setup, Extension >> >> extensions = [ >> Extension('_tkinter', ['_tkinter.c', 'tkappinit.c'], >> define_macros=[('WITH_APPINIT', 1)], >> include_dirs=['/usr/X11R6/include'], >> library_dirs=['/usr/X11R6/lib'], >> libraries=['tcl8.4', 'tk8.4', 'X11'], >> ), >> ] >> >> setup( >> app=['MyApp.py'], >> extensions=extensions, >> setup_requires=['py2app'], >> ) >> >> > > I've already built Python to support X11 Tkinter, so that's not an > issue. > > I finally got the built-in freeze tools to work (as a universal > binary) > and am running my app inside an application bundle. It uses an > AppleScript launcher stub to set the DISPLAY and start up X11.app. > There's some jiggering that has to be done with the installation of > Tcl/Tk inside the app bundle so the frozen binary sees things > correctly, > but it's not too hard. After I've polished this up a bit and have > released something I will document it somewhere. You wouldn't need to do all the jiggering or rebuilding of things if you had just swapped out _tkinter.so. If I were doing it I'd check for DISPLAY and look at the output of "/ usr/X11R6/bin/xauth list" to see if X11 is running. If not, then start X11 and wait for ~/.Xauthority to show up. Would probably be faster than going through AppleScript, and the how to documentation would be a heck of a lot shorter. -bob From Chris.Barker at noaa.gov Fri Jul 21 02:03:04 2006 From: Chris.Barker at noaa.gov (Christopher Barker) Date: Thu, 20 Jul 2006 17:03:04 -0700 Subject: [Pythonmac-SIG] Running "freeze" on non-framework Python/universal binary issues In-Reply-To: <079AB69E-DB91-45F0-8791-107E1A3329E4@redivi.com> References: <44BFB535.5020607@kevin-walzer.com> <0BCB2276-F73C-431B-A957-209008EC28BC@redivi.com> <44BFCEBE.3010200@kevin-walzer.com> <96866C51-39AB-4E8A-8955-4B5593BA08D7@redivi.com> <44C00F56.5000608@kevin-walzer.com> <079AB69E-DB91-45F0-8791-107E1A3329E4@redivi.com> Message-ID: <44C019B8.7010302@noaa.gov> Bob Ippolito wrote: > On Jul 20, 2006, at 4:18 PM, Kevin Walzer wrote: >>> some fiddling in your main script if DISPLAY isn't set though. > If I were doing it I'd check for DISPLAY and look at the output of "/ > usr/X11R6/bin/xauth list" to see if X11 is running. Another option is some C code I found posted on the net somewhere. Rather than looking for DISPLAY, or xauth, it simply tries to connect to the X server. You get an error if it doesn't work. I've only tested it on linux. I even made a Python module out of it. Code enclosed. -Chris -- Christopher Barker, Ph.D. Oceanographer NOAA/OR&R/HAZMAT (206) 526-6959 voice 7600 Sand Point Way NE (206) 526-6329 fax Seattle, WA 98115 (206) 526-6317 main reception Chris.Barker at noaa.gov -------------- next part -------------- A non-text attachment was scrubbed... Name: IsX.tar.gz Type: application/x-gzip Size: 11403 bytes Desc: not available Url : http://mail.python.org/pipermail/pythonmac-sig/attachments/20060720/e1ea145b/attachment-0001.bin From Chris.Barker at noaa.gov Fri Jul 21 02:11:06 2006 From: Chris.Barker at noaa.gov (Christopher Barker) Date: Thu, 20 Jul 2006 17:11:06 -0700 Subject: [Pythonmac-SIG] Drag and Drop Launch of whatever.py? In-Reply-To: <2EEC3641-C89B-4D30-B472-397B1B35BC09@redivi.com> References: <2EEC3641-C89B-4D30-B472-397B1B35BC09@redivi.com> Message-ID: <44C01B9A.8030503@noaa.gov> Bob Ippolito wrote: > That's kinda strange, maybe PythonLauncher is broken. I don't think > anyone has paid attention to it in a few years. Last I tried, it worked. The trick was to make sure that *.py files were associated with. I don't remember how to do that, though. > You might want to try using py2app to create actual application > bundles from your scripts, though. Again, I see the need for py2app to be able to create "applets" -- Application bundles that depend on the installed Python. maybe one of these days I'll take the time to figure out Py2App enough to do it. By the way, Bob, thanks for the new py2App, it seems to be working well. Is there a way to get it (and setuptools) in?: pythonmac.org/packages -Chris -- Christopher Barker, Ph.D. Oceanographer NOAA/OR&R/HAZMAT (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 bob at redivi.com Fri Jul 21 02:20:14 2006 From: bob at redivi.com (Bob Ippolito) Date: Thu, 20 Jul 2006 17:20:14 -0700 Subject: [Pythonmac-SIG] Running "freeze" on non-framework Python/universal binary issues In-Reply-To: <44C019B8.7010302@noaa.gov> References: <44BFB535.5020607@kevin-walzer.com> <0BCB2276-F73C-431B-A957-209008EC28BC@redivi.com> <44BFCEBE.3010200@kevin-walzer.com> <96866C51-39AB-4E8A-8955-4B5593BA08D7@redivi.com> <44C00F56.5000608@kevin-walzer.com> <079AB69E-DB91-45F0-8791-107E1A3329E4@redivi.com> <44C019B8.7010302@noaa.gov> Message-ID: On Jul 20, 2006, at 5:03 PM, Christopher Barker wrote: > > Bob Ippolito wrote: >> On Jul 20, 2006, at 4:18 PM, Kevin Walzer wrote: >>>> some fiddling in your main script if DISPLAY isn't set though. >> If I were doing it I'd check for DISPLAY and look at the output of >> "/ usr/X11R6/bin/xauth list" to see if X11 is running. > > Another option is some C code I found posted on the net somewhere. > Rather than looking for DISPLAY, or xauth, it simply tries to > connect to the X server. You get an error if it doesn't work. > > I've only tested it on linux. > > I even made a Python module out of it. > > Code enclosed. Well, trying to connect to an X11 server is only good if DISPLAY is already set. That's only going to be true if your application was started from the shell, more or less, so the majority of the time it's going to fail even if the X11 server is running. Checking xauth will tell you if X11 is running, and what a reasonable guess for DISPLAY should be. It's possible to have a stale file though, so you might want to dig at the process table to see if X11 is actually running.. or maybe send it an open apple event anyway, because you want to give it focus anyhow. -bob From nad at acm.org Fri Jul 21 02:33:38 2006 From: nad at acm.org (Ned Deily) Date: Thu, 20 Jul 2006 17:33:38 -0700 Subject: [Pythonmac-SIG] Drag and Drop Launch of whatever.py? References: <2EEC3641-C89B-4D30-B472-397B1B35BC09@redivi.com> <44C01B9A.8030503@noaa.gov> Message-ID: In article <44C01B9A.8030503 at noaa.gov>, Christopher Barker wrote: > Bob Ippolito wrote: > > That's kinda strange, maybe PythonLauncher is broken. I don't think > > anyone has paid attention to it in a few years. > Last I tried, it worked. The trick was to make sure that *.py files were > associated with. I don't remember how to do that, though. One way: In the Finder, do a "Get Info" on any .py file. In its info panel, use "Open with" to find and select PythonLauncher. Then click the "Change All..." button below "Use this application to open all documents like this". -- Ned Deily, nad at acm.org From bob at redivi.com Fri Jul 21 02:38:34 2006 From: bob at redivi.com (Bob Ippolito) Date: Thu, 20 Jul 2006 17:38:34 -0700 Subject: [Pythonmac-SIG] Drag and Drop Launch of whatever.py? In-Reply-To: <44C01B9A.8030503@noaa.gov> References: <2EEC3641-C89B-4D30-B472-397B1B35BC09@redivi.com> <44C01B9A.8030503@noaa.gov> Message-ID: <7C27B81E-C11B-4F6F-820F-E30708FDC4D0@redivi.com> On Jul 20, 2006, at 5:11 PM, Christopher Barker wrote: > Bob Ippolito wrote: >> That's kinda strange, maybe PythonLauncher is broken. I don't think >> anyone has paid attention to it in a few years. > > Last I tried, it worked. The trick was to make sure that *.py files > were > associated with. I don't remember how to do that, though. > >> You might want to try using py2app to create actual application >> bundles from your scripts, though. > > Again, I see the need for py2app to be able to create "applets" -- > Application bundles that depend on the installed Python. maybe one of > these days I'll take the time to figure out Py2App enough to do it. What exactly are applets supposed to be anyway? I'm not sure what you'd want that isn't already covered by py2app... --alias covers the "well I already have *all* the files installed" case --semi-standalone covers the "depend on installed Python" case --site-packages covers the "depend on some third party stuff being installed" case The only caveat I guess is the latter case, because you will have to explicitly set up a list of third party packages in your excludes. That's not really a bad thing; it documents the dependencies of your application, and anything you fail to list gets included so your application will still (likely) work as per the documented dependencies. There is the preference of "well I'd REALLY rather list everything myself".. and I suppose you could get that too with somewhat awkward syntax. You could have a fake main script which only serves to confuse py2app.. something like this:: execfile('realmain.py') And then you'd include your source files as a resource or in data_files instead of as an include. It won't get you compilation to .pyc files, but there's little sense in doing things that way anyhow. > By the way, Bob, thanks for the new py2App, it seems to be working > well. > Is there a way to get it (and setuptools) in?: > > pythonmac.org/packages No, and I already answered that (twice-ish): http://mail.python.org/pipermail/pythonmac-sig/2006-July/017836.html http://mail.python.org/pipermail/pythonmac-sig/2006-July/017839.html py2app 0.2.x is effectively gone though (from the HTML on pythonmac.org and undefined.org). It is still distributed with current PyObjC installers, but that will change with the next release. -bob From kaweh.kazemi at chello.at Fri Jul 21 03:17:20 2006 From: kaweh.kazemi at chello.at (Kaweh Kazemi) Date: Fri, 21 Jul 2006 03:17:20 +0200 Subject: [Pythonmac-SIG] [ANN] py2app 0.3.2 In-Reply-To: <2D37F374-03BE-4DEC-9A7C-FBE32874A44C@redivi.com> References: <1430102D-25F2-4C80-BE3B-FBDA0FA9DA9D@chello.at> <2D37F374-03BE-4DEC-9A7C-FBE32874A44C@redivi.com> Message-ID: thanks for the warning. removed py2applet - i assume it was installed there by a previous py2app version, right? (i saw that you already updated the documentation accordingly to get rid of py2applet in http:// svn.pythonmac.org/py2app/py2app/trunk/doc/index.html#uninstalling- py2app-0-2-x-or-earlier) changing the path order would be a problem (at least for me), wouldn't it? my python2.4 (and the approriate link 'python') is in /usr/local/bin (as installed with the latest Python Universal installer if i recall correctly) and if i type 'python' into the terminal i would like this version to be picked up and not the apple version in /usr/bin - which is python2.3 (and the link 'python' to it). i'm just confused if my setup is not correct, but anyways it works for me, so i believe i should be fine. thanks for the help, kaweh On 20.07.2006, at 22:01, Bob Ippolito wrote: > > On Jul 20, 2006, at 12:32 PM, Kaweh Kazemi wrote: > >> hi, >> >> i was upgrading from a older version of py2app (pre-setuptools as >> far as i know), following the instruction at http:// >> svn.pythonmac.org/py2app/py2app/trunk/doc/index.html#installation >> >> using py2applet failed with: >> >>> $ py2applet --make-setup myapp.py >>> Traceback (most recent call last): >>> File "/usr/local/bin/py2applet", line 2, in ? >>> from py2app.scripts.script_py2applet import main >>> ImportError: No module named scripts.script_py2applet >> >> >> so i fixed line 2 in /usr/local/bin/py2applet to >> >>> from py2app.script_py2applet import main >>> >> i hope this was fine. i'm not sure if this was a problem with my >> installation or a general problem. i'm posting this if anyone else >> encounters this. > > Do not use that fix. It's not at all correct (though it does happen > to work in this case, mostly by chance). The problem is likely > that /usr/local/bin is somehow before your python's bin path. rm / > usr/local/bin/py2applet and/or change the order of your PATH. > > -bob > From kaweh.kazemi at chello.at Fri Jul 21 03:23:07 2006 From: kaweh.kazemi at chello.at (Kaweh Kazemi) Date: Fri, 21 Jul 2006 03:23:07 +0200 Subject: [Pythonmac-SIG] [ANN] py2app 0.3.2 In-Reply-To: References: Message-ID: <313171D7-A11B-4BE2-A1AF-984E9C1EA53A@chello.at> hi, using py2app 0.3.2 i encountered following problem. WARNING: Mach-O header may be too large to relocate Traceback (most recent call last): File "/Library/Frameworks/Python.framework/Versions/2.4/lib/ python2.4/site-packages/py2app-0.3.2-py2.4.egg/py2app/build_app.py", line 548, in _run self.run_normal() File "/Library/Frameworks/Python.framework/Versions/2.4/lib/ python2.4/site-packages/py2app-0.3.2-py2.4.egg/py2app/build_app.py", line 619, in run_normal self.create_binaries(py_files, pkgdirs, extensions, loader_files) File "/Library/Frameworks/Python.framework/Versions/2.4/lib/ python2.4/site-packages/py2app-0.3.2-py2.4.egg/py2app/build_app.py", line 732, in create_binaries platfiles = mm.run() File "/Library/Frameworks/Python.framework/Versions/2.4/lib/ python2.4/site-packages/macholib-1.1-py2.4.egg/macholib/ MachOStandalone.py", line 135, in run File "/Library/Frameworks/Python.framework/Versions/2.4/lib/ python2.4/site-packages/macholib-1.1-py2.4.egg/macholib/MachO.py", line 111, in write File "/Library/Frameworks/Python.framework/Versions/2.4/lib/ python2.4/site-packages/macholib-1.1-py2.4.egg/macholib/MachO.py", line 302, in write File "/Library/Frameworks/Python.framework/Versions/2.4/lib/ python2.4/site-packages/macholib-1.1-py2.4.egg/macholib/MachO.py", line 292, in synchronize_size ValueError: New Mach-O header is too large to relocate > /Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/ site-packages/macholib-1.1-py2.4.egg/macholib/MachO.py(292) synchronize_size() i'm trying to include a custom made library into my application. i'm not assuming that py2app (or macholib) is the problem here, but the library, though i was hoping that this error-message could give someone a clue where i could look to solve my problem. any hints are much appreciated. thanks, kaweh From bob at redivi.com Fri Jul 21 03:31:10 2006 From: bob at redivi.com (Bob Ippolito) Date: Thu, 20 Jul 2006 18:31:10 -0700 Subject: [Pythonmac-SIG] [ANN] py2app 0.3.2 In-Reply-To: References: <1430102D-25F2-4C80-BE3B-FBDA0FA9DA9D@chello.at> <2D37F374-03BE-4DEC-9A7C-FBE32874A44C@redivi.com> Message-ID: On Jul 20, 2006, at 6:17 PM, Kaweh Kazemi wrote: > thanks for the warning. > > removed py2applet - i assume it was installed there by a previous > py2app version, right? (i saw that you already updated the > documentation accordingly to get rid of py2applet in http:// > svn.pythonmac.org/py2app/py2app/trunk/doc/index.html#uninstalling- > py2app-0-2-x-or-earlier) Yeah. > changing the path order would be a problem (at least for me), > wouldn't it? > > my python2.4 (and the approriate link 'python') is in /usr/local/bin > (as installed with the latest Python Universal installer if i recall > correctly) and if i type 'python' into the terminal i would like this > version to be picked up and not the apple version in /usr/bin - which > is python2.3 (and the link 'python' to it). i'm just confused if my > setup is not correct, but anyways it works for me, so i believe i > should be fine. No. /usr/local/bin/python* is only there for backwards compatibility with what previous installers did. The installer also adds this to your .profile: # Setting PATH for MacPython 2.4 # The orginal version is saved in .profile.pysave PATH="/Library/Frameworks/Python.framework/Versions/Current/bin:${PATH}" This directory has the actual python binaries, and this is where distutils/setuptools install scripts to. -bob From bob at redivi.com Fri Jul 21 03:33:24 2006 From: bob at redivi.com (Bob Ippolito) Date: Thu, 20 Jul 2006 18:33:24 -0700 Subject: [Pythonmac-SIG] [ANN] py2app 0.3.2 In-Reply-To: <313171D7-A11B-4BE2-A1AF-984E9C1EA53A@chello.at> References: <313171D7-A11B-4BE2-A1AF-984E9C1EA53A@chello.at> Message-ID: On Jul 20, 2006, at 6:23 PM, Kaweh Kazemi wrote: > hi, > > using py2app 0.3.2 i encountered following problem. > > > WARNING: Mach-O header may be too large to relocate > Traceback (most recent call last): > File "/Library/Frameworks/Python.framework/Versions/2.4/lib/ > python2.4/site-packages/py2app-0.3.2-py2.4.egg/py2app/build_app.py", > line 548, in _run > self.run_normal() > File "/Library/Frameworks/Python.framework/Versions/2.4/lib/ > python2.4/site-packages/py2app-0.3.2-py2.4.egg/py2app/build_app.py", > line 619, in run_normal > self.create_binaries(py_files, pkgdirs, extensions, loader_files) > File "/Library/Frameworks/Python.framework/Versions/2.4/lib/ > python2.4/site-packages/py2app-0.3.2-py2.4.egg/py2app/build_app.py", > line 732, in create_binaries > platfiles = mm.run() > File "/Library/Frameworks/Python.framework/Versions/2.4/lib/ > python2.4/site-packages/macholib-1.1-py2.4.egg/macholib/ > MachOStandalone.py", line 135, in run > File "/Library/Frameworks/Python.framework/Versions/2.4/lib/ > python2.4/site-packages/macholib-1.1-py2.4.egg/macholib/MachO.py", > line 111, in write > File "/Library/Frameworks/Python.framework/Versions/2.4/lib/ > python2.4/site-packages/macholib-1.1-py2.4.egg/macholib/MachO.py", > line 302, in write > File "/Library/Frameworks/Python.framework/Versions/2.4/lib/ > python2.4/site-packages/macholib-1.1-py2.4.egg/macholib/MachO.py", > line 292, in synchronize_size > ValueError: New Mach-O header is too large to relocate >> /Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/ > site-packages/macholib-1.1-py2.4.egg/macholib/MachO.py(292) > synchronize_size() > > > i'm trying to include a custom made library into my application. i'm > not assuming that py2app (or macholib) is the problem here, but the > library, though i was hoping that this error-message could give > someone a clue where i could look to solve my problem. > > any hints are much appreciated. Some Mach-O don't have enough room leftover to rewrite their load commands. This is quite rare, but you may have to re-link the library with -headerpad_max_install_names. It could otherwise be a bug in macholib, but I wouldn't be able to say without a copy of the library. -bob From jerry.levan at eku.edu Fri Jul 21 04:43:10 2006 From: jerry.levan at eku.edu (Jerry LeVan) Date: Thu, 20 Jul 2006 22:43:10 -0400 Subject: [Pythonmac-SIG] Drag and Drop Launch of whatever.py? In-Reply-To: References: Message-ID: I used the get info dialog and set the app to PythonLauncher but it did no good....( even did a change all) Any *.py file give a "Can't open *.py" error message... Jerry From Chris.Barker at noaa.gov Fri Jul 21 21:03:05 2006 From: Chris.Barker at noaa.gov (Christopher Barker) Date: Fri, 21 Jul 2006 12:03:05 -0700 Subject: [Pythonmac-SIG] Drag and Drop Launch of whatever.py? In-Reply-To: <7C27B81E-C11B-4F6F-820F-E30708FDC4D0@redivi.com> References: <2EEC3641-C89B-4D30-B472-397B1B35BC09@redivi.com> <44C01B9A.8030503@noaa.gov> <7C27B81E-C11B-4F6F-820F-E30708FDC4D0@redivi.com> Message-ID: <44C124E9.9080009@noaa.gov> Bob Ippolito wrote: > On Jul 20, 2006, at 5:11 PM, Christopher Barker wrote: >> Again, I see the need for py2app to be able to create "applets" -- > What exactly are applets supposed to be anyway? I'm not sure what you'd > want that isn't already covered by py2app... I wrote that because I remembered that you once specifically said that you didn't see the need for it, and thus wouldn't write the code to do it. so i figured someone else had to write it. > --alias covers the "well I already have *all* the files installed" case This may be what I'm looking for. > --semi-standalone covers the "depend on installed Python" case I don't think I want this, as I thought it only worked with Apple's Python. > --site-packages covers the "depend on some third party stuff being > installed" case > > The only caveat I guess is the latter case, because you will have to > explicitly set up a list of third party packages in your excludes. That may be perfect. I'll give them a try. Sorry to ask about something i could have found out myself. >> By the way, Bob, thanks for the new py2App, it seems to be working well. >> Is there a way to get it (and setuptools) in?: >> >> pythonmac.org/packages > > No, and I already answered that (twice-ish): > > http://mail.python.org/pipermail/pythonmac-sig/2006-July/017836.html > http://mail.python.org/pipermail/pythonmac-sig/2006-July/017839.html Right, you did answer the setuptools question. As for putting Py2app there, you made it clear why I couldn't make a mpkg, but I didn't' think that meant it was impossible. From the first post: """ setuptools should be installed using its own means so it can properly upgrade itself. bdist_mpkg packages aren't really compatible with eggs """ This is a problem. When we all had that that big "What should the 'official' python be on OS-X" discussion a while back, it seems there was a consensus that it would be good to have one supported python, and one supported repository of packages for it. Also that it should be as "point and clicky" as possible. That's what the repository at pythonmac.org is, and I think that it's a good start, now that we have a useful number of packages there, and I've been doing my tiny bit by contributing what I can. However, Py2App is a critical component, and it's really too bad to not have a way to make it available the same way. In part of that conversation, it was proposed that it would be good to have a GUI tool that was a front end to setuptools: i.e. something that would come up when you clicked on an .egg. I suppose once we did that, we could go to having .eggs, rather than .mpkgs as the standard way to distribute modules on Python. Of course, none of that happens until someone that knows what they are doing, and has the time, writes the code. it would be nice to have a goal in mind, however. Maybe we could at least have a mpkg for easy_install on pythonmac.org in the meantime (or have it be part of the main Python package). -Chris -- Christopher Barker, Ph.D. Oceanographer NOAA/OR&R/HAZMAT (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 bob at redivi.com Fri Jul 21 22:44:44 2006 From: bob at redivi.com (Bob Ippolito) Date: Fri, 21 Jul 2006 13:44:44 -0700 Subject: [Pythonmac-SIG] Drag and Drop Launch of whatever.py? In-Reply-To: <44C124E9.9080009@noaa.gov> References: <2EEC3641-C89B-4D30-B472-397B1B35BC09@redivi.com> <44C01B9A.8030503@noaa.gov> <7C27B81E-C11B-4F6F-820F-E30708FDC4D0@redivi.com> <44C124E9.9080009@noaa.gov> Message-ID: On Jul 21, 2006, at 12:03 PM, Christopher Barker wrote: > Bob Ippolito wrote: >> On Jul 20, 2006, at 5:11 PM, Christopher Barker wrote: >>> Again, I see the need for py2app to be able to create "applets" -- > >> What exactly are applets supposed to be anyway? I'm not sure what >> you'd >> want that isn't already covered by py2app... > > I wrote that because I remembered that you once specifically said that > you didn't see the need for it, and thus wouldn't write the code to do > it. so i figured someone else had to write it. > >> --alias covers the "well I already have *all* the files installed" >> case > > This may be what I'm looking for. > >> --semi-standalone covers the "depend on installed Python" case > > I don't think I want this, as I thought it only worked with Apple's > Python. You've got it backwards, Apple's Python only works with --semi- standalone. Using a vendor Python implies --semi-standalone. The option is applicable to any installation. >> --site-packages covers the "depend on some third party stuff being >> installed" case >> >> The only caveat I guess is the latter case, because you will have to >> explicitly set up a list of third party packages in your excludes. > > That may be perfect. > > I'll give them a try. > > Sorry to ask about something i could have found out myself. --site-packages implies --semi-standalone too, of course. It doesn't make any sense to embed Python, but use the site-packages folder from another Python installation. >>> By the way, Bob, thanks for the new py2App, it seems to be >>> working well. >>> Is there a way to get it (and setuptools) in?: >>> >>> pythonmac.org/packages >> >> No, and I already answered that (twice-ish): >> >> http://mail.python.org/pipermail/pythonmac-sig/2006-July/017836.html >> http://mail.python.org/pipermail/pythonmac-sig/2006-July/017839.html > > Right, you did answer the setuptools question. As for putting Py2app > there, you made it clear why I couldn't make a mpkg, but I didn't' > think > that meant it was impossible. Anything is possible, but that doesn't mean it should be done. > From the first post: > > """ > setuptools should be installed > using its own means so it can properly upgrade itself. bdist_mpkg > packages aren't really compatible with eggs > """ > > This is a problem. When we all had that that big "What should the > 'official' python be on OS-X" discussion a while back, it seems there > was a consensus that it would be good to have one supported python, > and > one supported repository of packages for it. Also that it should be as > "point and clicky" as possible. That's what the repository at > pythonmac.org is, and I think that it's a good start, now that we > have a > useful number of packages there, and I've been doing my tiny bit by > contributing what I can. > > However, Py2App is a critical component, and it's really too bad to > not > have a way to make it available the same way. mpkg's have always been suboptimal. eggs solve most of the problems with packaging and installation, and setuptools is at a stage of maturity and adoption that it's an option. It's also cross-platform knowledge, I can type "easy_install simplejson" on FreeBSD, Linux, Mac OS X, Windows, etc. and expect the right thing to happen. As a developer, my installation documentation can be simply "install setuptools, then type easy_install PackageName". Installer only has one useful feature (excluding GUI and bootstrapping issues) that eggs/easy_install does not: the ability to install extra junk. This isn't used by many packages, but pygame as currently distributed absolutely requires the frameworks to be installed. This is probably best fixed by extending easy_install/ setuptools to support that use case somehow. > In part of that conversation, it was proposed that it would be good to > have a GUI tool that was a front end to setuptools: i.e. something > that > would come up when you clicked on an .egg. I suppose once we did that, > we could go to having .eggs, rather than .mpkgs as the standard > way to > distribute modules on Python. Why not just teach people how to type a command or two into the Terminal? They're going to need to learn at some point anyway. It's easier than wishing really hard that we had a GUI. I'm not really interested in writing one; I'd absolutely never use it unless it provided functionality above and beyond easy_install, but that effort would be better spent improving the setuptools stack for all platforms. I don't find easy_install to be at all daunting. All you have to do is give it the name of the app, a URL, or a path on disk and it does its thing. If you specify -U it makes sure your version is up to date. What's the big deal? A front-end would be a huge amount of work to do properly, and improperly it'd be a stupid way of typing "easy_install somepackage" for you. > Maybe we could at least have a mpkg for easy_install on > pythonmac.org in > the meantime (or have it be part of the main Python package). easy_install is part of setuptools, so no, it's not going to be made into a mpkg. Distributing it with Python is not a bad idea necessarily, though. -bob From kaweh.kazemi at chello.at Sat Jul 22 00:09:44 2006 From: kaweh.kazemi at chello.at (Kaweh Kazemi) Date: Sat, 22 Jul 2006 00:09:44 +0200 Subject: [Pythonmac-SIG] [ANN] py2app 0.3.2 In-Reply-To: References: <1430102D-25F2-4C80-BE3B-FBDA0FA9DA9D@chello.at> <2D37F374-03BE-4DEC-9A7C-FBE32874A44C@redivi.com> Message-ID: <2F28EE65-8678-4656-A16B-921261019F0D@chello.at> >> changing the path order would be a problem (at least for me), >> wouldn't it? >> >> my python2.4 (and the approriate link 'python') is in /usr/local/bin >> (as installed with the latest Python Universal installer if i recall >> correctly) and if i type 'python' into the terminal i would like this >> version to be picked up and not the apple version in /usr/bin - which >> is python2.3 (and the link 'python' to it). i'm just confused if my >> setup is not correct, but anyways it works for me, so i believe i >> should be fine. > > No. /usr/local/bin/python* is only there for backwards > compatibility with what previous installers did. The installer also > adds this to your .profile: > > # Setting PATH for MacPython 2.4 > # The orginal version is saved in .profile.pysave > PATH="/Library/Frameworks/Python.framework/Versions/Current/bin:$ > {PATH}" > > This directory has the actual python binaries, and this is where > distutils/setuptools install scripts to. thanks for the clarification and your time, bob. i was using .bash_profile which seemed to override .profile (sorry, i'm not really a bash expert and that setup did work for me). i've fixed that in my environment now and i'm using .profile for my stuff. > No. /usr/local/bin/python* is only there for backwards > compatibility with what previous installers did. The installer also > adds this to your .profile: > is it safe to remove /usr/local/bin/python* then or should the stuff remain there? just curious. thanks again, kaweh From bob at redivi.com Sat Jul 22 00:16:16 2006 From: bob at redivi.com (Bob Ippolito) Date: Fri, 21 Jul 2006 15:16:16 -0700 Subject: [Pythonmac-SIG] [ANN] py2app 0.3.2 In-Reply-To: <2F28EE65-8678-4656-A16B-921261019F0D@chello.at> References: <1430102D-25F2-4C80-BE3B-FBDA0FA9DA9D@chello.at> <2D37F374-03BE-4DEC-9A7C-FBE32874A44C@redivi.com> <2F28EE65-8678-4656-A16B-921261019F0D@chello.at> Message-ID: On Jul 21, 2006, at 3:09 PM, Kaweh Kazemi wrote: >>> changing the path order would be a problem (at least for me), >>> wouldn't it? >>> >>> my python2.4 (and the approriate link 'python') is in /usr/local/bin >>> (as installed with the latest Python Universal installer if i recall >>> correctly) and if i type 'python' into the terminal i would like >>> this >>> version to be picked up and not the apple version in /usr/bin - >>> which >>> is python2.3 (and the link 'python' to it). i'm just confused if my >>> setup is not correct, but anyways it works for me, so i believe i >>> should be fine. >> >> No. /usr/local/bin/python* is only there for backwards >> compatibility with what previous installers did. The installer >> also adds this to your .profile: >> >> # Setting PATH for MacPython 2.4 >> # The orginal version is saved in .profile.pysave >> PATH="/Library/Frameworks/Python.framework/Versions/Current/bin:$ >> {PATH}" >> >> This directory has the actual python binaries, and this is where >> distutils/setuptools install scripts to. > > thanks for the clarification and your time, bob. > > i was using .bash_profile which seemed to override .profile (sorry, > i'm not really a bash expert and that setup did work for me). i've > fixed that in my environment now and i'm using .profile for my stuff. We should probably add some more smarts to the installer to detect .bash_profile as well. >> No. /usr/local/bin/python* is only there for backwards >> compatibility with what previous installers did. The installer >> also adds this to your .profile: >> > > is it safe to remove /usr/local/bin/python* then or should the > stuff remain there? just curious. Should be safe to remove if you really want to. -bob From kaweh.kazemi at chello.at Sat Jul 22 00:17:40 2006 From: kaweh.kazemi at chello.at (Kaweh Kazemi) Date: Sat, 22 Jul 2006 00:17:40 +0200 Subject: [Pythonmac-SIG] [ANN] py2app 0.3.2 In-Reply-To: References: <313171D7-A11B-4BE2-A1AF-984E9C1EA53A@chello.at> Message-ID: <6D37AED9-76FB-4DBF-A6BF-3D1E52F968B8@chello.at> >> WARNING: Mach-O header may be too large to relocate >> Traceback (most recent call last): >> File "/Library/Frameworks/Python.framework/Versions/2.4/lib/ >> python2.4/site-packages/py2app-0.3.2-py2.4.egg/py2app/build_app.py", >> line 548, in _run >> self.run_normal() >> File "/Library/Frameworks/Python.framework/Versions/2.4/lib/ >> python2.4/site-packages/py2app-0.3.2-py2.4.egg/py2app/build_app.py", >> line 619, in run_normal >> self.create_binaries(py_files, pkgdirs, extensions, >> loader_files) >> File "/Library/Frameworks/Python.framework/Versions/2.4/lib/ >> python2.4/site-packages/py2app-0.3.2-py2.4.egg/py2app/build_app.py", >> line 732, in create_binaries >> platfiles = mm.run() >> File "/Library/Frameworks/Python.framework/Versions/2.4/lib/ >> python2.4/site-packages/macholib-1.1-py2.4.egg/macholib/ >> MachOStandalone.py", line 135, in run >> File "/Library/Frameworks/Python.framework/Versions/2.4/lib/ >> python2.4/site-packages/macholib-1.1-py2.4.egg/macholib/MachO.py", >> line 111, in write >> File "/Library/Frameworks/Python.framework/Versions/2.4/lib/ >> python2.4/site-packages/macholib-1.1-py2.4.egg/macholib/MachO.py", >> line 302, in write >> File "/Library/Frameworks/Python.framework/Versions/2.4/lib/ >> python2.4/site-packages/macholib-1.1-py2.4.egg/macholib/MachO.py", >> line 292, in synchronize_size >> ValueError: New Mach-O header is too large to relocate >>> /Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/ >> site-packages/macholib-1.1-py2.4.egg/macholib/MachO.py(292) >> synchronize_size() >> >> >> i'm trying to include a custom made library into my application. i'm >> not assuming that py2app (or macholib) is the problem here, but the >> library, though i was hoping that this error-message could give >> someone a clue where i could look to solve my problem. >> >> any hints are much appreciated. > > Some Mach-O don't have enough room leftover to rewrite their load > commands. This is quite rare, but you may have to re-link the > library with -headerpad_max_install_names. It could otherwise be a > bug in macholib, but I wouldn't be able to say without a copy of > the library. thanks a lot. i will give that a try and re-link the libraries. essentially i am trying to package a Panda3D test application using py2app - see http://knuddl.net/moin.cgi/InstallPanda3d for my Panda3D package if interested(compiled/linked for OS X including installation instructions) - though be aware that the installation is still cumbersome and definitely not as user friendly as i would like it to be - this is still very experimental (Panda3D has no official OS X support yet); anyways, i'll re-link the libraries and see how it's going. thanks, kaweh From kaweh.kazemi at chello.at Sat Jul 22 00:18:15 2006 From: kaweh.kazemi at chello.at (Kaweh Kazemi) Date: Sat, 22 Jul 2006 00:18:15 +0200 Subject: [Pythonmac-SIG] [ANN] py2app 0.3.2 In-Reply-To: References: <313171D7-A11B-4BE2-A1AF-984E9C1EA53A@chello.at> Message-ID: >> WARNING: Mach-O header may be too large to relocate >> Traceback (most recent call last): >> File "/Library/Frameworks/Python.framework/Versions/2.4/lib/ >> python2.4/site-packages/py2app-0.3.2-py2.4.egg/py2app/build_app.py", >> line 548, in _run >> self.run_normal() >> File "/Library/Frameworks/Python.framework/Versions/2.4/lib/ >> python2.4/site-packages/py2app-0.3.2-py2.4.egg/py2app/build_app.py", >> line 619, in run_normal >> self.create_binaries(py_files, pkgdirs, extensions, >> loader_files) >> File "/Library/Frameworks/Python.framework/Versions/2.4/lib/ >> python2.4/site-packages/py2app-0.3.2-py2.4.egg/py2app/build_app.py", >> line 732, in create_binaries >> platfiles = mm.run() >> File "/Library/Frameworks/Python.framework/Versions/2.4/lib/ >> python2.4/site-packages/macholib-1.1-py2.4.egg/macholib/ >> MachOStandalone.py", line 135, in run >> File "/Library/Frameworks/Python.framework/Versions/2.4/lib/ >> python2.4/site-packages/macholib-1.1-py2.4.egg/macholib/MachO.py", >> line 111, in write >> File "/Library/Frameworks/Python.framework/Versions/2.4/lib/ >> python2.4/site-packages/macholib-1.1-py2.4.egg/macholib/MachO.py", >> line 302, in write >> File "/Library/Frameworks/Python.framework/Versions/2.4/lib/ >> python2.4/site-packages/macholib-1.1-py2.4.egg/macholib/MachO.py", >> line 292, in synchronize_size >> ValueError: New Mach-O header is too large to relocate >>> /Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/ >> site-packages/macholib-1.1-py2.4.egg/macholib/MachO.py(292) >> synchronize_size() >> >> >> i'm trying to include a custom made library into my application. i'm >> not assuming that py2app (or macholib) is the problem here, but the >> library, though i was hoping that this error-message could give >> someone a clue where i could look to solve my problem. >> >> any hints are much appreciated. > > Some Mach-O don't have enough room leftover to rewrite their load > commands. This is quite rare, but you may have to re-link the > library with -headerpad_max_install_names. It could otherwise be a > bug in macholib, but I wouldn't be able to say without a copy of > the library. thanks a lot. i will give that a try and re-link the libraries. essentially i am trying to package a Panda3D test application using py2app - see http://knuddl.net/moin.cgi/InstallPanda3d for my Panda3D package if interested(compiled/linked for OS X including installation instructions) - though be aware that the installation is still cumbersome and definitely not as user friendly as i would like it to be - this is still very experimental (Panda3D has no official OS X support yet); anyways, i'll re-link the libraries and see how it's going. thanks, kaweh From kaweh.kazemi at chello.at Sat Jul 22 00:18:31 2006 From: kaweh.kazemi at chello.at (Kaweh Kazemi) Date: Sat, 22 Jul 2006 00:18:31 +0200 Subject: [Pythonmac-SIG] [ANN] py2app 0.3.2 In-Reply-To: References: <313171D7-A11B-4BE2-A1AF-984E9C1EA53A@chello.at> Message-ID: <7C152654-53AF-45F1-9C82-E4CB0414CD2F@chello.at> >> WARNING: Mach-O header may be too large to relocate >> Traceback (most recent call last): >> File "/Library/Frameworks/Python.framework/Versions/2.4/lib/ >> python2.4/site-packages/py2app-0.3.2-py2.4.egg/py2app/build_app.py", >> line 548, in _run >> self.run_normal() >> File "/Library/Frameworks/Python.framework/Versions/2.4/lib/ >> python2.4/site-packages/py2app-0.3.2-py2.4.egg/py2app/build_app.py", >> line 619, in run_normal >> self.create_binaries(py_files, pkgdirs, extensions, >> loader_files) >> File "/Library/Frameworks/Python.framework/Versions/2.4/lib/ >> python2.4/site-packages/py2app-0.3.2-py2.4.egg/py2app/build_app.py", >> line 732, in create_binaries >> platfiles = mm.run() >> File "/Library/Frameworks/Python.framework/Versions/2.4/lib/ >> python2.4/site-packages/macholib-1.1-py2.4.egg/macholib/ >> MachOStandalone.py", line 135, in run >> File "/Library/Frameworks/Python.framework/Versions/2.4/lib/ >> python2.4/site-packages/macholib-1.1-py2.4.egg/macholib/MachO.py", >> line 111, in write >> File "/Library/Frameworks/Python.framework/Versions/2.4/lib/ >> python2.4/site-packages/macholib-1.1-py2.4.egg/macholib/MachO.py", >> line 302, in write >> File "/Library/Frameworks/Python.framework/Versions/2.4/lib/ >> python2.4/site-packages/macholib-1.1-py2.4.egg/macholib/MachO.py", >> line 292, in synchronize_size >> ValueError: New Mach-O header is too large to relocate >>> /Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/ >> site-packages/macholib-1.1-py2.4.egg/macholib/MachO.py(292) >> synchronize_size() >> >> >> i'm trying to include a custom made library into my application. i'm >> not assuming that py2app (or macholib) is the problem here, but the >> library, though i was hoping that this error-message could give >> someone a clue where i could look to solve my problem. >> >> any hints are much appreciated. > > Some Mach-O don't have enough room leftover to rewrite their load > commands. This is quite rare, but you may have to re-link the > library with -headerpad_max_install_names. It could otherwise be a > bug in macholib, but I wouldn't be able to say without a copy of > the library. thanks a lot. i will give that a try and re-link the libraries. essentially i am trying to package a Panda3D test application using py2app - see http://knuddl.net/moin.cgi/InstallPanda3d for my Panda3D package if interested(compiled/linked for OS X including installation instructions) - though be aware that the installation is still cumbersome and definitely not as user friendly as i would like it to be - this is still very experimental (Panda3D has no official OS X support yet); anyways, i'll re-link the libraries and see how it's going. thanks, kaweh From rstephe at alumni.princeton.edu Sat Jul 22 00:26:24 2006 From: rstephe at alumni.princeton.edu (Robert Stephenson) Date: Fri, 21 Jul 2006 15:26:24 -0700 Subject: [Pythonmac-SIG] Best way to do full-screen mode? Message-ID: <4F822CDB-5B2E-4F16-B500-E03216A32A29@alumni.princeton.edu> My app needs a full-screen mode, and am looking for examples or advice how to do it. CoreGraphics allows you to capture the display and then draw on it, but since it's not written in ObjC my understanding is that it's not easily accessible from PyObjC. An alternative would be to bring up a borderless full-screen window. Can that be done easily? - Rob * * * * * * * * * * * * * * * * * * * * * * * * Dr. Robert S. Stephenson * E-learning Architect * rstephe at alumni.princeton.edu * (415) 341-3784 * http://sun.science.wayne.edu/~rstephe * * Community Manager * Global Education & Learning Community on Java.net * http://gelc.org * * Chief Architect and Principal Investigator * http://OpenCourse.Org * Supporting virtual communities of e-learning developers. * * Founder * The Harvey Project * Open Course Physiology on the Web * http://HarveyProject.org * * Was I helpful? Let others know: * http://rate.affero.net/rstephe * * gpg key fingerprint: * 4255 FB43 17C8 2B80 8074 7DB6 7DD7 939B F3F6 CB92 * * * * * * * * * * * * * * * * * * * * * * * -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/pythonmac-sig/attachments/20060721/019a3602/attachment.htm From david.warde.farley at utoronto.ca Sat Jul 22 00:39:23 2006 From: david.warde.farley at utoronto.ca (David Warde-Farley) Date: Fri, 21 Jul 2006 18:39:23 -0400 Subject: [Pythonmac-SIG] Best way to do full-screen mode? In-Reply-To: <4F822CDB-5B2E-4F16-B500-E03216A32A29@alumni.princeton.edu> References: <4F822CDB-5B2E-4F16-B500-E03216A32A29@alumni.princeton.edu> Message-ID: <594686D6-F25B-42AA-AA02-55FB5D5D2FCE@utoronto.ca> On 21-Jul-06, at 6:26 PM, Robert Stephenson wrote: > My app needs a full-screen mode, and am looking for examples or > advice how to do it. CoreGraphics allows you to capture the > display and then draw on it, but since it's not written in ObjC my > understanding is that it's not easily accessible from PyObjC. An > alternative would be to bring up a borderless full-screen window. > Can that be done easily? I know that Pygame can do this fairly easily on other platforms. Given that it's all a wrapper on top of SDL it should work on the Mac as well. (Can anyone confirm?) Dave From bob at redivi.com Sat Jul 22 01:44:24 2006 From: bob at redivi.com (Bob Ippolito) Date: Fri, 21 Jul 2006 16:44:24 -0700 Subject: [Pythonmac-SIG] Best way to do full-screen mode? In-Reply-To: <594686D6-F25B-42AA-AA02-55FB5D5D2FCE@utoronto.ca> References: <4F822CDB-5B2E-4F16-B500-E03216A32A29@alumni.princeton.edu> <594686D6-F25B-42AA-AA02-55FB5D5D2FCE@utoronto.ca> Message-ID: On Jul 21, 2006, at 3:39 PM, David Warde-Farley wrote: > On 21-Jul-06, at 6:26 PM, Robert Stephenson wrote: > >> My app needs a full-screen mode, and am looking for examples or >> advice how to do it. CoreGraphics allows you to capture the >> display and then draw on it, but since it's not written in ObjC my >> understanding is that it's not easily accessible from PyObjC. An >> alternative would be to bring up a borderless full-screen window. >> Can that be done easily? > > I know that Pygame can do this fairly easily on other platforms. > Given that it's all a wrapper on top of SDL it should work on the Mac > as well. (Can anyone confirm?) Yes, pygame does work full screen, but you need to use SDL to draw in that case. That subset of CoreGraphics should be easy enough to talk to from ctypes or PyObjC's FFI capability... import objc from Foundation import NSBundle bndl = NSBundle.bundleWithPath_(objc.pathForFramework ('ApplicationServices.framework')) # this is cheating, CGDirectDisplayID is a pointer, but we treat it as an int FUNCTIONS = [ ('CGMainDisplayID', 'i'), ('CGDisplayCapture', 'ii'), ('CGDisplayRelease', 'ii'), ] objc.loadBundleFunctions(bndl, globals(), FUNCTIONS) Those functions should be all you need to jack into full-screen. With ctypes it would be a bit different... from ctypes import c_void_p, cdll, c_int from ctypes.util import find_library # again cheating, return value and arguments all default to int # so we don't need to bother setting argtype/restype _dylib = cdll.LoadLibrary(find_library('ApplicationServices')) CGMainDisplayID = _dylib.CGMainDisplayID CGDisplayCapture = _dylib.CGDisplayCapture CGDisplayRelease = _dylib.CGDisplayRelease -bob From delza at livingcode.org Sat Jul 22 02:25:06 2006 From: delza at livingcode.org (Dethe Elza) Date: Fri, 21 Jul 2006 17:25:06 -0700 Subject: [Pythonmac-SIG] [ANN] py2app 0.3.2 In-Reply-To: <6D37AED9-76FB-4DBF-A6BF-3D1E52F968B8@chello.at> References: <313171D7-A11B-4BE2-A1AF-984E9C1EA53A@chello.at> <6D37AED9-76FB-4DBF-A6BF-3D1E52F968B8@chello.at> Message-ID: <44C17062.9000306@livingcode.org> Kaweh Kazemi wrote: > essentially i am trying to package a Panda3D test application using > py2app - see http://knuddl.net/moin.cgi/InstallPanda3d for my Panda3D > package if interested(compiled/linked for OS X including installation > instructions) - though be aware that the installation is still > cumbersome and definitely not as user friendly as i would like it to > be - this is still very experimental (Panda3D has no official OS X > support yet); anyways, i'll re-link the libraries and see how it's > going. > > thanks, > kaweh I, for one, am excited to see Panda3D coming to the Mac. I have tried (and failed) to install it before. Before I dive in this time I have a couple of questions. 1) Is your version working on Intel Macs (I have a Macbook Pro). 2) Your instructions include the Nvidia Cg toolkit, but I have an ATI Radeon X1600. Should I skip that step, or does that mean I'm out of luck for the time begin? Thanks for working on this! --Dethe From bob at redivi.com Sat Jul 22 02:35:12 2006 From: bob at redivi.com (Bob Ippolito) Date: Fri, 21 Jul 2006 17:35:12 -0700 Subject: [Pythonmac-SIG] [ANN] py2app 0.3.2 In-Reply-To: <44C17062.9000306@livingcode.org> References: <313171D7-A11B-4BE2-A1AF-984E9C1EA53A@chello.at> <6D37AED9-76FB-4DBF-A6BF-3D1E52F968B8@chello.at> <44C17062.9000306@livingcode.org> Message-ID: On Jul 21, 2006, at 5:25 PM, Dethe Elza wrote: > Kaweh Kazemi wrote: >> essentially i am trying to package a Panda3D test application using >> py2app - see http://knuddl.net/moin.cgi/InstallPanda3d for my Panda3D >> package if interested(compiled/linked for OS X including installation >> instructions) - though be aware that the installation is still >> cumbersome and definitely not as user friendly as i would like it to >> be - this is still very experimental (Panda3D has no official OS X >> support yet); anyways, i'll re-link the libraries and see how it's >> going. >> >> thanks, >> kaweh > > I, for one, am excited to see Panda3D coming to the Mac. I have tried > (and failed) to install it before. Before I dive in this time I > have a > couple of questions. > > 1) Is your version working on Intel Macs (I have a Macbook Pro). It'd probably work if it was built on i386, but the instructions say to build some of the dependencies w/ DarwinPorts, so the final product is going to be dependent on a particular architecture. DarwinPorts doesn't built things universally. -bob From dtaylor at ski.org Sat Jul 22 04:38:16 2006 From: dtaylor at ski.org (Douglas Taylor) Date: Fri, 21 Jul 2006 19:38:16 -0700 Subject: [Pythonmac-SIG] Best way to do full-screen mode? In-Reply-To: References: <4F822CDB-5B2E-4F16-B500-E03216A32A29@alumni.princeton.edu> <594686D6-F25B-42AA-AA02-55FB5D5D2FCE@utoronto.ca> Message-ID: <44C18F98.8010007@ski.org> If you specify your screen setup for example pygame.display.set_mode((1024,768), OPENGL|DOUBLEBUF|FULLSCREEN) you can do all your drawing via OpenGL. And this works fine on a mac. best, Doug Bob Ippolito wrote: >On Jul 21, 2006, at 3:39 PM, David Warde-Farley wrote: > > > >>On 21-Jul-06, at 6:26 PM, Robert Stephenson wrote: >> >> >> >>>My app needs a full-screen mode, and am looking for examples or >>>advice how to do it. CoreGraphics allows you to capture the >>>display and then draw on it, but since it's not written in ObjC my >>>understanding is that it's not easily accessible from PyObjC. An >>>alternative would be to bring up a borderless full-screen window. >>>Can that be done easily? >>> >>> >>I know that Pygame can do this fairly easily on other platforms. >>Given that it's all a wrapper on top of SDL it should work on the Mac >>as well. (Can anyone confirm?) >> >> > >Yes, pygame does work full screen, but you need to use SDL to draw in >that case. > >That subset of CoreGraphics should be easy enough to talk to from >ctypes or PyObjC's FFI capability... > >import objc >from Foundation import NSBundle >bndl = NSBundle.bundleWithPath_(objc.pathForFramework >('ApplicationServices.framework')) ># this is cheating, CGDirectDisplayID is a pointer, but we treat it >as an int >FUNCTIONS = [ > ('CGMainDisplayID', 'i'), > ('CGDisplayCapture', 'ii'), > ('CGDisplayRelease', 'ii'), >] >objc.loadBundleFunctions(bndl, globals(), FUNCTIONS) > >Those functions should be all you need to jack into full-screen. With >ctypes it would be a bit different... > >from ctypes import c_void_p, cdll, c_int >from ctypes.util import find_library > ># again cheating, return value and arguments all default to int ># so we don't need to bother setting argtype/restype >_dylib = cdll.LoadLibrary(find_library('ApplicationServices')) >CGMainDisplayID = _dylib.CGMainDisplayID >CGDisplayCapture = _dylib.CGDisplayCapture >CGDisplayRelease = _dylib.CGDisplayRelease > >-bob > >_______________________________________________ >Pythonmac-SIG maillist - Pythonmac-SIG at python.org >http://mail.python.org/mailman/listinfo/pythonmac-sig > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/pythonmac-sig/attachments/20060721/6ac682fc/attachment.html From ronaldoussoren at mac.com Sat Jul 22 09:02:54 2006 From: ronaldoussoren at mac.com (Ronald Oussoren) Date: Sat, 22 Jul 2006 09:02:54 +0200 Subject: [Pythonmac-SIG] [ANN] py2app 0.3.2 In-Reply-To: References: <1430102D-25F2-4C80-BE3B-FBDA0FA9DA9D@chello.at> <2D37F374-03BE-4DEC-9A7C-FBE32874A44C@redivi.com> <2F28EE65-8678-4656-A16B-921261019F0D@chello.at> Message-ID: <08F29C5E-2BE9-4B66-9600-71791A3104A8@mac.com> On Jul 22, 2006, at 12:16 AM, Bob Ippolito wrote: > > On Jul 21, 2006, at 3:09 PM, Kaweh Kazemi wrote: > >> >> i was using .bash_profile which seemed to override .profile (sorry, >> i'm not really a bash expert and that setup did work for me). i've >> fixed that in my environment now and i'm using .profile for my stuff. > > We should probably add some more smarts to the installer to > detect .bash_profile as well. The installer is supposed to do that already, but obviously that doesn't work correctly. Ronald From kaweh.kazemi at chello.at Sat Jul 22 11:11:32 2006 From: kaweh.kazemi at chello.at (Kaweh Kazemi) Date: Sat, 22 Jul 2006 11:11:32 +0200 Subject: [Pythonmac-SIG] [ANN] py2app 0.3.2 In-Reply-To: <44C17062.9000306@livingcode.org> References: <313171D7-A11B-4BE2-A1AF-984E9C1EA53A@chello.at> <6D37AED9-76FB-4DBF-A6BF-3D1E52F968B8@chello.at> <44C17062.9000306@livingcode.org> Message-ID: <0DA1E64B-3A4A-4227-8957-4AB123F54DEF@chello.at> Hi, I would be happy if others would try out the package and give feedback! > 1) Is your version working on Intel Macs (I have a Macbook Pro). No, not yet. I just didn't had the time yet to create that package. You are the first person asking for Intel support. I will give it a try within the next few days and let you know how it went. > 2) Your instructions include the Nvidia Cg toolkit, but I have an > ATI Radeon X1600. Should I skip that step, or does that mean I'm > out of luck for the time begin? You can use the Cg toolkit an ATIs too (at least on my X800 I don't have problems). Haven't tried the X1600 yet, but I'll know when building the Intel package on my MacBook Pro. Stay tuned and thanks for the interest. Cheers, Kaweh On 22.07.2006, at 02:25, Dethe Elza wrote: > Kaweh Kazemi wrote: >> essentially i am trying to package a Panda3D test application >> using py2app - see http://knuddl.net/moin.cgi/InstallPanda3d for >> my Panda3D package if interested(compiled/linked for OS X >> including installation instructions) - though be aware that the >> installation is still cumbersome and definitely not as user >> friendly as i would like it to be - this is still very >> experimental (Panda3D has no official OS X support yet); anyways, >> i'll re-link the libraries and see how it's going. >> thanks, >> kaweh > > I, for one, am excited to see Panda3D coming to the Mac. I have > tried (and failed) to install it before. Before I dive in this > time I have a couple of questions. > > 1) Is your version working on Intel Macs (I have a Macbook Pro). > 2) Your instructions include the Nvidia Cg toolkit, but I have an > ATI Radeon X1600. Should I skip that step, or does that mean I'm > out of luck for the time begin? > > Thanks for working on this! > > --Dethe From kaweh.kazemi at chello.at Sat Jul 22 11:12:51 2006 From: kaweh.kazemi at chello.at (Kaweh Kazemi) Date: Sat, 22 Jul 2006 11:12:51 +0200 Subject: [Pythonmac-SIG] [ANN] py2app 0.3.2 In-Reply-To: References: <313171D7-A11B-4BE2-A1AF-984E9C1EA53A@chello.at> <6D37AED9-76FB-4DBF-A6BF-3D1E52F968B8@chello.at> <44C17062.9000306@livingcode.org> Message-ID: On 22.07.2006, at 02:35, Bob Ippolito wrote: > > On Jul 21, 2006, at 5:25 PM, Dethe Elza wrote: > >> Kaweh Kazemi wrote: >>> essentially i am trying to package a Panda3D test application using >>> py2app - see http://knuddl.net/moin.cgi/InstallPanda3d for my >>> Panda3D >>> package if interested(compiled/linked for OS X including >>> installation >>> instructions) - though be aware that the installation is still >>> cumbersome and definitely not as user friendly as i would like it to >>> be - this is still very experimental (Panda3D has no official OS X >>> support yet); anyways, i'll re-link the libraries and see how it's >>> going. >>> >>> thanks, >>> kaweh >> >> I, for one, am excited to see Panda3D coming to the Mac. I have >> tried >> (and failed) to install it before. Before I dive in this time I >> have a >> couple of questions. >> >> 1) Is your version working on Intel Macs (I have a Macbook Pro). > > It'd probably work if it was built on i386, but the instructions > say to build some of the dependencies w/ DarwinPorts, so the final > product is going to be dependent on a particular architecture. > DarwinPorts doesn't built things universally. > Yep, that's correct. I'm trying to build an Intel version within the next few days. I'm curious myself how this goes. Cheers, Kaweh From kaweh.kazemi at chello.at Sat Jul 22 11:11:32 2006 From: kaweh.kazemi at chello.at (Kaweh Kazemi) Date: Sat, 22 Jul 2006 11:11:32 +0200 Subject: [Pythonmac-SIG] [ANN] py2app 0.3.2 In-Reply-To: <44C17062.9000306@livingcode.org> References: <313171D7-A11B-4BE2-A1AF-984E9C1EA53A@chello.at> <6D37AED9-76FB-4DBF-A6BF-3D1E52F968B8@chello.at> <44C17062.9000306@livingcode.org> Message-ID: <0DA1E64B-3A4A-4227-8957-4AB123F54DEF@chello.at> Hi, I would be happy if others would try out the package and give feedback! > 1) Is your version working on Intel Macs (I have a Macbook Pro). No, not yet. I just didn't had the time yet to create that package. You are the first person asking for Intel support. I will give it a try within the next few days and let you know how it went. > 2) Your instructions include the Nvidia Cg toolkit, but I have an > ATI Radeon X1600. Should I skip that step, or does that mean I'm > out of luck for the time begin? You can use the Cg toolkit an ATIs too (at least on my X800 I don't have problems). Haven't tried the X1600 yet, but I'll know when building the Intel package on my MacBook Pro. Stay tuned and thanks for the interest. Cheers, Kaweh On 22.07.2006, at 02:25, Dethe Elza wrote: > Kaweh Kazemi wrote: >> essentially i am trying to package a Panda3D test application >> using py2app - see http://knuddl.net/moin.cgi/InstallPanda3d for >> my Panda3D package if interested(compiled/linked for OS X >> including installation instructions) - though be aware that the >> installation is still cumbersome and definitely not as user >> friendly as i would like it to be - this is still very >> experimental (Panda3D has no official OS X support yet); anyways, >> i'll re-link the libraries and see how it's going. >> thanks, >> kaweh > > I, for one, am excited to see Panda3D coming to the Mac. I have > tried (and failed) to install it before. Before I dive in this > time I have a couple of questions. > > 1) Is your version working on Intel Macs (I have a Macbook Pro). > 2) Your instructions include the Nvidia Cg toolkit, but I have an > ATI Radeon X1600. Should I skip that step, or does that mean I'm > out of luck for the time begin? > > Thanks for working on this! > > --Dethe From mwh at python.net Sat Jul 22 12:01:20 2006 From: mwh at python.net (Michael Hudson) Date: Sat, 22 Jul 2006 11:01:20 +0100 Subject: [Pythonmac-SIG] Best way to do full-screen mode? In-Reply-To: <4F822CDB-5B2E-4F16-B500-E03216A32A29@alumni.princeton.edu> (Robert Stephenson's message of "Fri, 21 Jul 2006 15:26:24 -0700") References: <4F822CDB-5B2E-4F16-B500-E03216A32A29@alumni.princeton.edu> Message-ID: <2mejweyn4f.fsf@starship.python.net> Robert Stephenson writes: > An alternative would be to bring up a borderless full-screen window. > Can that be done easily? I don't know about easily, but it's doable form PyObjC. Hacked out from somewhere else: class PQFullScreenWindow(NSWindow): def makeForView_(cls, view): screen = NSScreen.mainScreen() self = cls.alloc().initWithContentRect_styleMask_backing_defer_( screen.frame(), NSBorderlessWindowMask, NSBackingStoreBuffered, True) self.view = view return self makeForView_ = classmethod(makeForView_) def canBecomeKeyWindow(self): return True def resignKeyWindow(self): super(PQFullScreenWindow, self).resignKeyWindow() if self.view.fullscreen > 0: self.view.toggleFullScreen_(self) class PQView: def awakeFromNib(self): ... self.fsw = PQFullScreenWindow.makeForView_(self) def toggleFullScreen_(self, sender): ... # some mucking about with contentViews, etc self.fsw.makeKeyAndOrderFront_(self) self.fsw.makeFirstResponder_(self) self.fsw.setLevel_(NSPopUpMenuWindowLevel) HTH, mwh -- > Touche! But this confirms you are composed of logic gates. Crud, I thought those were neurons in there. -- Thomas F. Burdick, Kenny Tilton, comp.lang.lisp From rstephe at alumni.princeton.edu Sat Jul 22 20:38:09 2006 From: rstephe at alumni.princeton.edu (Robert Stephenson) Date: Sat, 22 Jul 2006 11:38:09 -0700 Subject: [Pythonmac-SIG] Best way to do full-screen mode? In-Reply-To: References: <4F822CDB-5B2E-4F16-B500-E03216A32A29@alumni.princeton.edu> <594686D6-F25B-42AA-AA02-55FB5D5D2FCE@utoronto.ca> Message-ID: <16A228CA-7368-464F-AD72-B5F0FA863F46@alumni.princeton.edu> Thanks, Bob, that works nicely! I grokked the signature format and discovered that cases like ('CGContextSetGrayFillColor', 'iiff') work, too. For CGContextFillEllipseInRect(ctxt, rect), I was able to make it as ('CGContextFillEllipseInRect', 'ii{CGRect={CGPoint=ff}{CGSize=ff}}') and then pass it a list like rect = [ [100., 100.], [5., 5.] ] and -mirabile dictu- it worked! Is this chicanery likely to blow up in my face someday, or does it make me a bad person? - rob On Jul 21, 2006, at 4:44 PM, Bob Ippolito wrote: > import objc > from Foundation import NSBundle > bndl = NSBundle.bundleWithPath_(objc.pathForFramework > ('ApplicationServices.framework')) > # this is cheating, CGDirectDisplayID is a pointer, but we treat it > as an int > FUNCTIONS = [ > ('CGMainDisplayID', 'i'), > ('CGDisplayCapture', 'ii'), > ('CGDisplayRelease', 'ii'), > ] > objc.loadBundleFunctions(bndl, globals(), FUNCTIONS) * * * * * * * * * * * * * * * * * * * * * * * * Dr. Robert S. Stephenson * E-learning Architect * rstephe at alumni.princeton.edu * (415) 341-3784 * http://sun.science.wayne.edu/~rstephe * * Community Manager * Global Education & Learning Community on Java.net * http://gelc.org * * Chief Architect and Principal Investigator * http://OpenCourse.Org * Supporting virtual communities of e-learning developers. * * Founder * The Harvey Project * Open Course Physiology on the Web * http://HarveyProject.org * * Was I helpful? Let others know: * http://rate.affero.net/rstephe * * gpg key fingerprint: * 4255 FB43 17C8 2B80 8074 7DB6 7DD7 939B F3F6 CB92 * * * * * * * * * * * * * * * * * * * * * * * -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/pythonmac-sig/attachments/20060722/dc2248bb/attachment.html From blafusel1 at mac.com Sat Jul 22 20:35:40 2006 From: blafusel1 at mac.com (mariocape) Date: Sat, 22 Jul 2006 11:35:40 -0700 Subject: [Pythonmac-SIG] How to get pyFltk installed? Message-ID: Hi Group - I just started working with Python and fltk at my job, using RH linux boxes. Of course I'd like to continue playing with it at home, running MacOS X 10.4.7 on a PowerBook (GCC 3.3, Python 2.4) I installed/compiled fltk v1.1.7 into /usr/local/lib without any glitches. I downloaded pyFltk v1.1.1 and already got several warnings and error messages during the build process. I tried the install anyways - when trying to import fltk in python, I get this: >>> import fltk Traceback (most recent call last): File "", line 1, in ? File "/System/Library/Frameworks/Python.framework/Versions/2.3/lib/ python2.3/site-packages/fltk.py", line 11, in ? import _fltk ImportError: dlopen(/System/Library/Frameworks/Python.framework/ Versions/2.3/lib/python2.3/site-packages/_fltk.so, 2): Symbol not found: _glClear Referenced from: /System/Library/Frameworks/Python.framework/ Versions/2.3/lib/python2.3/site-packages/_fltk.so Expected in: dynamic lookup Did any of your get this to work? There was mentioning of how to install it on OS X on the pyfltk site, but I can't make much sense of it... Any help greatly appreciated! From bob at redivi.com Sat Jul 22 23:36:52 2006 From: bob at redivi.com (Bob Ippolito) Date: Sat, 22 Jul 2006 14:36:52 -0700 Subject: [Pythonmac-SIG] [ANN] py2app 0.3.2 In-Reply-To: <7C152654-53AF-45F1-9C82-E4CB0414CD2F@chello.at> References: <313171D7-A11B-4BE2-A1AF-984E9C1EA53A@chello.at> <7C152654-53AF-45F1-9C82-E4CB0414CD2F@chello.at> Message-ID: <18EDC9EA-A5E8-46A7-AC84-CF852458956F@redivi.com> On Jul 21, 2006, at 3:18 PM, Kaweh Kazemi wrote: >>> WARNING: Mach-O header may be too large to relocate >>> Traceback (most recent call last): >>> File "/Library/Frameworks/Python.framework/Versions/2.4/lib/ >>> python2.4/site-packages/py2app-0.3.2-py2.4.egg/py2app/build_app.py", >>> line 548, in _run >>> self.run_normal() >>> File "/Library/Frameworks/Python.framework/Versions/2.4/lib/ >>> python2.4/site-packages/py2app-0.3.2-py2.4.egg/py2app/build_app.py", >>> line 619, in run_normal >>> self.create_binaries(py_files, pkgdirs, extensions, >>> loader_files) >>> File "/Library/Frameworks/Python.framework/Versions/2.4/lib/ >>> python2.4/site-packages/py2app-0.3.2-py2.4.egg/py2app/build_app.py", >>> line 732, in create_binaries >>> platfiles = mm.run() >>> File "/Library/Frameworks/Python.framework/Versions/2.4/lib/ >>> python2.4/site-packages/macholib-1.1-py2.4.egg/macholib/ >>> MachOStandalone.py", line 135, in run >>> File "/Library/Frameworks/Python.framework/Versions/2.4/lib/ >>> python2.4/site-packages/macholib-1.1-py2.4.egg/macholib/MachO.py", >>> line 111, in write >>> File "/Library/Frameworks/Python.framework/Versions/2.4/lib/ >>> python2.4/site-packages/macholib-1.1-py2.4.egg/macholib/MachO.py", >>> line 302, in write >>> File "/Library/Frameworks/Python.framework/Versions/2.4/lib/ >>> python2.4/site-packages/macholib-1.1-py2.4.egg/macholib/MachO.py", >>> line 292, in synchronize_size >>> ValueError: New Mach-O header is too large to relocate >>>> /Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/ >>> site-packages/macholib-1.1-py2.4.egg/macholib/MachO.py(292) >>> synchronize_size() >>> >>> >>> i'm trying to include a custom made library into my application. i'm >>> not assuming that py2app (or macholib) is the problem here, but the >>> library, though i was hoping that this error-message could give >>> someone a clue where i could look to solve my problem. >>> >>> any hints are much appreciated. >> >> Some Mach-O don't have enough room leftover to rewrite their load >> commands. This is quite rare, but you may have to re-link the >> library with -headerpad_max_install_names. It could otherwise be a >> bug in macholib, but I wouldn't be able to say without a copy of >> the library. > > thanks a lot. i will give that a try and re-link the libraries. > > essentially i am trying to package a Panda3D test application using > py2app - see http://knuddl.net/moin.cgi/InstallPanda3d for my > Panda3D package if interested(compiled/linked for OS X including > installation instructions) - though be aware that the installation > is still cumbersome and definitely not as user friendly as i would > like it to be - this is still very experimental (Panda3D has no > official OS X support yet); anyways, i'll re-link the libraries and > see how it's going. The "loader problem" documented in that wiki isn't a Mac OS X problem per se, it's just what PythonLauncher does. It launches scripts with a path of $HOME. Pretty stupid, but that's what it does. It's only relevant if you're double-clicking .py files from the finder. -bob From jwt at onjapan.net Sun Jul 23 04:07:20 2006 From: jwt at onjapan.net (Jim Tittsler) Date: Sun, 23 Jul 2006 11:07:20 +0900 Subject: [Pythonmac-SIG] How to get pyFltk installed? In-Reply-To: References: Message-ID: On Jul 23, 2006, at 3:35 , mariocape wrote: > Of course I'd like to continue playing with it at home, running MacOS > X 10.4.7 > on a PowerBook (GCC 3.3, Python 2.4) Here you mention Python 2.4... >>>> import fltk > Traceback (most recent call last): > File "", line 1, in ? > File "/System/Library/Frameworks/Python.framework/Versions/2.3/lib/ > python2.3/site-packages/fltk.py", line 11, in ? but you appear to be using Python 2.3. Is there some confusion in the path to the preferred version? From blafusel1 at mac.com Sun Jul 23 05:15:33 2006 From: blafusel1 at mac.com (blafusel1 at mac.com) Date: Sat, 22 Jul 2006 20:15:33 -0700 Subject: [Pythonmac-SIG] How to get pyFltk installed? In-Reply-To: References: Message-ID: <0E365621-BC3C-41EF-857B-E69F354C6EFB@mac.com> Good point Jim - I just now realized this myself. So I re-compiled/installed Python2.4 - and reverted back to fltk version 1.1 (instead of 1.1.1), as suggested by Andreas Held himself. Now I'm getting these messages when trying to build pyfltk: cc1plus: warning: command line option "-Wstrict-prototypes" is valid for C/ObjC but not for C++ ./python/fltk_wrap.cpp: In function `int pyFLTK_handlerCallback(int)': ./python/fltk_wrap.cpp:3595: warning: unused variable 'rec_code' ./python/fltk_wrap.cpp: In function `int fl_mt_ask(const char*)': ./python/fltk_wrap.cpp:3828: warning: 'fl_ask' is deprecated (declared at /usr/local/include/FL/fl_ask.H:59) ./python/fltk_wrap.cpp:3828: warning: 'fl_ask' is deprecated (declared at /usr/local/include/FL/fl_ask.H:59) ./python/fltk_wrap.cpp: In function `PyObject* _wrap_fl_ask__varargs__ (PyObject*, PyObject*, PyObject*)': ./python/fltk_wrap.cpp:40324: warning: 'fl_ask' is deprecated (declared at /usr/local/include/FL/fl_ask.H:59) ./python/fltk_wrap.cpp:40324: warning: 'fl_ask' is deprecated (declared at /usr/local/include/FL/fl_ask.H:59) cc1plus: warning: command line option "-Wstrict-prototypes" is valid for C/ObjC but not for C++ cc1plus: warning: command line option "-Wstrict-prototypes" is valid for C/ObjC but not for C++ cc1plus: warning: command line option "-Wstrict-prototypes" is valid for C/ObjC but not for C++ /usr/bin/ld: warning -L: directory name (lib) does not exist and this then trying to load fltk in python (a different error than before, looks like in 1.1 the OpenGL Frameworks are working now): Python 2.4.3 (#1, Jul 22 2006, 11:26:13) [GCC 4.0.0 20041026 (Apple Computer, Inc. build 4061)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> import fltk Traceback (most recent call last): File "", line 1, in ? File "/usr/local/lib/python2.4/site-packages/fltk.py", line 11, in ? import _fltk ImportError: Failure linking new module: /usr/local/lib/python2.4/ site-packages/_fltk.so: Symbol not found: __ZN2Fl6unlockEv Referenced from: /usr/local/lib/python2.4/site-packages/_fltk.so Expected in: dynamic lookup On Jul 22, 2006, at 7:07 PM, Jim Tittsler wrote: > On Jul 23, 2006, at 3:35 , mariocape wrote: > > >> Of course I'd like to continue playing with it at home, running MacOS >> X 10.4.7 >> on a PowerBook (GCC 3.3, Python 2.4) >> > > Here you mention Python 2.4... > > >>>>> import fltk >>>>> >> Traceback (most recent call last): >> File "", line 1, in ? >> File "/System/Library/Frameworks/Python.framework/Versions/2.3/ >> lib/ >> python2.3/site-packages/fltk.py", line 11, in ? >> > > but you appear to be using Python 2.3. Is there some confusion in > the path to the preferred version? > > _______________________________________________ > Pythonmac-SIG maillist - Pythonmac-SIG at python.org > http://mail.python.org/mailman/listinfo/pythonmac-sig > From ronaldoussoren at mac.com Sun Jul 23 09:33:14 2006 From: ronaldoussoren at mac.com (Ronald Oussoren) Date: Sun, 23 Jul 2006 09:33:14 +0200 Subject: [Pythonmac-SIG] [Pyobjc-dev] [ANN] py2app 0.3.2 In-Reply-To: <18EDC9EA-A5E8-46A7-AC84-CF852458956F@redivi.com> References: <313171D7-A11B-4BE2-A1AF-984E9C1EA53A@chello.at> <7C152654-53AF-45F1-9C82-E4CB0414CD2F@chello.at> <18EDC9EA-A5E8-46A7-AC84-CF852458956F@redivi.com> Message-ID: <8221CF7F-1226-4F0D-AE6B-B1D956B860A8@mac.com> On Jul 22, 2006, at 11:36 PM, Bob Ippolito wrote: > > The "loader problem" documented in that wiki isn't a Mac OS X problem > per se, it's just what PythonLauncher does. It launches scripts with > a path of $HOME. Pretty stupid, but that's what it does. It's only > relevant if you're double-clicking .py files from the finder. Setting the working directory to the directory containing the script would be more useful. Feel free to submit a bug report, if it is phrased correctly we might even sneak a patch in 2.5. Ronald From bob at redivi.com Sun Jul 23 19:30:31 2006 From: bob at redivi.com (Bob Ippolito) Date: Sun, 23 Jul 2006 10:30:31 -0700 Subject: [Pythonmac-SIG] [Pyobjc-dev] [ANN] py2app 0.3.2 In-Reply-To: <8221CF7F-1226-4F0D-AE6B-B1D956B860A8@mac.com> References: <313171D7-A11B-4BE2-A1AF-984E9C1EA53A@chello.at> <7C152654-53AF-45F1-9C82-E4CB0414CD2F@chello.at> <18EDC9EA-A5E8-46A7-AC84-CF852458956F@redivi.com> <8221CF7F-1226-4F0D-AE6B-B1D956B860A8@mac.com> Message-ID: <3C550289-C00C-4B22-A146-A0C92A947ABE@redivi.com> On Jul 23, 2006, at 12:33 AM, Ronald Oussoren wrote: > > On Jul 22, 2006, at 11:36 PM, Bob Ippolito wrote: > > >> >> The "loader problem" documented in that wiki isn't a Mac OS X problem >> per se, it's just what PythonLauncher does. It launches scripts with >> a path of $HOME. Pretty stupid, but that's what it does. It's only >> relevant if you're double-clicking .py files from the finder. > > Setting the working directory to the directory containing the > script would be more useful. Feel free to submit a bug report, if > it is phrased correctly we might even sneak a patch in 2.5. http://python.org/sf/1527397 -bob From Chris.Barker at noaa.gov Mon Jul 24 18:31:35 2006 From: Chris.Barker at noaa.gov (Christopher Barker) Date: Mon, 24 Jul 2006 09:31:35 -0700 Subject: [Pythonmac-SIG] [Pyobjc-dev] [ANN] py2app 0.3.2 In-Reply-To: <8221CF7F-1226-4F0D-AE6B-B1D956B860A8@mac.com> References: <313171D7-A11B-4BE2-A1AF-984E9C1EA53A@chello.at> <7C152654-53AF-45F1-9C82-E4CB0414CD2F@chello.at> <18EDC9EA-A5E8-46A7-AC84-CF852458956F@redivi.com> <8221CF7F-1226-4F0D-AE6B-B1D956B860A8@mac.com> Message-ID: <44C4F5E7.6080909@noaa.gov> Ronald Oussoren wrote: > Setting the working directory to the directory containing the script > would be more useful. I'm not so sure. That's a bad habit from the old MacOS and Windows. $HOME is an excellent choice for the default working directory. It might make sense to add the directory containing the script to sys.path, however. -CHB -- Christopher Barker, Ph.D. Oceanographer NOAA/OR&R/HAZMAT (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 bob at redivi.com Mon Jul 24 18:43:22 2006 From: bob at redivi.com (Bob Ippolito) Date: Mon, 24 Jul 2006 09:43:22 -0700 Subject: [Pythonmac-SIG] [Pyobjc-dev] [ANN] py2app 0.3.2 In-Reply-To: <44C4F5E7.6080909@noaa.gov> References: <313171D7-A11B-4BE2-A1AF-984E9C1EA53A@chello.at> <7C152654-53AF-45F1-9C82-E4CB0414CD2F@chello.at> <18EDC9EA-A5E8-46A7-AC84-CF852458956F@redivi.com> <8221CF7F-1226-4F0D-AE6B-B1D956B860A8@mac.com> <44C4F5E7.6080909@noaa.gov> Message-ID: On Jul 24, 2006, at 9:31 AM, Christopher Barker wrote: > Ronald Oussoren wrote: >> Setting the working directory to the directory containing the script >> would be more useful. > > I'm not so sure. That's a bad habit from the old MacOS and Windows. > $HOME is an excellent choice for the default working directory. No, it's not. There are approximately zero scripts that expect this behavior. > It might make sense to add the directory containing the script to > sys.path, however. That's always the case, PyRun_ExecFile and friends always ensure that. -bob From ronaldoussoren at mac.com Mon Jul 24 19:26:16 2006 From: ronaldoussoren at mac.com (Ronald Oussoren) Date: Mon, 24 Jul 2006 19:26:16 +0200 Subject: [Pythonmac-SIG] [Pyobjc-dev] [ANN] py2app 0.3.2 In-Reply-To: <44C4F5E7.6080909@noaa.gov> References: <313171D7-A11B-4BE2-A1AF-984E9C1EA53A@chello.at> <7C152654-53AF-45F1-9C82-E4CB0414CD2F@chello.at> <18EDC9EA-A5E8-46A7-AC84-CF852458956F@redivi.com> <8221CF7F-1226-4F0D-AE6B-B1D956B860A8@mac.com> <44C4F5E7.6080909@noaa.gov> Message-ID: On Jul 24, 2006, at 6:31 PM, Christopher Barker wrote: > Ronald Oussoren wrote: >> Setting the working directory to the directory containing the script >> would be more useful. > > I'm not so sure. That's a bad habit from the old MacOS and Windows. > $HOME is an excellent choice for the default working directory. Why's that? The directory that contains the script is a lot more useful for most scripts. > > It might make sense to add the directory containing the script to > sys.path, however. That's default python behaviour, we don't have to do anything for that. Ronald From Chris.Barker at noaa.gov Mon Jul 24 20:17:22 2006 From: Chris.Barker at noaa.gov (Christopher Barker) Date: Mon, 24 Jul 2006 11:17:22 -0700 Subject: [Pythonmac-SIG] [Pyobjc-dev] [ANN] py2app 0.3.2 In-Reply-To: References: <313171D7-A11B-4BE2-A1AF-984E9C1EA53A@chello.at> <7C152654-53AF-45F1-9C82-E4CB0414CD2F@chello.at> <18EDC9EA-A5E8-46A7-AC84-CF852458956F@redivi.com> <8221CF7F-1226-4F0D-AE6B-B1D956B860A8@mac.com> <44C4F5E7.6080909@noaa.gov> Message-ID: <44C50EB2.2050201@noaa.gov> Ronald Oussoren wrote: > Why's that? The directory that contains the script is a lot more useful > for most scripts. Bob Ippolito wrote: > No, it's not. There are approximately zero scripts that expect this > behavior. Most "scripts" I've ever used are used from the command line, and the working dir is the working dir you call the command from. This pretty much all goes to heck when you want to click on it from a GUI. All the Linux GUIs I've used use $HOME as the default working dir when you double click on something. When a script is installed somewhere central, like /usr/local/bin, that's really all that makes sense. When a script is hanging out in the depths of someone's $HOME hierarchy somewhere, I suppose it's likely that the user will want the script to act on files nearby. I'm not going to push the point -- I don't find PythonLauncher useful, for just this reason. I think if you have something that behaves like a traditional *nix script, you're better off running it from the command line. If you have a little GUI, you're probably better off making an Applet out of it, and clicking on it that way. And in that case, I'd want $HOME as the default working dir. Can you drag-and-drop on a script and have PythonLauncher do argv emulation for you? That could be useful. -CHB -- Christopher Barker, Ph.D. Oceanographer NOAA/OR&R/HAZMAT (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 bob at redivi.com Mon Jul 24 20:52:29 2006 From: bob at redivi.com (Bob Ippolito) Date: Mon, 24 Jul 2006 11:52:29 -0700 Subject: [Pythonmac-SIG] [Pyobjc-dev] [ANN] py2app 0.3.2 In-Reply-To: <44C50EB2.2050201@noaa.gov> References: <313171D7-A11B-4BE2-A1AF-984E9C1EA53A@chello.at> <7C152654-53AF-45F1-9C82-E4CB0414CD2F@chello.at> <18EDC9EA-A5E8-46A7-AC84-CF852458956F@redivi.com> <8221CF7F-1226-4F0D-AE6B-B1D956B860A8@mac.com> <44C4F5E7.6080909@noaa.gov> <44C50EB2.2050201@noaa.gov> Message-ID: On Jul 24, 2006, at 11:17 AM, Christopher Barker wrote: > Ronald Oussoren wrote: >> Why's that? The directory that contains the script is a lot more >> useful >> for most scripts. > Bob Ippolito wrote: >> No, it's not. There are approximately zero scripts that expect this >> behavior. > > Most "scripts" I've ever used are used from the command line, and the > working dir is the working dir you call the command from. This pretty > much all goes to heck when you want to click on it from a GUI. It doesn't have to. > All the Linux GUIs I've used use $HOME as the default working dir when > you double click on something. > > When a script is installed somewhere central, like /usr/local/bin, > that's really all that makes sense. That's clearly irrelevant, because people aren't going to be double- clicking on files that you have to do "magic incantations" to even see from Finder. > When a script is hanging out in the depths of someone's $HOME > hierarchy > somewhere, I suppose it's likely that the user will want the script to > act on files nearby. > > I'm not going to push the point -- I don't find PythonLauncher useful, > for just this reason. I think if you have something that behaves > like a > traditional *nix script, you're better off running it from the command > line. If you have a little GUI, you're probably better off making an > Applet out of it, and clicking on it that way. And in that case, I'd > want $HOME as the default working dir. But why would you want $HOME as the default working dir? There doesn't seem to be any purpose to it. Scripts that reference files in your home directory are always going to do that with an absolute path. I have never in my life seen a script that must be started with a working directory of $HOME (unless it also lives there). It is however extremely common for scripts to require that they are run from the directory they live in. Proper applications on OS X are going to start you with a working directory of / and must *always* use absolute paths. py2app assumes a working directory of the Resources folder (where the script and its data files live), because it makes more apps work without breaking any that were built for the normal behavior. This is the same scenario; by changing this we become compatible with Windows behavior, so we make more scripts work. We don't break anything. > Can you drag-and-drop on a script and have PythonLauncher do argv > emulation for you? That could be useful. I don't think so. -bob From ronaldoussoren at mac.com Mon Jul 24 21:53:52 2006 From: ronaldoussoren at mac.com (Ronald Oussoren) Date: Mon, 24 Jul 2006 21:53:52 +0200 Subject: [Pythonmac-SIG] [Pyobjc-dev] [ANN] py2app 0.3.2 In-Reply-To: References: <313171D7-A11B-4BE2-A1AF-984E9C1EA53A@chello.at> <7C152654-53AF-45F1-9C82-E4CB0414CD2F@chello.at> <18EDC9EA-A5E8-46A7-AC84-CF852458956F@redivi.com> <8221CF7F-1226-4F0D-AE6B-B1D956B860A8@mac.com> <44C4F5E7.6080909@noaa.gov> <44C50EB2.2050201@noaa.gov> Message-ID: On Jul 24, 2006, at 8:52 PM, Bob Ippolito wrote: > > On Jul 24, 2006, at 11:17 AM, Christopher Barker wrote: > >> Ronald Oussoren wrote: >>> Why's that? The directory that contains the script is a lot more >>> useful >>> for most scripts. >> Bob Ippolito wrote: >>> No, it's not. There are approximately zero scripts that expect this >>> behavior. >> >> Most "scripts" I've ever used are used from the command line, and the >> working dir is the working dir you call the command from. This pretty >> much all goes to heck when you want to click on it from a GUI. > > It doesn't have to. > >> All the Linux GUIs I've used use $HOME as the default working dir >> when >> you double click on something. >> >> When a script is installed somewhere central, like /usr/local/bin, >> that's really all that makes sense. > > That's clearly irrelevant, because people aren't going to be double- > clicking on files that you have to do "magic incantations" to even > see from Finder. The main problem here is that there isn't really a "current" directory in the GUI experience. That's why normal application bundles start with / as the CWD. PythonLauncher defaults to $HOME, but that's an implementaton artifact of the default way to launch scripts. For scripts you start by double-clicking on them there is a somewhat useful notion of a current directory: the folder that was frontmost when you double-clicked on the script. AFAIK that is always the folder that the script is in. For simple scripts that would be a very useful default, it saves you from doing path calculation in simple write-once scripts. For reuseable command-line scripts you're obviously better of to find data relative to your script or in some fixed location, but then changing the default wouldn't hurt either. > > But why would you want $HOME as the default working dir? There > doesn't seem to be any purpose to it. Scripts that reference files in > your home directory are always going to do that with an absolute > path. I have never in my life seen a script that must be started > with a working directory of $HOME (unless it also lives there). It is > however extremely common for scripts to require that they are run > from the directory they live in. +lots here. > >> Can you drag-and-drop on a script and have PythonLauncher do argv >> emulation for you? That could be useful. > > I don't think so. Nope, that's not possible. If you want argv emulation you'll have to build an applet. Ronald From ilochab at gmail.com Mon Jul 24 22:14:10 2006 From: ilochab at gmail.com (IloChab) Date: Mon, 24 Jul 2006 22:14:10 +0200 Subject: [Pythonmac-SIG] problem installing TigerPython24Fix Message-ID: <166b1c630607241314w18f5aa1ft8290807a9eeb5766@mail.gmail.com> I'm absolutely new in the mac's world. I just bought a MacBook. I'am trying to install Python 2.4 on it apart to the preinstalled 2.3 version. I read on the net that I'd to install first Universal-MacPython-2.4.3-2006-04-07.dmg and then to patch it with TigerPython24Fix-r2 Python 2.4 's installation was good but when I try to install TigerPython24Fix-r2.mpkg I get an error during the phase in which you have to choose the target hd. The HD icon has a red esclamation mark on it and the error says: Non puoi installare TigerPython24Fix-r2 su questo volume. Assicurati che il tuo sistema possieda i requisiti necessari. that means something like: You can't install TigerPython24Fix-r2 on this volume. Be sure you have the needed rights. I can't realize the nature of the problem. The disk is not full I tried everything logged as root to avoid owner rights problems. Could it be something related to the Intel core of my Mac? On the page from where I downloaded the fix http://pythonmac.org/packages/legacy.html they say: Mac OS X 10.4 (Python 2.4.1 framework build, PPC ONLY) Has it anything to do with my problem? PERHAPS I DO NOT HAVE to install this fix on my Mac? Is everything ok with just Universal-MacPython-2.4.3-2006-04-07.dmg alone? Please HELP. Licia -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/pythonmac-sig/attachments/20060724/954d4501/attachment.html From bob at redivi.com Mon Jul 24 22:20:41 2006 From: bob at redivi.com (Bob Ippolito) Date: Mon, 24 Jul 2006 13:20:41 -0700 Subject: [Pythonmac-SIG] problem installing TigerPython24Fix In-Reply-To: <166b1c630607241314w18f5aa1ft8290807a9eeb5766@mail.gmail.com> References: <166b1c630607241314w18f5aa1ft8290807a9eeb5766@mail.gmail.com> Message-ID: <9BE49AFB-B8F7-4AEF-9DE5-B968F3D6833B@redivi.com> On Jul 24, 2006, at 1:14 PM, IloChab wrote: > I'm absolutely new in the mac's world. > I just bought a MacBook. > I'am trying to install Python 2.4 on it apart to the preinstalled 2.3 > version. > > I read on the net that I'd to install first > Universal-MacPython-2.4.3-2006-04-07.dmg > and then to patch it with TigerPython24Fix-r2 Just install Universal-MacPython-2.4.3-2006-04-07.dmg -- nothing else is required. You confused old workarounds with the new build that doesn't have that issue. Where did you read about TigerPython24Fix- r2? Was it somewhere on the web that we can fix, or old mailing list archives? -bob From kranki at mac.com Mon Jul 24 22:38:15 2006 From: kranki at mac.com (Robert White) Date: Mon, 24 Jul 2006 16:38:15 -0400 Subject: [Pythonmac-SIG] plist.py Message-ID: <45A86D8C-6180-41E9-BF71-DEDE02552522@mac.com> Kevin Reid, http://homepage.mac.com/kpreid/, has just released v1.2 of plist.py which supports reading and writing xml1 plist files. It converts the xml1 plist files to Python standard types such as dictionary, list, etc. It will also write out properly structured Python types as plist xml1 files. If you are not familiar with the xml1 format, please see the man pages for 'plutil'. I have been using plist.py to adjust certain system plist files on new machines as part of an installation system that I have written in python and it has worked quite well for me. You can find plist.py here if you are interested: http://homepage.mac.com/kpreid/Mac/#plistpy From bob at redivi.com Mon Jul 24 23:15:05 2006 From: bob at redivi.com (Bob Ippolito) Date: Mon, 24 Jul 2006 14:15:05 -0700 Subject: [Pythonmac-SIG] plist.py In-Reply-To: <45A86D8C-6180-41E9-BF71-DEDE02552522@mac.com> References: <45A86D8C-6180-41E9-BF71-DEDE02552522@mac.com> Message-ID: <0A8EC772-273F-4794-A7C3-485BFD55D6C2@redivi.com> On Jul 24, 2006, at 1:38 PM, Robert White wrote: > Kevin Reid, http://homepage.mac.com/kpreid/, has just released v1.2 > of plist.py which supports reading and writing xml1 plist files. It > converts the xml1 plist files to Python standard types such as > dictionary, list, etc. It will also write out properly structured > Python types as plist xml1 files. If you are not familiar with the > xml1 format, please see the man pages for 'plutil'. I have been > using plist.py to adjust certain system plist files on new machines > as part of an installation system that I have written in python and > it has worked quite well for me. You can find plist.py here if you > are interested: > > http://homepage.mac.com/kpreid/Mac/#plistpy plist.py is incomplete (no dates!) and has some undesirable behavior (a str->string mapping is more commonly useful than a str->data mapping). You should probably use the plistlib.py module in the standard library, but make sure to pick it up from from Python 2.4 if using an older version of Python. -bob From a.h.jaffe at gmail.com Tue Jul 25 00:55:02 2006 From: a.h.jaffe at gmail.com (Andrew Jaffe) Date: Mon, 24 Jul 2006 23:55:02 +0100 Subject: [Pythonmac-SIG] Any way to use gcc 3.3 with universal build (on PPC) Message-ID: Hi All, I've recently upgraded to the Universal Build, since 2.4.3 seems to be needed for the most recent version of numpy. Further, the universal build is made with gcc 4.0.1, and seems to need that for compiling extensions. This does present a few problems: numpy actually has a fairly obscure bug on OSX with gcc 4. More importantly, g77 and gcc 4.0 don't seem to play that well together (and neither gfortran nor g95 seem to be quite there yet, for various reasons). So, is there any way to use gcc 3.3 with the universal build? It seems like it should be possible, since modules actually built with 3.3 under python2.4.1 work fine. Yours, Andrew From bob at redivi.com Tue Jul 25 00:59:36 2006 From: bob at redivi.com (Bob Ippolito) Date: Mon, 24 Jul 2006 15:59:36 -0700 Subject: [Pythonmac-SIG] Any way to use gcc 3.3 with universal build (on PPC) In-Reply-To: References: Message-ID: <7C48145A-5882-4CC7-A0C3-72B4C7B03630@redivi.com> On Jul 24, 2006, at 3:55 PM, Andrew Jaffe wrote: > I've recently upgraded to the Universal Build, since 2.4.3 seems to be > needed for the most recent version of numpy. > > Further, the universal build is made with gcc 4.0.1, and seems to need > that for compiling extensions. > > This does present a few problems: numpy actually has a fairly obscure > bug on OSX with gcc 4. More importantly, g77 and gcc 4.0 don't seem to > play that well together (and neither gfortran nor g95 seem to be quite > there yet, for various reasons). > > So, is there any way to use gcc 3.3 with the universal build? It seems > like it should be possible, since modules actually built with 3.3 > under > python2.4.1 work fine. gcc 3.3 can only build PPC. You'd have to try pretty hard to get it to use GCC 3.3, and you'd end up with a .so that is PPC only. -bob From a.h.jaffe at gmail.com Tue Jul 25 01:02:10 2006 From: a.h.jaffe at gmail.com (Andrew Jaffe) Date: Tue, 25 Jul 2006 00:02:10 +0100 Subject: [Pythonmac-SIG] Any way to use gcc 3.3 with universal build (on PPC) In-Reply-To: <7C48145A-5882-4CC7-A0C3-72B4C7B03630@redivi.com> References: <7C48145A-5882-4CC7-A0C3-72B4C7B03630@redivi.com> Message-ID: <4FF7D455-F2C5-493A-83BB-4431294CBAD7@gmail.com> On 24 Jul 2006, at 23:59, Bob Ippolito wrote: > > On Jul 24, 2006, at 3:55 PM, Andrew Jaffe wrote: > >> I've recently upgraded to the Universal Build, since 2.4.3 seems >> to be >> needed for the most recent version of numpy. >> >> Further, the universal build is made with gcc 4.0.1, and seems to >> need >> that for compiling extensions. >> >> This does present a few problems: numpy actually has a fairly obscure >> bug on OSX with gcc 4. More importantly, g77 and gcc 4.0 don't >> seem to >> play that well together (and neither gfortran nor g95 seem to be >> quite >> there yet, for various reasons). >> >> So, is there any way to use gcc 3.3 with the universal build? It >> seems >> like it should be possible, since modules actually built with 3.3 >> under >> python2.4.1 work fine. > > gcc 3.3 can only build PPC. You'd have to try pretty hard to get it > to use GCC 3.3, and you'd end up with a .so that is PPC only. exactly... I'm on PPC, so that works for me. but I'm not sure the 'try pretty hard' would be worth it (although speed is indeed an issue). Thanks for the quick response! Yours, Andrew From Chris.Barker at noaa.gov Tue Jul 25 01:19:44 2006 From: Chris.Barker at noaa.gov (Christopher Barker) Date: Mon, 24 Jul 2006 16:19:44 -0700 Subject: [Pythonmac-SIG] Any way to use gcc 3.3 with universal build (on PPC) In-Reply-To: References: Message-ID: <44C55590.6050705@noaa.gov> Andrew Jaffe wrote: > This does present a few problems: numpy actually has a fairly obscure > bug on OSX with gcc 4. Is this in the bug tracker and on the table for fixing before 1.0 comes out? I hope so -- gcc4.* is not exactly bleeding edge anymore. > More importantly, g77 and gcc 4.0 don't seem to > play that well together Yeah, this is a pain in the %$^$$! I'm disappointed that this hasn't been fixed yet, but I'm not helping either, so what can I say? There are a number of numpy users (and developers) on this list. Someone must have gotten SciPy working by now! Anyone want to speak up? -Chris -- Christopher Barker, Ph.D. Oceanographer NOAA/OR&R/HAZMAT (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 Jul 25 01:32:26 2006 From: Chris.Barker at noaa.gov (Christopher Barker) Date: Mon, 24 Jul 2006 16:32:26 -0700 Subject: [Pythonmac-SIG] problem installing TigerPython24Fix In-Reply-To: <166b1c630607241314w18f5aa1ft8290807a9eeb5766@mail.gmail.com> References: <166b1c630607241314w18f5aa1ft8290807a9eeb5766@mail.gmail.com> Message-ID: <44C5588A.50901@noaa.gov> IloChab wrote: > Could it be something related to the Intel core of my Mac? > On the page from where I downloaded the fix > http://pythonmac.org/packages/legacy.html Note the URL in that page: "legacy". That means this is old stuff you don't need if you have a new system. Bob, I do have one suggestion that might help people from getting misdirected: The main page of: www.pythonmac.org Has a bunch of links, most of which are pretty old pages. In fact, Jack Jansen's site is very prominent, and its latest news is over 2 years old. Indeed, there is no link to the packages page there at all. Having the Wiki at the top is good, but right under it, or perhaps at the top of the page should be a prominent Section that looks something like: """ Installing the latest Python and packages on OS-X: The latest supported build of Python for OS-X Tiger (10.4.*) can be found here: http://www.pythonmac.org/packages/py24-fat/index.html In addition to Python itself, you will find a collection of pre-build third-party packages there. """ I think I see the source of the OP's confusion, however. On the python,.org Mac download page (http://www.python.org/download/mac/), I see: """ On Mac OS X 10.4 (Tiger), download and run this installer (which gives you a PPC-only version of Python 2.4.1), and then download and run this other installer (which makes your new Python co-exist peacefully with the pre-installed version of Python). A Universal build installer for Python 2.4.3 is also available. """ Could someone with commit privileges on that site please fix that? -Chris -- Christopher Barker, Ph.D. Oceanographer NOAA/OR&R/HAZMAT (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 Jul 25 01:41:45 2006 From: Chris.Barker at noaa.gov (Christopher Barker) Date: Mon, 24 Jul 2006 16:41:45 -0700 Subject: [Pythonmac-SIG] [Pyobjc-dev] [ANN] py2app 0.3.2 In-Reply-To: References: <313171D7-A11B-4BE2-A1AF-984E9C1EA53A@chello.at> <7C152654-53AF-45F1-9C82-E4CB0414CD2F@chello.at> <18EDC9EA-A5E8-46A7-AC84-CF852458956F@redivi.com> <8221CF7F-1226-4F0D-AE6B-B1D956B860A8@mac.com> <44C4F5E7.6080909@noaa.gov> <44C50EB2.2050201@noaa.gov> Message-ID: <44C55AB9.4060701@noaa.gov> >>> When a script is installed somewhere central, like /usr/local/bin, >>> that's really all that makes sense. >> >> That's clearly irrelevant, because people aren't going to be double- >> clicking on files that you have to do "magic incantations" to even >> see from Finder. Fair enough, but what about /Applications, etc? > The main problem here is that there isn't really a "current" directory > in the GUI experience. That's what I meant by "it all goes to heck" > That's why normal application bundles start with > / as the CWD. Which is a poor choice: these really should default to $HOME. I'm sick of accidentally dumping MSExcel files in my root directory. I can't think of any time anyone should ever put anything in (or get anything from) /. Most applications should only ever be manipulating files inside $HOME. >> I have never in my life seen a script that must be started >> with a working directory of $HOME (unless it also lives there). It is >> however extremely common for scripts to require that they are run >> from the directory they live in. OK I'm sold (not that I needed to be). There are instances, however. For example, SPE isn't built as an .app. I have a friend that has set it up to click on it and PythonLauncher starts it. In that case, $HOME makes more sense. However, the real solution is to build an .app or applet with it. > Nope, that's not possible. If you want argv emulation you'll have to > build an applet. That does seem the best solution. -Chris -- Christopher Barker, Ph.D. Oceanographer NOAA/OR&R/HAZMAT (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 w.northcott at unsw.edu.au Tue Jul 25 02:40:47 2006 From: w.northcott at unsw.edu.au (Bill Northcott) Date: Tue, 25 Jul 2006 10:40:47 +1000 Subject: [Pythonmac-SIG] [Pyobjc-dev] [ANN] py2app 0.3.2 In-Reply-To: References: Message-ID: <699F5A69-52EB-4A70-A4DD-DAEEF182DDCB@unsw.edu.au> On 25/07/2006, at 6:20 AM, Christopher Barker wrote: >> Setting the working directory to the directory containing the >> script would be more useful. It really is a bad idea to write into software directories of any sort. They should be able to be write protected for security. > > I'm not so sure. That's a bad habit from the old MacOS and Windows. > $HOME is an excellent choice for the default working directory. /tmp is also to be preferred to $HOME because on most UNIX systems including MacOS X, it is cleaned out an each reboot. If you use $HOME you end up with a mass of old temporary files - the standard Windows curse. Apple seem to have adopted a convention of using /tmp/UID. I think the idea is that these are cleaned when the user logs out. So a full restart is not needed to clean out junk. Bill Northcott From mariocape at comcast.net Sun Jul 23 04:47:45 2006 From: mariocape at comcast.net (Mario Capellari) Date: Sat, 22 Jul 2006 19:47:45 -0700 Subject: [Pythonmac-SIG] How to get pyFltk installed? In-Reply-To: References: Message-ID: Good point Jim - I just now realized this myself. So I re-compiled/installed Python2.4 - and reverted back to fltk version 1.1 (instead of 1.1.1), as suggested by Andreas Held himself. Now I'm getting these messages when trying to build pyfltk: cc1plus: warning: command line option "-Wstrict-prototypes" is valid for C/ObjC but not for C++ ./python/fltk_wrap.cpp: In function `int pyFLTK_handlerCallback(int)': ./python/fltk_wrap.cpp:3595: warning: unused variable 'rec_code' ./python/fltk_wrap.cpp: In function `int fl_mt_ask(const char*)': ./python/fltk_wrap.cpp:3828: warning: 'fl_ask' is deprecated (declared at /usr/local/include/FL/fl_ask.H:59) ./python/fltk_wrap.cpp:3828: warning: 'fl_ask' is deprecated (declared at /usr/local/include/FL/fl_ask.H:59) ./python/fltk_wrap.cpp: In function `PyObject* _wrap_fl_ask__varargs__ (PyObject*, PyObject*, PyObject*)': ./python/fltk_wrap.cpp:40324: warning: 'fl_ask' is deprecated (declared at /usr/local/include/FL/fl_ask.H:59) ./python/fltk_wrap.cpp:40324: warning: 'fl_ask' is deprecated (declared at /usr/local/include/FL/fl_ask.H:59) cc1plus: warning: command line option "-Wstrict-prototypes" is valid for C/ObjC but not for C++ cc1plus: warning: command line option "-Wstrict-prototypes" is valid for C/ObjC but not for C++ cc1plus: warning: command line option "-Wstrict-prototypes" is valid for C/ObjC but not for C++ /usr/bin/ld: warning -L: directory name (lib) does not exist and this then trying to load fltk in python (a different error than before, looks like in 1.1 the OpenGL Frameworks are working now): Python 2.4.3 (#1, Jul 22 2006, 11:26:13) [GCC 4.0.0 20041026 (Apple Computer, Inc. build 4061)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> import fltk Traceback (most recent call last): File "", line 1, in ? File "/usr/local/lib/python2.4/site-packages/fltk.py", line 11, in ? import _fltk ImportError: Failure linking new module: /usr/local/lib/python2.4/ site-packages/_fltk.so: Symbol not found: __ZN2Fl6unlockEv Referenced from: /usr/local/lib/python2.4/site-packages/_fltk.so Expected in: dynamic lookup On Jul 22, 2006, at 7:07 PM, Jim Tittsler wrote: > On Jul 23, 2006, at 3:35 , mariocape wrote: > >> Of course I'd like to continue playing with it at home, running MacOS >> X 10.4.7 >> on a PowerBook (GCC 3.3, Python 2.4) > > Here you mention Python 2.4... > >>>>> import fltk >> Traceback (most recent call last): >> File "", line 1, in ? >> File "/System/Library/Frameworks/Python.framework/Versions/2.3/ >> lib/ >> python2.3/site-packages/fltk.py", line 11, in ? > > but you appear to be using Python 2.3. Is there some confusion in > the path to the preferred version? > > _______________________________________________ > Pythonmac-SIG maillist - Pythonmac-SIG at python.org > http://mail.python.org/mailman/listinfo/pythonmac-sig From bob at redivi.com Tue Jul 25 10:28:14 2006 From: bob at redivi.com (Bob Ippolito) Date: Tue, 25 Jul 2006 01:28:14 -0700 Subject: [Pythonmac-SIG] [Pyobjc-dev] [ANN] py2app 0.3.2 In-Reply-To: <44C55AB9.4060701@noaa.gov> References: <313171D7-A11B-4BE2-A1AF-984E9C1EA53A@chello.at> <7C152654-53AF-45F1-9C82-E4CB0414CD2F@chello.at> <18EDC9EA-A5E8-46A7-AC84-CF852458956F@redivi.com> <8221CF7F-1226-4F0D-AE6B-B1D956B860A8@mac.com> <44C4F5E7.6080909@noaa.gov> <44C50EB2.2050201@noaa.gov> <44C55AB9.4060701@noaa.gov> Message-ID: On Jul 24, 2006, at 4:41 PM, Christopher Barker wrote: >>>> When a script is installed somewhere central, like /usr/local/bin, >>>> that's really all that makes sense. >>> >>> That's clearly irrelevant, because people aren't going to be double- >>> clicking on files that you have to do "magic incantations" to even >>> see from Finder. > > Fair enough, but what about /Applications, etc? That's twelve times as irrelevant because anything there is an application bundle. >> That's why normal application bundles start with >> / as the CWD. > > Which is a poor choice: these really should default to $HOME. I'm sick > of accidentally dumping MSExcel files in my root directory. I can't > think of any time anyone should ever put anything in (or get anything > from) /. Most applications should only ever be manipulating files > inside > $HOME. It's not a poor choice at all. It's Apple telling software developers that relative paths are a really stupid idea in a system where users are supposed to be able to move things around wherever the hell they want, even at runtime. >>> I have never in my life seen a script that must be started >>> with a working directory of $HOME (unless it also lives there). >>> It is >>> however extremely common for scripts to require that they are run >>> from the directory they live in. > > OK I'm sold (not that I needed to be). > > There are instances, however. For example, SPE isn't built as > an .app. I > have a friend that has set it up to click on it and PythonLauncher > starts it. In that case, $HOME makes more sense. However, the real > solution is to build an .app or applet with it. Well, no. $HOME still doesn't make any sense for the working directory. It should be built as an .app, however, because people will want SPE to be associated as an editor for .py files. -bob From david.warde.farley at utoronto.ca Tue Jul 25 22:21:31 2006 From: david.warde.farley at utoronto.ca (David Warde-Farley) Date: Tue, 25 Jul 2006 16:21:31 -0400 Subject: [Pythonmac-SIG] "del" key in the REPL? Message-ID: <4DFF1864-9E04-4AEE-9279-73C41E084C97@utoronto.ca> It's merely a minor annoyance, but has anyone else noticed that hitting the "forward delete" key (not the Delete aka backspace key two rows above return) on a full-sized keyboard crashes the Universal Python interpreter? Not immediately, you either have to hit it a few times or hit it and then hit another key, and it produces a bus error. My Terminal.app is sending \033[3~ for that key. (gdb) backtrace #0 0x000bbce0 in _rl_dispatch_callback () #1 0x000ba3f4 in rl_callback_read_char () #2 0x000abdfc in call_readline (sys_stdin=0xe56ec, sys_stdout=0x1, prompt=0xbffff218 "") at /Volumes/Data/Users/ronald/Universal/ python24-fat/Modules/readline.c:778 #3 0x00209bc0 in PyOS_Readline (sys_stdin=0xa0001b9c, sys_stdout=0xa0001bf4, prompt=0x5cc54 ">>> ") at /Volumes/Data/Users/ ronald/Universal/python24-fat/Parser/myreadline.c:208 #4 0x0020b050 in tok_nextc (tok=0x1845600) at /Volumes/Data/Users/ ronald/Universal/python24-fat/Parser/tokenizer.c:765 #5 0x0020b72c in PyTokenizer_Get (tok=0x1845600, p_start=0xbffff4d8, p_end=0xbffff4dc) at /Volumes/Data/Users/ronald/Universal/python24- fat/Parser/tokenizer.c:1099 #6 0x00206c50 in parsetok (tok=0x1845600, g=0x0, start=762336, err_ret=0xbffff558, flags=0) at /Volumes/Data/Users/ronald/Universal/ python24-fat/Parser/parsetok.c:125 #7 0x002b56d8 in PyRun_InteractiveOneFlags (fp=0xa0001b9c, filename=0x2eb18c "", flags=0xbffff6ac) at /Volumes/Data/Users/ ronald/Universal/python24-fat/Python/pythonrun.c:743 #8 0x002b5998 in PyRun_InteractiveLoopFlags (fp=0xa0001b9c, filename=0x2eb18c "", flags=0xbffff6ac) at /Volumes/Data/Users/ ronald/Universal/python24-fat/Python/pythonrun.c:695 #9 0x002b6648 in PyRun_AnyFileExFlags (fp=0xa0001b9c, filename=0x2eb18c "", closeit=0, flags=0xbffff6ac) at /Volumes/ Data/Users/ronald/Universal/python24-fat/Python/pythonrun.c:658 #10 0x002c0bfc in Py_Main (argc=536870912, argv=0x0) at /Volumes/Data/ Users/ronald/Universal/python24-fat/Modules/main.c:501 #11 0x0000257c in _call_objcInit () at /SourceCache/Csu/Csu-58/crt.c:361 #12 0x00002424 in _start (argc=1, argv=0xbffff818, envp=0xbffff820) at /SourceCache/Csu/Csu-58/crt.c:205 Looks like readline's problem, though I've never seen this behaviour on the other readline-linked apps I use. Here's the version info: Python 2.4.3 (#1, Apr 7 2006, 10:54:33) [GCC 4.0.1 (Apple Computer, Inc. build 5250)] on darwin Regards, David From ronaldoussoren at mac.com Tue Jul 25 22:33:22 2006 From: ronaldoussoren at mac.com (Ronald Oussoren) Date: Tue, 25 Jul 2006 22:33:22 +0200 Subject: [Pythonmac-SIG] "del" key in the REPL? In-Reply-To: <4DFF1864-9E04-4AEE-9279-73C41E084C97@utoronto.ca> References: <4DFF1864-9E04-4AEE-9279-73C41E084C97@utoronto.ca> Message-ID: <163A7B9B-B53C-4B0E-99F4-FC15DC11C191@mac.com> On Jul 25, 2006, at 10:21 PM, David Warde-Farley wrote: > > Looks like readline's problem, though I've never seen this behaviour > on the other readline-linked apps I use. Yup, its a readline issue. The universal 2.4.3 installer was build using a static copy of libreadline, but didn't include some post- release patches for readline. For some reason the readline developers seem to think that shipping post-release patches instead of doing micro-releases is a good idea. I've fixed this for the 2.5 installer, and didn't have time yet to build a new version of the 2.4 installer. Ronald From skatty at gmail.com Wed Jul 26 01:36:39 2006 From: skatty at gmail.com (skat) Date: Wed, 26 Jul 2006 11:36:39 +1200 Subject: [Pythonmac-SIG] contact Message-ID: <217286410607251636q5625688bub8ceb23a906d0125@mail.gmail.com> Brian, Its Kat here, ex IHUG. Can you contact me please, I have a question. thanks -- skype: skatskype icq: 17419348 cell: +64 9 21 623 557 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/pythonmac-sig/attachments/20060726/8d15449d/attachment.html From kantel at mpiwg-berlin.mpg.de Wed Jul 26 13:08:52 2006 From: kantel at mpiwg-berlin.mpg.de (=?ISO-8859-1?Q?J=F6rg_Kantel?=) Date: Wed, 26 Jul 2006 13:08:52 +0200 Subject: [Pythonmac-SIG] problem installing Python Image Library In-Reply-To: <44C5588A.50901@noaa.gov> References: <166b1c630607241314w18f5aa1ft8290807a9eeb5766@mail.gmail.com> <44C5588A.50901@noaa.gov> Message-ID: <41875E38-4C3F-4378-BE89-874F49438DE4@mpiwg-berlin.mpg.de> Hi, today I tried to install the Python Image Library from this site and after the installer runs succesfully (it says) I got the following message import Image ImportError: No module named Image It happens when I'm running python from /usr/local/bin/ as well as from /usr/bin/ Any suggestions? Thanks in advance (and excuse my bad (d)english) J"org -- J"org Kantel Max-Planck-Institute for the History of Science Computer Department Boltzmannstr. 22 D-14195 Berlin fon: +4930-22667-220 fax: +4930-22667-299 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/pythonmac-sig/attachments/20060726/fdff00d2/attachment.html From daniellord at mac.com Wed Jul 26 16:58:11 2006 From: daniellord at mac.com (Daniel Lord) Date: Wed, 26 Jul 2006 07:58:11 -0700 Subject: [Pythonmac-SIG] problem installing Python Image Library 2nd Post In-Reply-To: <41875E38-4C3F-4378-BE89-874F49438DE4@mpiwg-berlin.mpg.de> References: <166b1c630607241314w18f5aa1ft8290807a9eeb5766@mail.gmail.com> <44C5588A.50901@noaa.gov> <41875E38-4C3F-4378-BE89-874F49438DE4@mpiwg-berlin.mpg.de> Message-ID: <88940D4C-036F-480D-9D13-10691481BF72@mac.com> I just tried the PIL build with the 2.5b version and it fails but the 2.4.3 version works fine...see below. My hunch is Ronald might have disabled some paths in order to keep the beta from interfering with the standard 2.4 install. Or not ;-) Ronald what say you? [daniello at mercury.local]$ python2.5 Python 2.5b1 (r25b1:47038M, Jun 20 2006, 16:17:55) [GCC 4.0.1 (Apple Computer, Inc. build 5341)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> import Image Traceback (most recent call last): File "", line 1, in ImportError: No module named Image >>> Python 2.4.3 (#1, Apr 7 2006, 10:54:33) [GCC 4.0.1 (Apple Computer, Inc. build 5250)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> import Image >>> On Jul 26, 2006, at 4:08, J?rg Kantel wrote: > Hi, > > today I tried to install the Python Image Library from this site > and after the > installer runs succesfully (it says) I got the following message > > import Image > ImportError: No module named Image > > It happens when I'm running python from /usr/local/bin/ as well as > from /usr/bin/ > > Any suggestions? > > Thanks in advance (and excuse my bad (d)english) > > J"org > > -- > J"org Kantel > Max-Planck-Institute for the History of Science > Computer Department > Boltzmannstr. 22 D-14195 Berlin > fon: +4930-22667-220 fax: +4930-22667-299 > > > _______________________________________________ > Pythonmac-SIG maillist - Pythonmac-SIG at python.org > http://mail.python.org/mailman/listinfo/pythonmac-sig "I have never won a debate with an ignorant person." -Ali ibn Abi Talib -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/pythonmac-sig/attachments/20060726/ee5e960d/attachment.html From daniellord at mac.com Wed Jul 26 16:52:16 2006 From: daniellord at mac.com (Daniel Lord) Date: Wed, 26 Jul 2006 07:52:16 -0700 Subject: [Pythonmac-SIG] problem installing Python Image Library In-Reply-To: <41875E38-4C3F-4378-BE89-874F49438DE4@mpiwg-berlin.mpg.de> References: <166b1c630607241314w18f5aa1ft8290807a9eeb5766@mail.gmail.com> <44C5588A.50901@noaa.gov> <41875E38-4C3F-4378-BE89-874F49438DE4@mpiwg-berlin.mpg.de> Message-ID: Are you using the Python 2.5 beta or the standard 2.4 install? the PIL build was made for the 2.4 installation and seemed to work fine with it, but I have not tested it with the 2.5 Beta. Daniel On Jul 26, 2006, at 4:08, J?rg Kantel wrote: > Hi, > > today I tried to install the Python Image Library from this site > and after the > installer runs succesfully (it says) I got the following message > > import Image > ImportError: No module named Image > > It happens when I'm running python from /usr/local/bin/ as well as > from /usr/bin/ > > Any suggestions? > > Thanks in advance (and excuse my bad (d)english) > > J"org > > -- > J"org Kantel > Max-Planck-Institute for the History of Science > Computer Department > Boltzmannstr. 22 D-14195 Berlin > fon: +4930-22667-220 fax: +4930-22667-299 > > > _______________________________________________ > Pythonmac-SIG maillist - Pythonmac-SIG at python.org > http://mail.python.org/mailman/listinfo/pythonmac-sig "I have never won a debate with an ignorant person." -Ali ibn Abi Talib -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/pythonmac-sig/attachments/20060726/7461800a/attachment.htm From bob at redivi.com Wed Jul 26 19:39:50 2006 From: bob at redivi.com (Bob Ippolito) Date: Wed, 26 Jul 2006 10:39:50 -0700 Subject: [Pythonmac-SIG] problem installing Python Image Library 2nd Post In-Reply-To: <88940D4C-036F-480D-9D13-10691481BF72@mac.com> References: <166b1c630607241314w18f5aa1ft8290807a9eeb5766@mail.gmail.com> <44C5588A.50901@noaa.gov> <41875E38-4C3F-4378-BE89-874F49438DE4@mpiwg-berlin.mpg.de> <88940D4C-036F-480D-9D13-10691481BF72@mac.com> Message-ID: On Jul 26, 2006, at 7:58 AM, Daniel Lord wrote: > I just tried the PIL build with the 2.5b version and it fails but > the 2.4.3 version works fine...see below. > My hunch is Ronald might have disabled some paths in order to keep > the beta from interfering with the standard 2.4 install. Or not ;-) > Ronald what say you? Each Python installation has its own site-packages dir. Ronald didn't do anything to it, that's how Python works on every platform. It has to be that way, extensions and bytecode aren't compatible across minor versions. -bob From Larry.A.Meyn at nasa.gov Wed Jul 26 19:48:33 2006 From: Larry.A.Meyn at nasa.gov (Larry Meyn) Date: Wed, 26 Jul 2006 10:48:33 -0700 Subject: [Pythonmac-SIG] problem installing Python Image Library 2nd Post In-Reply-To: References: <166b1c630607241314w18f5aa1ft8290807a9eeb5766@mail.gmail.com> <44C5588A.50901@noaa.gov> <41875E38-4C3F-4378-BE89-874F49438DE4@mpiwg-berlin.mpg.de> <88940D4C-036F-480D-9D13-10691481BF72@mac.com> Message-ID: <8F3FB876-0371-4418-A0C6-2AF116ECBAFD@nasa.gov> For some reason the PIL seems to get installed with inappropriate permissions. Changing the permissions fixes the problem. Larry On Jul 26, 2006, at 10:39 AM, Bob Ippolito wrote: > > On Jul 26, 2006, at 7:58 AM, Daniel Lord wrote: > >> I just tried the PIL build with the 2.5b version and it fails but >> the 2.4.3 version works fine...see below. >> My hunch is Ronald might have disabled some paths in order to keep >> the beta from interfering with the standard 2.4 install. Or not ;-) >> Ronald what say you? > > Each Python installation has its own site-packages dir. Ronald didn't > do anything to it, that's how Python works on every platform. It has > to be that way, extensions and bytecode aren't compatible across > minor versions. > > -bob > > _______________________________________________ > Pythonmac-SIG maillist - Pythonmac-SIG at python.org > http://mail.python.org/mailman/listinfo/pythonmac-sig From bob at redivi.com Wed Jul 26 21:26:13 2006 From: bob at redivi.com (Bob Ippolito) Date: Wed, 26 Jul 2006 12:26:13 -0700 Subject: [Pythonmac-SIG] problem installing Python Image Library 2nd Post In-Reply-To: <8F3FB876-0371-4418-A0C6-2AF116ECBAFD@nasa.gov> References: <166b1c630607241314w18f5aa1ft8290807a9eeb5766@mail.gmail.com> <44C5588A.50901@noaa.gov> <41875E38-4C3F-4378-BE89-874F49438DE4@mpiwg-berlin.mpg.de> <88940D4C-036F-480D-9D13-10691481BF72@mac.com> <8F3FB876-0371-4418-A0C6-2AF116ECBAFD@nasa.gov> Message-ID: <09970F1D-6707-4E68-A297-0D884D857B44@redivi.com> Could you be more specific? I didn't have any issues. -bob On Jul 26, 2006, at 10:48 AM, Larry Meyn wrote: > For some reason the PIL seems to get installed with inappropriate > permissions. Changing the permissions fixes the problem. > > Larry > > On Jul 26, 2006, at 10:39 AM, Bob Ippolito wrote: > >> >> On Jul 26, 2006, at 7:58 AM, Daniel Lord wrote: >> >>> I just tried the PIL build with the 2.5b version and it fails but >>> the 2.4.3 version works fine...see below. >>> My hunch is Ronald might have disabled some paths in order to keep >>> the beta from interfering with the standard 2.4 install. Or not ;-) >>> Ronald what say you? >> >> Each Python installation has its own site-packages dir. Ronald didn't >> do anything to it, that's how Python works on every platform. It has >> to be that way, extensions and bytecode aren't compatible across >> minor versions. >> >> -bob >> >> _______________________________________________ >> Pythonmac-SIG maillist - Pythonmac-SIG at python.org >> http://mail.python.org/mailman/listinfo/pythonmac-sig > > _______________________________________________ > Pythonmac-SIG maillist - Pythonmac-SIG at python.org > http://mail.python.org/mailman/listinfo/pythonmac-sig From ronaldoussoren at mac.com Wed Jul 26 21:34:48 2006 From: ronaldoussoren at mac.com (Ronald Oussoren) Date: Wed, 26 Jul 2006 21:34:48 +0200 Subject: [Pythonmac-SIG] problem installing Python Image Library 2nd Post In-Reply-To: <88940D4C-036F-480D-9D13-10691481BF72@mac.com> References: <166b1c630607241314w18f5aa1ft8290807a9eeb5766@mail.gmail.com> <44C5588A.50901@noaa.gov> <41875E38-4C3F-4378-BE89-874F49438DE4@mpiwg-berlin.mpg.de> <88940D4C-036F-480D-9D13-10691481BF72@mac.com> Message-ID: On Jul 26, 2006, at 4:58 PM, Daniel Lord wrote: > I just tried the PIL build with the 2.5b version and it fails but > the 2.4.3 version works fine...see below. > My hunch is Ronald might have disabled some paths in order to keep > the beta from interfering with the standard 2.4 install. Or not ;-) > Ronald what say you? The 2.5b2 installer is a full installer, if you install it completely you will interfere with the 2.4 installer. Specifically some of the links in /usr/local/bin are replaced, as is the Current link in the framework. Neither should affect the functionality of either 2.5 or 2.4.3. The binary installers on pythonmac.org won't work with 2.4. First of all they install the files in a location where only the 2.4 framework will look for them, and furthermore extensions (and .pyc files) are specific for major release (2.4 vs. 2.5) of python (formally put, the python team doesn't guaranty ABI compatibility between major releases). Ronald > > [daniello at mercury.local]$ python2.5 > Python 2.5b1 (r25b1:47038M, Jun 20 2006, 16:17:55) > [GCC 4.0.1 (Apple Computer, Inc. build 5341)] on darwin > Type "help", "copyright", "credits" or "license" for more information. > >>> import Image > Traceback (most recent call last): > File "", line 1, in > ImportError: No module named Image > >>> > > > Python 2.4.3 (#1, Apr 7 2006, 10:54:33) > [GCC 4.0.1 (Apple Computer, Inc. build 5250)] on darwin > Type "help", "copyright", "credits" or "license" for more information. > >>> import Image > >>> > > On Jul 26, 2006, at 4:08, J?rg Kantel wrote: > >> Hi, >> >> today I tried to install the Python Image Library from this site >> and after the >> installer runs succesfully (it says) I got the following message >> >> import Image >> ImportError: No module named Image >> >> It happens when I'm running python from /usr/local/bin/ as well as >> from /usr/bin/ >> >> Any suggestions? >> >> Thanks in advance (and excuse my bad (d)english) >> >> J"org >> >> -- >> J"org Kantel >> Max-Planck-Institute for the History of Science >> Computer Department >> Boltzmannstr. 22 D-14195 Berlin >> fon: +4930-22667-220 fax: +4930-22667-299 >> >> >> _______________________________________________ >> Pythonmac-SIG maillist - Pythonmac-SIG at python.org >> http://mail.python.org/mailman/listinfo/pythonmac-sig > > "I have never won a debate with an ignorant person." > -Ali ibn Abi Talib > > > > _______________________________________________ > Pythonmac-SIG maillist - Pythonmac-SIG at python.org > http://mail.python.org/mailman/listinfo/pythonmac-sig From Larry.A.Meyn at nasa.gov Wed Jul 26 23:25:45 2006 From: Larry.A.Meyn at nasa.gov (Larry Meyn) Date: Wed, 26 Jul 2006 14:25:45 -0700 Subject: [Pythonmac-SIG] problem installing Python Image Library 2nd Post In-Reply-To: <09970F1D-6707-4E68-A297-0D884D857B44@redivi.com> References: <166b1c630607241314w18f5aa1ft8290807a9eeb5766@mail.gmail.com> <44C5588A.50901@noaa.gov> <41875E38-4C3F-4378-BE89-874F49438DE4@mpiwg-berlin.mpg.de> <88940D4C-036F-480D-9D13-10691481BF72@mac.com> <8F3FB876-0371-4418-A0C6-2AF116ECBAFD@nasa.gov> <09970F1D-6707-4E68-A297-0D884D857B44@redivi.com> Message-ID: <419AADF6-E081-4D0A-BAAA-453A809C5654@nasa.gov> I didn't have any issues either on my old machine which only has me as an admin. However, on a new machine of mine their are two admin accounts, mine (lmeyn) and another (macadmin). PIL seems to get installed with restricted access and with access only for the other account only, for example: $ ls -le PIL.pth -rw--w---- 1 macadmin admin 4 Apr 19 09:23 PIL.pth This also happened when I did an install from the PIL source using setup.py Larry On Jul 26, 2006, at 12:26 PM, Bob Ippolito wrote: > Could you be more specific? I didn't have any issues. > > -bob > > On Jul 26, 2006, at 10:48 AM, Larry Meyn wrote: > >> For some reason the PIL seems to get installed with inappropriate >> permissions. Changing the permissions fixes the problem. >> >> Larry >> >> On Jul 26, 2006, at 10:39 AM, Bob Ippolito wrote: >> >>> >>> On Jul 26, 2006, at 7:58 AM, Daniel Lord wrote: >>> >>>> I just tried the PIL build with the 2.5b version and it fails but >>>> the 2.4.3 version works fine...see below. >>>> My hunch is Ronald might have disabled some paths in order to keep >>>> the beta from interfering with the standard 2.4 install. Or not ;-) >>>> Ronald what say you? >>> >>> Each Python installation has its own site-packages dir. Ronald >>> didn't >>> do anything to it, that's how Python works on every platform. It has >>> to be that way, extensions and bytecode aren't compatible across >>> minor versions. >>> >>> -bob >>> >>> _______________________________________________ >>> Pythonmac-SIG maillist - Pythonmac-SIG at python.org >>> http://mail.python.org/mailman/listinfo/pythonmac-sig >> >> _______________________________________________ >> Pythonmac-SIG maillist - Pythonmac-SIG at python.org >> http://mail.python.org/mailman/listinfo/pythonmac-sig > > _______________________________________________ > Pythonmac-SIG maillist - Pythonmac-SIG at python.org > http://mail.python.org/mailman/listinfo/pythonmac-sig From daniellord at mac.com Thu Jul 27 04:54:14 2006 From: daniellord at mac.com (Daniel Lord) Date: Wed, 26 Jul 2006 19:54:14 -0700 Subject: [Pythonmac-SIG] problem installing Python Image Library 2nd Post In-Reply-To: References: <166b1c630607241314w18f5aa1ft8290807a9eeb5766@mail.gmail.com> <44C5588A.50901@noaa.gov> <41875E38-4C3F-4378-BE89-874F49438DE4@mpiwg-berlin.mpg.de> <88940D4C-036F-480D-9D13-10691481BF72@mac.com> Message-ID: <158511DB-69BF-4EB8-8CFA-85D3D58017A1@mac.com> Bob, Of course that makes sense. One runs each setup.py with the python version intended to install the package under. Apologies to Ronald-- not that I thought he did anything incorrectly, I was just assuming he might have done something to protect us. What do you know, I learn something new every single day. In fact I have my 2.5 and 2.4 side-by-side so to speak and working quite independently it seems now that I look at it. "That's the future gentlemen. What a fascinating modern age we live in." -- 'Lucky' Jack, Captain of HMS Surprise, "Master and Commander, the Far Side of the World Daniel On Jul 26, 2006, at 10:39, Bob Ippolito wrote: > > On Jul 26, 2006, at 7:58 AM, Daniel Lord wrote: > >> I just tried the PIL build with the 2.5b version and it fails but >> the 2.4.3 version works fine...see below. >> My hunch is Ronald might have disabled some paths in order to keep >> the beta from interfering with the standard 2.4 install. Or not ;-) >> Ronald what say you? > > Each Python installation has its own site-packages dir. Ronald > didn't do anything to it, that's how Python works on every > platform. It has to be that way, extensions and bytecode aren't > compatible across minor versions. > > -bob From Chris.Barker at noaa.gov Thu Jul 27 07:58:29 2006 From: Chris.Barker at noaa.gov (Christopher Barker) Date: Wed, 26 Jul 2006 22:58:29 -0700 Subject: [Pythonmac-SIG] problem installing Python Image Library 2nd Post In-Reply-To: References: <166b1c630607241314w18f5aa1ft8290807a9eeb5766@mail.gmail.com> <44C5588A.50901@noaa.gov> <41875E38-4C3F-4378-BE89-874F49438DE4@mpiwg-berlin.mpg.de> <88940D4C-036F-480D-9D13-10691481BF72@mac.com> Message-ID: <44C85605.3000609@noaa.gov> Ronald Oussoren wrote: > The binary installers on pythonmac.org won't work with 2.4. I assume this was a typo, and you meant: The binary installers on pythonmac.org won't work with 2.5 ^^^ -Chris -- Christopher Barker, Ph.D. Oceanographer NOAA/OR&R/HAZMAT (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 Thu Jul 27 08:10:26 2006 From: ronaldoussoren at mac.com (Ronald Oussoren) Date: Thu, 27 Jul 2006 08:10:26 +0200 Subject: [Pythonmac-SIG] problem installing Python Image Library 2nd Post In-Reply-To: <44C85605.3000609@noaa.gov> References: <166b1c630607241314w18f5aa1ft8290807a9eeb5766@mail.gmail.com> <44C5588A.50901@noaa.gov> <41875E38-4C3F-4378-BE89-874F49438DE4@mpiwg-berlin.mpg.de> <88940D4C-036F-480D-9D13-10691481BF72@mac.com> <44C85605.3000609@noaa.gov> Message-ID: On Jul 27, 2006, at 7:58 AM, Christopher Barker wrote: > Ronald Oussoren wrote: > >> The binary installers on pythonmac.org won't work with 2.4. > > I assume this was a typo, and you meant: > > The binary installers on pythonmac.org won't work with 2.5 > ^^^ That's right. Ronald > -Chris > > > -- > Christopher Barker, Ph.D. > Oceanographer > > NOAA/OR&R/HAZMAT (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 > _______________________________________________ > Pythonmac-SIG maillist - Pythonmac-SIG at python.org > http://mail.python.org/mailman/listinfo/pythonmac-sig From kantel at mpiwg-berlin.mpg.de Thu Jul 27 12:09:52 2006 From: kantel at mpiwg-berlin.mpg.de (=?ISO-8859-1?Q?J=F6rg_Kantel?=) Date: Thu, 27 Jul 2006 12:09:52 +0200 Subject: [Pythonmac-SIG] problem installing Python Image Library 2nd Post In-Reply-To: <419AADF6-E081-4D0A-BAAA-453A809C5654@nasa.gov> References: <166b1c630607241314w18f5aa1ft8290807a9eeb5766@mail.gmail.com> <44C5588A.50901@noaa.gov> <41875E38-4C3F-4378-BE89-874F49438DE4@mpiwg-berlin.mpg.de> <88940D4C-036F-480D-9D13-10691481BF72@mac.com> <8F3FB876-0371-4418-A0C6-2AF116ECBAFD@nasa.gov> <09970F1D-6707-4E68-A297-0D884D857B44@redivi.com> <419AADF6-E081-4D0A-BAAA-453A809C5654@nasa.gov> Message-ID: Hi Larry, Am 26.07.2006 um 17:17 schrieb Larry Meyn: > You can go to the folder /Library/Frameworks/Python.framework/ > Versions/2.4/lib/python2.4/site-packages, select the PIL folder, go > to the file menu and select "Get Info". There is a section for > "Ownership & Permissions" with a subsection "Details" that you may > have to expand. Here you can change the owner to your account and > set access to "Read & Write" for owner and group, "Read" for > others. You will probably have to click the lock icon and enter > you password to make these changes. Do a "Get Info" on the folder > again and click the button to apply permissions to folder contents. I tried it and now it works. Many thanks. > I didn't have any issues either on my old machine which only has me > as an admin. However, on a new machine of mine their are two admin > accounts, mine (lmeyn) and another (macadmin). PIL seems to get > installed with restricted access and with access only for the other > account only, for example: That's maybe what happend to me. I also have had no problems to install PIL at my machines at home (with only me as admin). But here in the Institute there are at least two admins at every machine. Once again: Many thanks J"org -- J"org Kantel Max-Planck-Institute for the History of Science Computer Department Boltzmannstr. 22 D-14195 Berlin fon: +4930-22667-220 fax: +4930-22667-299 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/pythonmac-sig/attachments/20060727/b7ec2050/attachment.htm From stconnexion at gmail.com Thu Jul 27 18:29:00 2006 From: stconnexion at gmail.com (st cnx) Date: Thu, 27 Jul 2006 10:29:00 -0600 Subject: [Pythonmac-SIG] secure delete file? Message-ID: <28a249790607270929u656702bas36e26ced59d52de@mail.gmail.com> The finder allows one to "secure empty trash". I want to add a feature to shred parts of the archive my program makes. Is there some OSX API to do this? Alternatively I can roll my own, but I'm wondering if overwriting a file, followed by F_FULLFSYNC is really enough because stuff might be left in spotlight. Anyone know? Amit Singh's book says spotlight can miss events, so deleting could be missed. Is there a way to tell spotlight to delete a file without removing the whole index for the volume? Thanks, Sengan From hetland at tamu.edu Thu Jul 27 19:20:18 2006 From: hetland at tamu.edu (Rob Hetland) Date: Thu, 27 Jul 2006 13:20:18 -0400 Subject: [Pythonmac-SIG] Error compiling agg.cxx on Mac OS X, python 2.5b2 Message-ID: I sent this message to the matplotlib-devel group, and it was suggested that I try on the pythonmac group as well. Any advice would be helpful. (If I don't reply right away, it's becuase I'm gone next week.. I'll eagerly try out all suggestions when I get back) I'm trying out the brand new python2.5b2. One of the reasons I am excited to upgrade is that ctypes are included in the new python, and this is pretty hard to get going by hand on the intel Macs because of an absent libffi. I get error: invalid conversion from ?const char*? to ?char? when trying to compile matplotlib on my intel Mac with python 2.5b2. I don't get a similar error with python 2.4.x. The full output is attached below. I tried to recompile agg.cxx with swig (recompiled to link with python 2.5b2) using this command python makeswig.py and I get the same error. BTW, numpy compiles without any complaints, and seems to work just fine. Any ideas? -Rob [...copying....] running build_ext building 'matplotlib._isnan' extension C compiler: gcc -arch ppc -arch i386 -isysroot /Developer/SDKs/ MacOSX10.4u.sdk -fno-strict-aliasing -Wno-long-double -no-cpp-precomp -mno-fused-madd -fno-common -dynamic -DNDEBUG -g -O3 creating build/temp.macosx-10.3-fat-2.5 creating build/temp.macosx-10.3-fat-2.5/src compile options: '-I/usr/local/include -I/usr/include -I. -I/Library/ Frameworks/Python.framework/Versions/2.5/include/python2.5 -c' gcc: src/_isnan.c In file included from /usr/include/math.h:26, from /Library/Frameworks/Python.framework/Versions/ 2.5/include/python2.5/pyport.h:200, from /Library/Frameworks/Python.framework/Versions/ 2.5/include/python2.5/Python.h:57, from src/_isnan.c:1: /usr/include/architecture/ppc/math.h:477: warning: conflicting types for built-in function ?scalb? gcc -arch i386 -arch ppc -isysroot /Developer/SDKs/MacOSX10.4u.sdk -g -bundle -undefined dynamic_lookup build/temp.macosx-10.3-fat-2.5/src/ _isnan.o -L/usr/local/lib -L/usr/lib -o build/lib.macosx-10.3-fat-2.5/ matplotlib/_isnan.so building 'matplotlib._agg' extension C compiler: gcc -arch ppc -arch i386 -isysroot /Developer/SDKs/ MacOSX10.4u.sdk -fno-strict-aliasing -Wno-long-double -no-cpp-precomp -mno-fused-madd -fno-common -dynamic -DNDEBUG -g -O3 creating build/temp.macosx-10.3-fat-2.5/agg23 creating build/temp.macosx-10.3-fat-2.5/agg23/src compile options: '-Iagg23/include -Isrc -Iswig -I/Library/Frameworks/ Python.framework/Versions/2.5/include/python2.5 -c' gcc: agg23/src/agg_rasterizer_scanline_aa.cpp gcc: agg23/src/agg_curves.cpp gcc: agg23/src/agg_trans_affine.cpp gcc: agg23/src/agg_vcgen_dash.cpp gcc: agg23/src/agg_bezier_arc.cpp gcc: src/agg.cxx src/agg.cxx: In function ?int SWIG_Python_ConvertFunctionPtr (PyObject*, void**, swig_type_info*)?: src/agg.cxx:2051: error: invalid conversion from ?const char*? to ?char*? src/agg.cxx: In function ?int SWIG_Python_ConvertFunctionPtr (PyObject*, void**, swig_type_info*)?: src/agg.cxx:2051: error: invalid conversion from ?const char*? to ?char*? src/agg.cxx: In function ?void SWIG_Python_FixMethods(PyMethodDef*, swig_const_info*, swig_type_info**, swig_type_info**)?: src/agg.cxx:31756: error: invalid conversion from ?const char*? to ?char*? src/agg.cxx: In function ?void SWIG_Python_FixMethods(PyMethodDef*, swig_const_info*, swig_type_info**, swig_type_info**)?: src/agg.cxx:31756: error: invalid conversion from ?const char*? to ?char*? lipo: can't figure out the architecture type of: /var/tmp//ccBRU9rF.out src/agg.cxx: In function ?int SWIG_Python_ConvertFunctionPtr (PyObject*, void**, swig_type_info*)?: src/agg.cxx:2051: error: invalid conversion from ?const char*? to ?char*? src/agg.cxx: In function ?int SWIG_Python_ConvertFunctionPtr (PyObject*, void**, swig_type_info*)?: src/agg.cxx:2051: error: invalid conversion from ?const char*? to ?char*? src/agg.cxx: In function ?void SWIG_Python_FixMethods(PyMethodDef*, swig_const_info*, swig_type_info**, swig_type_info**)?: src/agg.cxx:31756: error: invalid conversion from ?const char*? to ?char*? src/agg.cxx: In function ?void SWIG_Python_FixMethods(PyMethodDef*, swig_const_info*, swig_type_info**, swig_type_info**)?: src/agg.cxx:31756: error: invalid conversion from ?const char*? to ?char*? lipo: can't figure out the architecture type of: /var/tmp//ccBRU9rF.out error: Command "gcc -arch ppc -arch i386 -isysroot /Developer/SDKs/ MacOSX10.4u.sdk -fno-strict-aliasing -Wno-long-double -no-cpp-precomp -mno-fused-madd -fno-common -dynamic -DNDEBUG -g -O3 -Iagg23/include - Isrc -Iswig -I/Library/Frameworks/Python.framework/Versions/2.5/ include/python2.5 -c src/agg.cxx -o build/temp.macosx-10.3-fat-2.5/ src/agg.o" failed with exit status 1 ---- Rob Hetland, Assistant Professor Dept. of Oceanography, Texas A&M University http://pong.tamue.edu/~rob phone: 979-458-0096, fax: 979-845-6331 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/pythonmac-sig/attachments/20060727/3b2689c6/attachment.html From bob at redivi.com Thu Jul 27 19:45:48 2006 From: bob at redivi.com (Bob Ippolito) Date: Thu, 27 Jul 2006 10:45:48 -0700 Subject: [Pythonmac-SIG] Error compiling agg.cxx on Mac OS X, python 2.5b2 In-Reply-To: References: Message-ID: On Jul 27, 2006, at 10:20 AM, Rob Hetland wrote: > I'm trying out the brand new python2.5b2. One of the reasons I am > excited to upgrade is that ctypes are included in the new python, > and this is pretty hard to get going by hand on the intel Macs > because of an absent libffi. Also, it's not "hard to get going". The 0.9.9.9 release [1] should work fine, and I know from experience that the SVN trunk [2] also works fine. Hard to find perhaps, because the ctypes site hasn't been updated... but the sourceforge link on the ctypes homepage does lead you to the most recent release. FYI, I think that all current versions of ctypes still have stack alignment bugs on Mac OS X i386 that will cause unexpected crashes. Ronald fixed these bugs in the PyObjC libffi, but I don't believe that those fixes have migrated to ctypes yet. [1] http://sourceforge.net/project/showfiles.php?group_id=71702 [2] http://svn.python.org/view/ctypes/trunk/ctypes/ -bob From ronaldoussoren at mac.com Thu Jul 27 19:50:01 2006 From: ronaldoussoren at mac.com (Ronald Oussoren) Date: Thu, 27 Jul 2006 19:50:01 +0200 Subject: [Pythonmac-SIG] Error compiling agg.cxx on Mac OS X, python 2.5b2 In-Reply-To: References: Message-ID: <373715EC-919B-4C55-B33C-EAEB5AA853B5@mac.com> On Jul 27, 2006, at 7:45 PM, Bob Ippolito wrote: > > On Jul 27, 2006, at 10:20 AM, Rob Hetland wrote: > >> I'm trying out the brand new python2.5b2. One of the reasons I am >> excited to upgrade is that ctypes are included in the new python, >> and this is pretty hard to get going by hand on the intel Macs >> because of an absent libffi. > > Also, it's not "hard to get going". The 0.9.9.9 release [1] should > work fine, and I know from experience that the SVN trunk [2] also > works fine. Hard to find perhaps, because the ctypes site hasn't been > updated... but the sourceforge link on the ctypes homepage does lead > you to the most recent release. > > FYI, I think that all current versions of ctypes still have stack > alignment bugs on Mac OS X i386 that will cause unexpected crashes. > Ronald fixed these bugs in the PyObjC libffi, but I don't believe > that those fixes have migrated to ctypes yet. libffi for ctypes and PyObjC are the same, at least in the python repository. I don't know if Thomas has ported those changes back to the ctypes repository or has made a release that includes those changes. Ronald From mfrank at ebi.ac.uk Wed Jul 26 19:00:44 2006 From: mfrank at ebi.ac.uk (Martin Frank) Date: Wed, 26 Jul 2006 18:00:44 +0100 Subject: [Pythonmac-SIG] libpython2.4.a missing in binary distribution Message-ID: Hi, I downloaded the binary distribution for Mac OS X 10.4 from http://www.python.org/download/mac/ but I am missing the libpython2.4.a file in /Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/config How can I get or create it in a simple way? Thanks, Martin From c.dickinson40 at ntlworld.com Fri Jul 28 09:50:15 2006 From: c.dickinson40 at ntlworld.com (chris dickinson) Date: Fri, 28 Jul 2006 08:50:15 +0100 Subject: [Pythonmac-SIG] loading 221 in OSX Message-ID: <22d990a7e57ff1a45eeae9b4a96b1b48@ntlworld.com> George, I'm trying to load Python 2.2.1 in OSX, for use in Fontlab 4.5 and came across your message at http://mail.python.org/pipermail/pythonmac-sig/2003-August/008470.html I'm experiencing the same problem, and wondered if you found a solution. Regards. c. _______________________________________________________ Chris Dickinson 2 Alwyn Gardens Moreton, Wirral CH46 9QH UK. From bob at redivi.com Fri Jul 28 23:51:42 2006 From: bob at redivi.com (Bob Ippolito) Date: Fri, 28 Jul 2006 14:51:42 -0700 Subject: [Pythonmac-SIG] libpython2.4.a missing in binary distribution In-Reply-To: References: Message-ID: On Jul 26, 2006, at 10:00 AM, Martin Frank wrote: > I downloaded the binary distribution for Mac OS X 10.4 from > > http://www.python.org/download/mac/ > > but I am missing the libpython2.4.a file in > > > /Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/config > > > How can I get or create it in a simple way? No, and it's not supposed to be there. A framework build of Python must be dynamically linked. A better question is why do you want a static library? -bob From michael at possibleworlds.com Sat Jul 29 00:21:53 2006 From: michael at possibleworlds.com (michael ferraro) Date: Fri, 28 Jul 2006 18:21:53 -0400 Subject: [Pythonmac-SIG] py2app-0.3.2 problem: typeAlias is not defined In-Reply-To: <88940D4C-036F-480D-9D13-10691481BF72@mac.com> References: <166b1c630607241314w18f5aa1ft8290807a9eeb5766@mail.gmail.com> <44C5588A.50901@noaa.gov> <41875E38-4C3F-4378-BE89-874F49438DE4@mpiwg-berlin.mpg.de> <88940D4C-036F-480D-9D13-10691481BF72@mac.com> Message-ID: It seems that there is an import missing from bootstrap/argv_emulation.py. typeAlias used in __openfiles() is not listed on from Carbon.AppleEvents import kCoreEventClass, kAEOpenApplication, \ kAEOpenDocuments, keyDirectObject, typeAEList and generates error argvemulator.py warning: can't unpack an open document event Traceback (most recent call last): File "/Users/mef/Development/-Applications-/Teatro/dist/Teatro.app/ Contents/Resources/__boot__.py", line 101, in __openfiles aliasdesc = listdesc.AEGetNthDesc(i+1, typeAlias)[1] NameError: global name 'typeAlias' is not defined I added typeAlias to the import and reinstalled py2app and that seemed to fix the problem M On Jul 26, 2006, at 10:58 AM, Daniel Lord wrote: > I just tried the PIL build with the 2.5b version and it fails but > the 2.4.3 version works fine...see below. > My hunch is Ronald might have disabled some paths in order to keep > the beta from interfering with the standard 2.4 install. Or not ;-) > Ronald what say you? > > [daniello at mercury.local]$ python2.5 > Python 2.5b1 (r25b1:47038M, Jun 20 2006, 16:17:55) > [GCC 4.0.1 (Apple Computer, Inc. build 5341)] on darwin > Type "help", "copyright", "credits" or "license" for more information. > >>> import Image > Traceback (most recent call last): > File "", line 1, in > ImportError: No module named Image > >>> > > > Python 2.4.3 (#1, Apr 7 2006, 10:54:33) > [GCC 4.0.1 (Apple Computer, Inc. build 5250)] on darwin > Type "help", "copyright", "credits" or "license" for more information. > >>> import Image > >>> > > On Jul 26, 2006, at 4:08, J?rg Kantel wrote: > >> Hi, >> >> today I tried to install the Python Image Library from this site >> and after the >> installer runs succesfully (it says) I got the following message >> >> import Image >> ImportError: No module named Image >> >> It happens when I'm running python from /usr/local/bin/ as well as >> from /usr/bin/ >> >> Any suggestions? >> >> Thanks in advance (and excuse my bad (d)english) >> >> J"org >> >> -- >> J"org Kantel >> Max-Planck-Institute for the History of Science >> Computer Department >> Boltzmannstr. 22 D-14195 Berlin >> fon: +4930-22667-220 fax: +4930-22667-299 >> >> >> _______________________________________________ >> Pythonmac-SIG maillist - Pythonmac-SIG at python.org >> http://mail.python.org/mailman/listinfo/pythonmac-sig > > "I have never won a debate with an ignorant person." > -Ali ibn Abi Talib > > > > _______________________________________________ > Pythonmac-SIG maillist - Pythonmac-SIG at python.org > http://mail.python.org/mailman/listinfo/pythonmac-sig -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/pythonmac-sig/attachments/20060728/9bd60e27/attachment.htm From ronaldoussoren at mac.com Sat Jul 29 08:43:07 2006 From: ronaldoussoren at mac.com (Ronald Oussoren) Date: Sat, 29 Jul 2006 08:43:07 +0200 Subject: [Pythonmac-SIG] libpython2.4.a missing in binary distribution In-Reply-To: References: Message-ID: On Jul 28, 2006, at 11:51 PM, Bob Ippolito wrote: > > On Jul 26, 2006, at 10:00 AM, Martin Frank wrote: > >> I downloaded the binary distribution for Mac OS X 10.4 from >> >> http://www.python.org/download/mac/ >> >> but I am missing the libpython2.4.a file in >> >> >> /Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/ >> config >> >> >> How can I get or create it in a simple way? > > No, and it's not supposed to be there. A framework build of Python > must be dynamically linked. The linker doesn't actually care if libpython.a is a static library. $ cd /Library/ ... /config $ ln -s ../../../Python libpython.a > A better question is why do you want a > static library? I want to know this to. I know of one piece of software that requires this: mod_python 1.x. Because of this and because config-python (new in 2.5) also assumes that a libython.{a,dylib} is present the 2.5 installer will create the above mentioned link for you. This is lame, but I don't have time to fix the world, let alone try to get the patches in. Ronald From norman at khine.net Mon Jul 31 17:59:17 2006 From: norman at khine.net (Norman Khine) Date: Mon, 31 Jul 2006 17:59:17 +0200 Subject: [Pythonmac-SIG] poll() on OSX 10.3.9 with python2.5b2 Message-ID: <44CE28D5.50403@khine.net> Hello, I need to use the 'select' module in python, but get an error on the: Python 2.5b2 (r25b2:50512, Jul 31 2006, 15:01:51) [GCC 3.3 20030304 (Apple Computer, Inc. build 1640)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> >>> import select >>> >>> dir(select) >>> ['__doc__', '__file__', '__name__', 'error', 'select'] >>> >>> >>> this works fine on BSD4 Python 2.5b2 (r25b2:50512, Jul 31 2006, 12:43:17) [GCC 2.95.4 20020320 [FreeBSD]] on freebsd4 Type "help", "copyright", "credits" or "license" for more information. >>> >>> import itools >>> >>> from select import POLLIN >>> >>> import select >>> >>> dir(select) >>> ['POLLERR', 'POLLHUP', 'POLLIN', 'POLLNVAL', 'POLLOUT', 'POLLPRI', 'POLLRDBAND', 'POLLRDNORM', 'POLLWRBAND', 'POLLWRNORM', '__doc__', '__file__', '__name__', 'error', 'poll', 'select'] is there anything specific to do to the python installation before compiling. i am using the itools library from http://www.ikaaro.org/itools which uses this python module thanks -- Norman Khine From bob at redivi.com Mon Jul 31 18:42:33 2006 From: bob at redivi.com (Bob Ippolito) Date: Mon, 31 Jul 2006 09:42:33 -0700 Subject: [Pythonmac-SIG] poll() on OSX 10.3.9 with python2.5b2 In-Reply-To: <44CE28D5.50403@khine.net> References: <44CE28D5.50403@khine.net> Message-ID: <1AFC2E82-2844-46EC-B0FF-504A6507945A@redivi.com> On Jul 31, 2006, at 8:59 AM, Norman Khine wrote: > Hello, > I need to use the 'select' module in python, but get an error on the: > > Python 2.5b2 (r25b2:50512, Jul 31 2006, 15:01:51) > [GCC 3.3 20030304 (Apple Computer, Inc. build 1640)] on darwin > Type "help", "copyright", "credits" or "license" for more information. > >>>>>>> import select >>>>>>> dir(select) >>>> > ['__doc__', '__file__', '__name__', 'error', 'select'] > poll() is broken on some versions of Mac OS X, so it's hidden from the select module. You need to upgrade to Mac OS X 10.4. If this is Mac OS X 10.4, then this is a bug that you should report. -bob From delza at livingcode.org Mon Jul 31 19:18:26 2006 From: delza at livingcode.org (Dethe Elza) Date: Mon, 31 Jul 2006 10:18:26 -0700 Subject: [Pythonmac-SIG] poll() on OSX 10.3.9 with python2.5b2 In-Reply-To: <44CE28D5.50403@khine.net> References: <44CE28D5.50403@khine.net> Message-ID: <44CE3B62.9070205@livingcode.org> Norman Khine wrote: > Hello, > I need to use the 'select' module in python, but get an error on the: > > Python 2.5b2 (r25b2:50512, Jul 31 2006, 15:01:51) > [GCC 3.3 20030304 (Apple Computer, Inc. build 1640)] on darwin > Type "help", "copyright", "credits" or "license" for more information. > >>>>>>> import select >>>>>>> dir(select) >>>> > ['__doc__', '__file__', '__name__', 'error', 'select'] > Hi Norman, Did you build your own python or use a pre-built one? It works for me on both 2.4.3 and 2.5b2, unless I'm missing something in what you're asking: Python 2.4.3 Universal on Intel: $ python -c "import select;print dir(select)" ['POLLERR', 'POLLHUP', 'POLLIN', 'POLLNVAL', 'POLLOUT', 'POLLPRI', 'POLLRDBAND', 'POLLRDNORM', 'POLLWRBAND', 'POLLWRNORM', '__doc__', '__file__', '__name__', 'error', 'poll', 'select'] Python 2.5b2 Universal on Intel: $ python -c "import select; print dir(select)" ['POLLERR', 'POLLHUP', 'POLLIN', 'POLLNVAL', 'POLLOUT', 'POLLPRI', 'POLLRDBAND', 'POLLRDNORM', 'POLLWRBAND', 'POLLWRNORM', '__doc__', '__file__', '__name__', 'error', 'poll', 'select'] --Dethe From bob at redivi.com Mon Jul 31 19:50:51 2006 From: bob at redivi.com (Bob Ippolito) Date: Mon, 31 Jul 2006 10:50:51 -0700 Subject: [Pythonmac-SIG] poll() on OSX 10.3.9 with python2.5b2 In-Reply-To: <44CE3B62.9070205@livingcode.org> References: <44CE28D5.50403@khine.net> <44CE3B62.9070205@livingcode.org> Message-ID: <33C80BA2-3B43-4FC6-8A91-2A62FFC1422D@redivi.com> On Jul 31, 2006, at 10:18 AM, Dethe Elza wrote: > Norman Khine wrote: >> Hello, >> I need to use the 'select' module in python, but get an error on the: >> >> Python 2.5b2 (r25b2:50512, Jul 31 2006, 15:01:51) >> [GCC 3.3 20030304 (Apple Computer, Inc. build 1640)] on darwin >> Type "help", "copyright", "credits" or "license" for more >> information. >> >>>>>>>> import select >>>>>>>> dir(select) >>>>> >> ['__doc__', '__file__', '__name__', 'error', 'select'] >> > > Hi Norman, > > Did you build your own python or use a pre-built one? > > It works for me on both 2.4.3 and 2.5b2, unless I'm missing > something in > what you're asking: > > Python 2.4.3 Universal on Intel: > $ python -c "import select;print dir(select)" > ['POLLERR', 'POLLHUP', 'POLLIN', 'POLLNVAL', 'POLLOUT', 'POLLPRI', > 'POLLRDBAND', 'POLLRDNORM', 'POLLWRBAND', 'POLLWRNORM', '__doc__', > '__file__', '__name__', 'error', 'poll', 'select'] > > Python 2.5b2 Universal on Intel: > $ python -c "import select; print dir(select)" > ['POLLERR', 'POLLHUP', 'POLLIN', 'POLLNVAL', 'POLLOUT', 'POLLPRI', > 'POLLRDBAND', 'POLLRDNORM', 'POLLWRBAND', 'POLLWRNORM', '__doc__', > '__file__', '__name__', 'error', 'poll', 'select'] Python pre-2.5 detects for the correctness of poll() at configure time. Python 2.5+ detects for the correctness of poll() at import time. It doesn't matter if you built it yourself or not, all that matters is that your poll() syscall works correctly. This should be the case on 10.4. -bob