From ssquery at gmail.com Fri Jan 1 15:01:47 2010 From: ssquery at gmail.com (sudhakar s) Date: Fri, 1 Jan 2010 19:31:47 +0530 Subject: [Pythonmac-SIG] upload Message-ID: <1528d2591001010601w44a8139eg6d4bda1bed0716e3@mail.gmail.com> Hi friends... Happy New Year.... How to upload a photo from python into MySQL r any database... please suggest me.. -- -- With Regards, S Sudhakar. -------------- next part -------------- An HTML attachment was scrubbed... URL: From amorris at mistermorris.com Sat Jan 2 05:17:30 2010 From: amorris at mistermorris.com (Adam Morris) Date: Sat, 2 Jan 2010 11:17:30 +0700 Subject: [Pythonmac-SIG] Python 3 with Cocoa Message-ID: <9b202abc1001012017k5ff8ed28o4b71d8d359b5c6ae@mail.gmail.com> Dear all, I wrote to you the other week about the selection()() issue and got a really great reply. I never realized that the applescript munging going on would affect the way appscript works. Thanks for all the help, I've since got my classes working the way I want them to. I've recently tried installing appscript to my python3 installation from MacPorts and I wasn't able to get it working. I'm interested in python3 for its seamless unicode handling most of all ? I do mostly text processing as I'm developing a program to be used for (human) language educators. Next step after that is to get Python 3 going for Cocoa! Think I'll have to wait on that until PyObj is ported though! -------------- next part -------------- An HTML attachment was scrubbed... URL: From hengist.podd at virgin.net Sat Jan 2 12:11:43 2010 From: hengist.podd at virgin.net (has) Date: Sat, 2 Jan 2010 11:11:43 +0000 Subject: [Pythonmac-SIG] Python 3 with Cocoa In-Reply-To: References: Message-ID: <843DB1A1-7C67-44EF-BB5D-BFB40FD0F2D3@virgin.net> Adam Morris wrote: > I've recently tried installing appscript to my python3 installation from MacPorts and I wasn't able to get it working. I'm interested in python3 for its seamless unicode handling most of all ? I do mostly text processing as I'm developing a program to be used for (human) language educators. Appscript on Python3 works fine here. Try installing the latest PyPI appscript release using Distutils rather than the MacPorts appscript. HTH has -- Control AppleScriptable applications from Python, Ruby and ObjC: http://appscript.sourceforge.net From ronaldoussoren at mac.com Sat Jan 2 15:01:05 2010 From: ronaldoussoren at mac.com (Ronald Oussoren) Date: Sat, 02 Jan 2010 15:01:05 +0100 Subject: [Pythonmac-SIG] Python 3 with Cocoa In-Reply-To: <9b202abc1001012017k5ff8ed28o4b71d8d359b5c6ae@mail.gmail.com> References: <9b202abc1001012017k5ff8ed28o4b71d8d359b5c6ae@mail.gmail.com> Message-ID: <3479CD00-D49A-4A39-AF3A-CB49AFF9EF0B@mac.com> On 2 Jan, 2010, at 5:17, Adam Morris wrote: > > Next step after that is to get Python 3 going for Cocoa! Think I'll have to wait on that until PyObj is ported though! I'm working on that... Ronald > _______________________________________________ > Pythonmac-SIG maillist - Pythonmac-SIG at python.org > http://mail.python.org/mailman/listinfo/pythonmac-sig -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 3567 bytes Desc: not available URL: From noroxine at gmail.com Sat Jan 2 15:05:37 2010 From: noroxine at gmail.com (mindobjects) Date: Sat, 2 Jan 2010 06:05:37 -0800 (PST) Subject: [Pythonmac-SIG] Can't used py2app under snow leopard Message-ID: <26992630.post@talk.nabble.com> Hi, I have install py2app on snow leopard (Python 2.6.1), when I try to generate app for the "simple" sample, I get following error : sh-3.2# python setup.py py2app running py2app *** filtering dependencies *** 242 total 238 filtered 0 orphaned 4 remaining *** create binaries *** *** byte compile python files *** skipping byte-compilation of /Library/Python/2.6/site-packages/py2app-0.4.3-py2.6.egg/py2app/bootstrap/boot_app.py to boot_app.pyc skipping byte-compilation of /Library/Python/2.6/site-packages/py2app-0.4.3-py2.6.egg/py2app/bootstrap/chdir_resource.py to chdir_resource.pyc skipping byte-compilation of /Library/Python/2.6/site-packages/py2app-0.4.3-py2.6.egg/py2app/bootstrap/disable_linecache.py to disable_linecache.pyc skipping byte-compilation of /Users/administrateur/Documents/Alain/D?veloppement/Python/Composants/py2app-0.4.3/examples/simple/hello.py to hello.pyc *** creating application bundle: hello *** Traceback (most recent call last): File "/Library/Python/2.6/site-packages/py2app-0.4.3-py2.6.egg/py2app/build_app.py", line 589, in _run self.run_normal() File "/Library/Python/2.6/site-packages/py2app-0.4.3-py2.6.egg/py2app/build_app.py", line 660, in run_normal self.create_binaries(py_files, pkgdirs, extensions, loader_files) File "/Library/Python/2.6/site-packages/py2app-0.4.3-py2.6.egg/py2app/build_app.py", line 755, in create_binaries target, arcname, pkgexts, copyexts, target.script) File "/Library/Python/2.6/site-packages/py2app-0.4.3-py2.6.egg/py2app/build_app.py", line 1172, in build_executable appdir, resdir, plist = self.create_bundle(target, script) File "/Library/Python/2.6/site-packages/py2app-0.4.3-py2.6.egg/py2app/build_app.py", line 1100, in create_bundle use_runtime_preference=use_runtime_preference File "/Library/Python/2.6/site-packages/py2app-0.4.3-py2.6.egg/py2app/build_app.py", line 1089, in create_appbundle extension=self.extension, File "/Library/Python/2.6/site-packages/py2app-0.4.3-py2.6.egg/py2app/create_appbundle.py", line 30, in create_appbundle destmain = os.path.join(platdir, kw['CFBundleExecutable']) File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/posixpath.py", line 70, in join path += '/' + b UnicodeDecodeError: 'ascii' codec can't decode byte 0xcc in position 40: ordinal not in range(128) > /System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/posixpath.py(70)join() -> path += '/' + b (Pdb) Does anyone have idea ? Thanks for your reply. A. -- View this message in context: http://old.nabble.com/Can%27t-used-py2app-under-snow-leopard-tp26992630p26992630.html Sent from the Python - pythonmac-sig mailing list archive at Nabble.com. From p.oberndoerfer at urheberrecht.org Sun Jan 3 19:05:04 2010 From: p.oberndoerfer at urheberrecht.org (Pascal =?iso-8859-1?Q?Obernd=F6rfer?=) Date: Sun, 3 Jan 2010 19:05:04 +0100 (CET) Subject: [Pythonmac-SIG] Can't used py2app under snow leopard In-Reply-To: <26992630.post@talk.nabble.com> References: <26992630.post@talk.nabble.com> Message-ID: <2d5458a48ed7197d9899f8de0b982dba.squirrel@mail.urheberrecht.org> > Hi, > > I have install py2app on snow leopard (Python 2.6.1), when I try to > generate > app for the "simple" sample, I get following error : > [...] > /Users/administrateur/Documents/Alain/D??veloppement/Python/Composants/py2app-0.4.3/examples/simple/hello.py [...] > UnicodeDecodeError: 'ascii' codec can't decode byte 0xcc in position 40: > ordinal not in range(128) Did you try replacing "?" in "D?veloppement" with an ascii-character? Pascal From noroxine at gmail.com Sun Jan 3 19:40:54 2010 From: noroxine at gmail.com (mindobjects) Date: Sun, 3 Jan 2010 10:40:54 -0800 (PST) Subject: [Pythonmac-SIG] Can't used py2app under snow leopard In-Reply-To: <2d5458a48ed7197d9899f8de0b982dba.squirrel@mail.urheberrecht.org> References: <26992630.post@talk.nabble.com> <2d5458a48ed7197d9899f8de0b982dba.squirrel@mail.urheberrecht.org> Message-ID: <27004078.post@talk.nabble.com> Hi Pascal, You find it ! That so simple, in this time where we always talk about "unicode" this things remember me time when file and directory are limited to 8.3 characters. Thank you very much. Best, A. Pascal Oberndoerfer wrote: > >> Hi, >> >> I have install py2app on snow leopard (Python 2.6.1), when I try to >> generate >> app for the "simple" sample, I get following error : >> > [...] >> /Users/administrateur/Documents/Alain/D??veloppement/Python/Composants/py2app-0.4.3/examples/simple/hello.py > [...] >> UnicodeDecodeError: 'ascii' codec can't decode byte 0xcc in position 40: >> ordinal not in range(128) > > Did you try replacing "?" in "D?veloppement" with an ascii-character? > > Pascal > > _______________________________________________ > Pythonmac-SIG maillist - Pythonmac-SIG at python.org > http://mail.python.org/mailman/listinfo/pythonmac-sig > > -- View this message in context: http://old.nabble.com/Can%27t-used-py2app-under-snow-leopard-tp26992630p27004078.html Sent from the Python - pythonmac-sig mailing list archive at Nabble.com. From Mike.Lawrence at dal.ca Mon Jan 4 00:10:34 2010 From: Mike.Lawrence at dal.ca (Mike Lawrence) Date: Sun, 3 Jan 2010 19:10:34 -0400 Subject: [Pythonmac-SIG] py2app + pygame: how to exclude pygame icon? Message-ID: <37fda5351001031510l3635632apb112d90e808c0b9f@mail.gmail.com> This seemed to work for me: You need two files, a bitmap of the icon, here dubbed "AppIcon.png", and an icns file created in Icon Composer, here dubbed "AppIcon.icns". Place both folder where your main python script is located then, in the main python script, append the following just after pygame.init(), *before* pygame.display.set_mode(). pygame.display.set_icon(pygame.image.load('AppIcon.png')) Next, when you build using py2app, build as follows: python setup.py py2app --iconfile AppIcon.icns --resources AppIcon.png -- Mike Lawrence Graduate Student Department of Psychology Dalhousie University Looking to arrange a meeting? Check my public calendar: http://tr.im/mikes_public_calendar ~ Certainty is folly... I think. ~ From noroxine at gmail.com Sat Jan 2 13:28:04 2010 From: noroxine at gmail.com (mindobjects) Date: Sat, 2 Jan 2010 04:28:04 -0800 (PST) Subject: [Pythonmac-SIG] Can't used py2app under snow leopard Message-ID: <26992630.post@talk.nabble.com> Hi, I have install py2app on snow leopard (Python 2.6.1), when I try to generate app for the "simple" sample, I get following error : sh-3.2# python setup.py py2app running py2app *** filtering dependencies *** 242 total 238 filtered 0 orphaned 4 remaining *** create binaries *** *** byte compile python files *** skipping byte-compilation of /Library/Python/2.6/site-packages/py2app-0.4.3-py2.6.egg/py2app/bootstrap/boot_app.py to boot_app.pyc skipping byte-compilation of /Library/Python/2.6/site-packages/py2app-0.4.3-py2.6.egg/py2app/bootstrap/chdir_resource.py to chdir_resource.pyc skipping byte-compilation of /Library/Python/2.6/site-packages/py2app-0.4.3-py2.6.egg/py2app/bootstrap/disable_linecache.py to disable_linecache.pyc skipping byte-compilation of /Users/administrateur/Documents/Alain/D?veloppement/Python/Composants/py2app-0.4.3/examples/simple/hello.py to hello.pyc *** creating application bundle: hello *** Traceback (most recent call last): File "/Library/Python/2.6/site-packages/py2app-0.4.3-py2.6.egg/py2app/build_app.py", line 589, in _run self.run_normal() File "/Library/Python/2.6/site-packages/py2app-0.4.3-py2.6.egg/py2app/build_app.py", line 660, in run_normal self.create_binaries(py_files, pkgdirs, extensions, loader_files) File "/Library/Python/2.6/site-packages/py2app-0.4.3-py2.6.egg/py2app/build_app.py", line 755, in create_binaries target, arcname, pkgexts, copyexts, target.script) File "/Library/Python/2.6/site-packages/py2app-0.4.3-py2.6.egg/py2app/build_app.py", line 1172, in build_executable appdir, resdir, plist = self.create_bundle(target, script) File "/Library/Python/2.6/site-packages/py2app-0.4.3-py2.6.egg/py2app/build_app.py", line 1100, in create_bundle use_runtime_preference=use_runtime_preference File "/Library/Python/2.6/site-packages/py2app-0.4.3-py2.6.egg/py2app/build_app.py", line 1089, in create_appbundle extension=self.extension, File "/Library/Python/2.6/site-packages/py2app-0.4.3-py2.6.egg/py2app/create_appbundle.py", line 30, in create_appbundle destmain = os.path.join(platdir, kw['CFBundleExecutable']) File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/posixpath.py", line 70, in join path += '/' + b UnicodeDecodeError: 'ascii' codec can't decode byte 0xcc in position 40: ordinal not in range(128) > /System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/posixpath.py(70)join() -> path += '/' + b (Pdb) Does anyone have idea ? Thanks for your reply. A. -- View this message in context: http://old.nabble.com/Can%27t-used-py2app-under-snow-leopard-tp26992630p26992630.html Sent from the Python - pythonmac-sig mailing list archive at Nabble.com. From kw at codebykevin.com Mon Jan 4 04:42:46 2010 From: kw at codebykevin.com (Kevin Walzer) Date: Sun, 03 Jan 2010 22:42:46 -0500 Subject: [Pythonmac-SIG] Python app with aemreceive is not scriptable Message-ID: <4B4163B6.40707@codebykevin.com> Hi all: I'm trying to use aemreceive to allow one of my Python applications to receive simple Apple Events. Here's the relevant code that installs the event handler: from aemreceive import * def doScript(script): exec script installeventhandler( doScript, 'miscdosc', ('----', 'text', kae.typeUnicodeText) ) The idea here is to allow the application to execute Python code in response to an Apple Event. I have included a simple SDEF file in the app bundle that adds the appropriate command: And, finally, in the info.plist file, I mark the application as scriptable. However, when I try to open the application's AS dictionary in Script Editor, the application is grayed out, showing that it is not scriptable. Furthermore, when I run this script in Script Editor: tell app "MyApp" do script "print \"foo\"" end tell I get this error: "Expected end of line, etc. but found ?script?." Do I need to do anything else here, i.e. add anything else to info.plist? Or log out/log back into to re-register the application with the system? I'm using Python 2.6.2 and Tk 8.5 on Leopard, with four-way builds of both. The application is wrapped up with bundlebuilder because of my continuing difficulties with py2app. Any advice is appreciated... Thanks, Kevin -- Kevin Walzer Code by Kevin http://www.codebykevin.com From hengist.podd at virgin.net Mon Jan 4 12:37:37 2010 From: hengist.podd at virgin.net (has) Date: Mon, 4 Jan 2010 11:37:37 +0000 Subject: [Pythonmac-SIG] Python app with aemreceive is not scriptable In-Reply-To: References: Message-ID: Kevin Walzer wrote: > I'm trying to use aemreceive to allow one of my Python applications to receive simple Apple Events. > [...] > The idea here is to allow the application to execute Python code in response to an Apple Event. > > I have included a simple SDEF file in the app bundle that adds the appropriate command: > [...] > However, when I try to open the application's AS dictionary in Script Editor, the application is grayed out, showing that it is not scriptable. Furthermore, when I run this script in Script Editor: Sounds like you forgot to add an OSAScriptingDefinition entry containing the sdef's filename to your info.plist. Also, bear in mind that sdef-only apps won't work in 10.4 or earlier; if that's a concern then you'll need to provide an aete as well. HTH has -- Control AppleScriptable applications from Python, Ruby and ObjC: http://appscript.sourceforge.net From kw at codebykevin.com Mon Jan 4 14:18:15 2010 From: kw at codebykevin.com (Kevin Walzer) Date: Mon, 04 Jan 2010 08:18:15 -0500 Subject: [Pythonmac-SIG] Python app with aemreceive is not scriptable In-Reply-To: References: Message-ID: <4B41EA97.5060805@codebykevin.com> On 1/4/10 6:37 AM, has wrote: > > Sounds like you forgot to add an OSAScriptingDefinition entry containing the sdef's filename to your info.plist. > > Also, bear in mind that sdef-only apps won't work in 10.4 or earlier; if that's a concern then you'll need to provide an aete as well. > That worked, thanks. But now Script Editor complains about a "corrupted dictionary." Looks fine to me. Any ideas? -- Kevin Walzer Code by Kevin http://www.codebykevin.com From leo at finalresort.org Mon Jan 4 15:20:20 2010 From: leo at finalresort.org (Leo R. Lundgren) Date: Mon, 4 Jan 2010 15:20:20 +0100 Subject: [Pythonmac-SIG] Unresolved symbol _environ$non_lazy_ptr when linking libpython3.1.a compiled without framework Message-ID: <5CAFA779-A2BB-4B70-981F-A0BA3C62FE0C@finalresort.org> Hi, I have a C++ project in Xcode 3.1.2 on OS X 10.5.8, to which I am linking a static libpython3.1.a that I have compiled from the Python source. I have it all working now, but along the path I encountered an issue that I would like to ask about. At first I did the following: ./configure --enable-universalsdk make I then added the resulting libpython3.1.a to the project, and tried to build it. This resulted in the following error: Undefined symbols: "_environ", referenced from: _environ$non_lazy_ptr in libpython3.1.a(posixmodule.o) ld: symbol(s) not found Upon investigation it seems that there are some issues with the POSIX implementation in OS X regarding environ(7), and that a workaround is to use *_NSGetEnviron(). This is handled in Modules/posixmodule.c, but only when WITH_NEXT_FRAMEWORK is defined. However, it appears to me that WITH_NEXT_FRAMEWORK is only defined/set when one ./configure with --enable-framework. My question is; Shouldn't this workaround of using *_NSGetEnviron() also be used when building just the basic library without the framework, as well as when building with the framework? To my understanding, this is currently not possible, but should be. Please CC me directly, since I am not subscribed to this list. Thanks! Regards, Leo From Mike.Lawrence at dal.ca Tue Jan 5 04:38:09 2010 From: Mike.Lawrence at dal.ca (Mike Lawrence) Date: Mon, 4 Jan 2010 23:38:09 -0400 Subject: [Pythonmac-SIG] py2app + pygame: how to exclude pygame icon? In-Reply-To: <37fda5351001031510l3635632apb112d90e808c0b9f@mail.gmail.com> References: <37fda5351001031510l3635632apb112d90e808c0b9f@mail.gmail.com> Message-ID: <37fda5351001041938l256f351fj35e1023e5d4c213@mail.gmail.com> Oops. I was replying to this thread: http://mail.python.org/pipermail/pythonmac-sig/2009-January/020834.html which I thought only just began, but I now see it began a year ago. Still getting used to 2010 it seems! Mike On Sun, Jan 3, 2010 at 7:10 PM, Mike Lawrence wrote: > This seemed to work for me: > > You need two files, a bitmap of the icon, here dubbed "AppIcon.png", > and an icns file created in Icon Composer, here dubbed "AppIcon.icns". > Place both folder where your main python script is located then, in > the main python script, append the following just after pygame.init(), > *before* pygame.display.set_mode(). > > pygame.display.set_icon(pygame.image.load('AppIcon.png')) > > Next, when you build using py2app, build as follows: > > python setup.py py2app --iconfile AppIcon.icns --resources AppIcon.png > > -- > Mike Lawrence > Graduate Student > Department of Psychology > Dalhousie University > > Looking to arrange a meeting? Check my public calendar: > http://tr.im/mikes_public_calendar > > ~ Certainty is folly... I think. ~ > -- Mike Lawrence Graduate Student Department of Psychology Dalhousie University Looking to arrange a meeting? Check my public calendar: http://tr.im/mikes_public_calendar ~ Certainty is folly... I think. ~ From kw at codebykevin.com Tue Jan 5 05:24:29 2010 From: kw at codebykevin.com (Kevin Walzer) Date: Mon, 04 Jan 2010 23:24:29 -0500 Subject: [Pythonmac-SIG] Python app with aemreceive is not scriptable In-Reply-To: <4B41EA97.5060805@codebykevin.com> References: <4B41EA97.5060805@codebykevin.com> Message-ID: <4B42BEFD.9070104@codebykevin.com> On 1/4/10 8:18 AM, Kevin Walzer wrote: > On 1/4/10 6:37 AM, has wrote: >> >> Sounds like you forgot to add an OSAScriptingDefinition entry >> containing the sdef's filename to your info.plist. >> >> Also, bear in mind that sdef-only apps won't work in 10.4 or earlier; >> if that's a concern then you'll need to provide an aete as well. >> > > That worked, thanks. But now Script Editor complains about a "corrupted > dictionary." Looks fine to me. Any ideas? > Thanks to has for the off-list reply: I found a couple of errors in the sdef file. Now my app responds to Apple Events and doesn't complain about a corrupted dictionary. However, I'm having some additional difficulty. It appears that Apple Events are bypassing the bundled Python and are going straight to the Tk framework instead. Tk/Aqua has pretty good AppleScript support, and implements a "do script" command that will execute Tcl scripts. My application responds to this code: tell app MyApp do script "puts \"foo\"" end tell but returns an error message for tell app MyApp do script "print \"foo\"" end tell because it's expecting Tcl code. This is very weird, and I have no clue how to untangle it. My app won't respond to Apple Events at all without a valid sdef file in the bundle's Resources directory. However, if the sdef is present, the commands and Apple Events defined there are ignored and are instead handled by the Tcl/Tk interpreter and its sdef instead. To avoid this conflict, I've tried removing the Tk sdef file, and changing the Apple Event class/ID of my Python event to something else, but these have no effect. It's possible to wrap Tk calls in Python code via ('root', 'tk', 'call'), and it's also possible to force Python code to stand in as Tcl code via the "register" function, but I don't know if either of these would be applicable solutions in this instance; if the Apple Events are going directly to the Tcl interpreter embedded in the Tk framework, then it may not really be possible to send Apple Events to a bundled Python application using Tkinter. Has anyone else encountered anything like this, with Tkinter or another toolkit? --Kevin -- Kevin Walzer Code by Kevin http://www.codebykevin.com From amorris at mistermorris.com Tue Jan 5 11:54:12 2010 From: amorris at mistermorris.com (Adam Morris) Date: Tue, 5 Jan 2010 17:54:12 +0700 Subject: [Pythonmac-SIG] path, xcode, and python Message-ID: <9b202abc1001050254x6d864ae9wb9c1b84d26b3af1b@mail.gmail.com> Hi all, Just trying to get my system set up for some coding ... decided to reinstall everything (Snow Leopard) from scratch. What a mistake that was. I updated to 10.6.2, installed Xcode and THEN installed python 2.6.4. I think that might have something to do with two problems I'm seeing. The major one is: import Foundation, Appkit doesn't work with import error (copy of path is is below) The other one -- I don't know if this is related -- but when I run in interactive mode I can import appscripts no problemo but when I run it from a script (with FastScripts) it gives me an import error. I've looked around the internet for some help, focusing on how path works (something I'm missing?) but I can't help but think it's because I should have installed XCode after doing the python upgrade. Also because I did exactly that previously. Any insight? -brainysmurf ['', '/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/setuptools-0.6c11-py2.6.egg', '/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/macosx_launch-0.0.0-py2.6-macosx-10.3-fat.egg', '/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/appscript-0.21.1-py2.6-macosx-10.3-fat.egg', '/Library/Frameworks/Python.framework/Versions/2.6/lib/python26.zip', '/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6', '/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/plat-darwin', '/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/plat-mac', '/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/plat-mac/lib-scriptpackages', '/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/lib-tk', '/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/lib-old', '/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/lib-dynload', '/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages'] -------------- next part -------------- An HTML attachment was scrubbed... URL: From ronaldoussoren at mac.com Tue Jan 5 13:46:04 2010 From: ronaldoussoren at mac.com (Ronald Oussoren) Date: Tue, 05 Jan 2010 13:46:04 +0100 Subject: [Pythonmac-SIG] path, xcode, and python In-Reply-To: <9b202abc1001050254x6d864ae9wb9c1b84d26b3af1b@mail.gmail.com> References: <9b202abc1001050254x6d864ae9wb9c1b84d26b3af1b@mail.gmail.com> Message-ID: <59B32E49-6895-43C6-8B7D-69882776F670@mac.com> On 5 Jan, 2010, at 11:54, Adam Morris wrote: > Hi all, > > Just trying to get my system set up for some coding ... decided to reinstall everything (Snow Leopard) from scratch. What a mistake that was. > > I updated to 10.6.2, installed Xcode and THEN installed python 2.6.4. I think that might have something to do with two problems I'm seeing. The major one is: > > import Foundation, Appkit doesn't work with import error (copy of path is is below) Have you installed setuptools and pyobjc for python 2.6.4? The system ships with pyobjc, but that's only for /usr/bin/python, not for the 2.6.4 you installed separately. > > The other one -- I don't know if this is related -- but when I run in interactive mode I can import appscripts no problemo but when I run it from a script (with FastScripts) it gives me an import error. That's probably because you use 2.6.4 when running interactively and the system python when using FastScripts. Ronald -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 3567 bytes Desc: not available URL: From amorris at mistermorris.com Tue Jan 5 14:02:19 2010 From: amorris at mistermorris.com (Adam Morris) Date: Tue, 5 Jan 2010 20:02:19 +0700 Subject: [Pythonmac-SIG] path, xcode, and python In-Reply-To: <59B32E49-6895-43C6-8B7D-69882776F670@mac.com> References: <9b202abc1001050254x6d864ae9wb9c1b84d26b3af1b@mail.gmail.com> <59B32E49-6895-43C6-8B7D-69882776F670@mac.com> Message-ID: <9b202abc1001050502q477338c8k9a49cbd7e5ab5c6f@mail.gmail.com> >That's probably because you use 2.6.4 when running interactively and the system python when using >FastScripts. You hit the nail on the head. Printing sys.version resulted in 2.6.1. Wasn't expecting that, because I had updated previously on my other system and everything seemed to "just work." >Have you installed setuptools and pyobjc for python 2.6.4? The system ships with pyobjc, but that's >only for /usr/bin/python, not for the 2.6.4 you installed separately. I'm clearly not understanding how two different pythons work on one system. When I type "python" it "upgraded" to 2.6.4 for me. Off I go... (Maybe I should have just remained at 2.6.1 ....) -brainysmurf On Tue, Jan 5, 2010 at 7:46 PM, Ronald Oussoren wrote: > > On 5 Jan, 2010, at 11:54, Adam Morris wrote: > > > Hi all, > > > > Just trying to get my system set up for some coding ... decided to > reinstall everything (Snow Leopard) from scratch. What a mistake that was. > > > > I updated to 10.6.2, installed Xcode and THEN installed python 2.6.4. I > think that might have something to do with two problems I'm seeing. The > major one is: > > > > import Foundation, Appkit doesn't work with import error (copy of path is > is below) > > Have you installed setuptools and pyobjc for python 2.6.4? The system > ships with pyobjc, but that's only for /usr/bin/python, not for the 2.6.4 > you installed separately. > > > > > The other one -- I don't know if this is related -- but when I run in > interactive mode I can import appscripts no problemo but when I run it from > a script (with FastScripts) it gives me an import error. > > That's probably because you use 2.6.4 when running interactively and the > system python when using FastScripts. > > Ronald -------------- next part -------------- An HTML attachment was scrubbed... URL: From ronaldoussoren at mac.com Tue Jan 5 14:07:47 2010 From: ronaldoussoren at mac.com (Ronald Oussoren) Date: Tue, 05 Jan 2010 14:07:47 +0100 Subject: [Pythonmac-SIG] path, xcode, and python In-Reply-To: <9b202abc1001050502q477338c8k9a49cbd7e5ab5c6f@mail.gmail.com> References: <9b202abc1001050254x6d864ae9wb9c1b84d26b3af1b@mail.gmail.com> <59B32E49-6895-43C6-8B7D-69882776F670@mac.com> <9b202abc1001050502q477338c8k9a49cbd7e5ab5c6f@mail.gmail.com> Message-ID: <47E2AEE5-DC80-4D81-974C-4B8527F514D8@mac.com> On 5 Jan, 2010, at 14:02, Adam Morris wrote: > >That's probably because you use 2.6.4 when running interactively and the system python when using > >FastScripts. > > You hit the nail on the head. Printing sys.version resulted in 2.6.1. Wasn't expecting that, because I had updated previously on my other system and everything seemed to "just work." Did you restart FastScripts after installing 2.6.4? I don't know FastScripts, but if it links to a python framework it won't see the new python version until you restart it. > > >Have you installed setuptools and pyobjc for python 2.6.4? The system ships with pyobjc, but that's > >only for /usr/bin/python, not for the 2.6.4 you installed separately. > > I'm clearly not understanding how two different pythons work on one system. When I type "python" it "upgraded" to 2.6.4 for me. Off I go... > > (Maybe I should have just remained at 2.6.1 ....) There is a system installation of Python in /System/Library/Frameworks, and you can add other Python installations yourself. The 2.6.4 installer at python.org installs 2.6.4 in /Library/Framework. These different installations are completely separate from each other and can contain different python packages, scripts. Software has to explicitly choose which python it wants to use. Ronald > > -brainysmurf > > On Tue, Jan 5, 2010 at 7:46 PM, Ronald Oussoren wrote: > > On 5 Jan, 2010, at 11:54, Adam Morris wrote: > > > Hi all, > > > > Just trying to get my system set up for some coding ... decided to reinstall everything (Snow Leopard) from scratch. What a mistake that was. > > > > I updated to 10.6.2, installed Xcode and THEN installed python 2.6.4. I think that might have something to do with two problems I'm seeing. The major one is: > > > > import Foundation, Appkit doesn't work with import error (copy of path is is below) > > Have you installed setuptools and pyobjc for python 2.6.4? The system ships with pyobjc, but that's only for /usr/bin/python, not for the 2.6.4 you installed separately. > > > > > The other one -- I don't know if this is related -- but when I run in interactive mode I can import appscripts no problemo but when I run it from a script (with FastScripts) it gives me an import error. > > That's probably because you use 2.6.4 when running interactively and the system python when using FastScripts. > > Ronald > -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 3567 bytes Desc: not available URL: From vze26m98 at optonline.net Tue Jan 5 14:56:44 2010 From: vze26m98 at optonline.net (Charles Turner) Date: Tue, 05 Jan 2010 08:56:44 -0500 Subject: [Pythonmac-SIG] path, xcode, and python In-Reply-To: <47E2AEE5-DC80-4D81-974C-4B8527F514D8@mac.com> References: <9b202abc1001050254x6d864ae9wb9c1b84d26b3af1b@mail.gmail.com> <59B32E49-6895-43C6-8B7D-69882776F670@mac.com> <9b202abc1001050502q477338c8k9a49cbd7e5ab5c6f@mail.gmail.com> <47E2AEE5-DC80-4D81-974C-4B8527F514D8@mac.com> Message-ID: <49841E6F-AA0E-4E7B-BB1A-16170308F4B5@optonline.net> On Jan 5, 2010, at 8:07 AM, Ronald Oussoren wrote: > There is a system installation of Python in /System/Library/ > Frameworks, and you can add other Python installations yourself. > The 2.6.4 installer at python.org installs 2.6.4 in /Library/ > Framework. These different installations are completely separate > from each other and can contain different python packages, scripts. > Software has to explicitly choose which python it wants to use. Also worth mentioning is that there are symlinks in /usr/local/bin for user-installed pythons that point to the /Library/Frameworks directory. (At least this is the case for my Python3 install) So the shell does one of two things, given the name "python" on the command line: most likely, it searches directories for "python" based on the sequence of paths in your Bash .profile PATHS statement, or it looks in local directories before system directories. (Perhaps someone else has definitive information on this, sorry!) So in the first case, if your /usr/local/bin precedes /usr/bin in your PATH statement, the OS will always find the user-installed python before the system installed python, effectively masking it. Also, given that both "pythons" in /usr/bin and /usr/local/bin are symlinks, you can rename these to suit your organizational requirements. HTH, Charles From kw at codebykevin.com Tue Jan 5 16:42:57 2010 From: kw at codebykevin.com (Kevin Walzer) Date: Tue, 05 Jan 2010 10:42:57 -0500 Subject: [Pythonmac-SIG] Python app with aemreceive is not scriptable In-Reply-To: <4B42BEFD.9070104@codebykevin.com> References: <4B41EA97.5060805@codebykevin.com> <4B42BEFD.9070104@codebykevin.com> Message-ID: <4B435E01.9060502@codebykevin.com> On 1/4/10 11:24 PM, Kevin Walzer wrote: > On 1/4/10 8:18 AM, Kevin Walzer wrote: >> On 1/4/10 6:37 AM, has wrote: > > This is very weird, and I have no clue how to untangle it. My app won't > respond to Apple Events at all without a valid sdef file in the bundle's > Resources directory. However, if the sdef is present, the commands and > Apple Events defined there are ignored and are instead handled by the > Tcl/Tk interpreter and its sdef instead. To avoid this conflict, I've > tried removing the Tk sdef file, and changing the Apple Event class/ID > of my Python event to something else, but these have no effect. I tried again with a different eight-letter constant for my Apple Event and now it's being fed to Python instead of Tk. I still have some work to do, but at least I'm not stuck at this point anymore... -- Kevin Walzer Code by Kevin http://www.codebykevin.com From hengist.podd at virgin.net Tue Jan 5 17:41:41 2010 From: hengist.podd at virgin.net (has) Date: Tue, 5 Jan 2010 16:41:41 +0000 Subject: [Pythonmac-SIG] Python app with aemreceive is not scriptable In-Reply-To: References: Message-ID: <5B0CE2A0-1F8A-4407-899D-50D8D1945DCC@virgin.net> Kevin Walzer wrote: > Now my app responds to Apple Events and doesn't complain about a corrupted dictionary. However, I'm having some additional difficulty. It appears that Apple Events are bypassing the bundled Python and are going straight to the Tk framework instead. Tk/Aqua has pretty good AppleScript support, and implements a "do script" command that will execute Tcl scripts. My application responds to this code: > [...] > This is very weird, and I have no clue how to untangle it. My app won't respond to Apple Events at all without a valid sdef file in the bundle's Resources directory. You only need to install event handlers for an application to respond to Apple events. The sdef is only there to provide human-readable terminology; not having one just means that users have to resort to raw chevron syntax (in AppleScript) or the aem API (in appscript) in order to communicate with it. (Cocoa Scripting-based apps do use the sdef for implementation purposes as well, but as your app doesn't use Cocoa Scripting to provide its Apple event interface it's a non-issue for you.) > However, if the sdef is present, the commands and Apple Events defined there are ignored and are instead handled by the Tcl/Tk interpreter and its sdef instead. To avoid this conflict, I've tried removing the Tk sdef file, and changing the Apple Event class/ID of my Python event to something else, but these have no effect. If I understand you, Tk implements a 'do script' handler that executes arbitrary Tcl scripts (right...no potential security issues there, then) and you are installing your own 'do script' handler as well. If that's the case, make sure your handler gets installed _after_ Tk has auto-installed its version, otherwise Tk will simply replace yours with its own. I'm not familiar with Tk though, so can't tell you at what point you need to do this. Alternatively, give your handler a different name and Apple event code so that it doesn't conflict with Tk's handler in the first place. HTH has -- Control AppleScriptable applications from Python, Ruby and ObjC: http://appscript.sourceforge.net From nad at acm.org Tue Jan 5 19:12:25 2010 From: nad at acm.org (Ned Deily) Date: Tue, 05 Jan 2010 10:12:25 -0800 Subject: [Pythonmac-SIG] path, xcode, and python References: <9b202abc1001050254x6d864ae9wb9c1b84d26b3af1b@mail.gmail.com> <59B32E49-6895-43C6-8B7D-69882776F670@mac.com> <9b202abc1001050502q477338c8k9a49cbd7e5ab5c6f@mail.gmail.com> <47E2AEE5-DC80-4D81-974C-4B8527F514D8@mac.com> <49841E6F-AA0E-4E7B-BB1A-16170308F4B5@optonline.net> Message-ID: In article <49841E6F-AA0E-4E7B-BB1A-16170308F4B5 at optonline.net>, Charles Turner wrote: > Also, given that both "pythons" in /usr/bin and /usr/local/bin are > symlinks, you can rename these to suit your organizational requirements. Don't change the /usr/bin/python symlink or any other existing file in /usr/bin! Anything there is part of OS X and managed by Apple. At worst, you can break things on your system that depend on the Apple-supplied Python and its packages. At best, your change will be reverted by some future OS X system update. -- Ned Deily, nad at acm.org From kw at codebykevin.com Wed Jan 6 00:07:35 2010 From: kw at codebykevin.com (Kevin Walzer) Date: Tue, 05 Jan 2010 18:07:35 -0500 Subject: [Pythonmac-SIG] Python app with aemreceive is not scriptable In-Reply-To: <5B0CE2A0-1F8A-4407-899D-50D8D1945DCC@virgin.net> References: <5B0CE2A0-1F8A-4407-899D-50D8D1945DCC@virgin.net> Message-ID: <4B43C637.3020900@codebykevin.com> On 1/5/10 11:41 AM, has wrote: > If I understand you, Tk implements a 'do script' handler that executes arbitrary Tcl scripts (right...no potential security issues there, then) and you are installing your own 'do script' handler as well. Yes, that's basically it. > > If that's the case, make sure your handler gets installed _after_ Tk has auto-installed its version, otherwise Tk will simply replace yours with its own. I'm not familiar with Tk though, so can't tell you at what point you need to do this. > > Alternatively, give your handler a different name and Apple event code so that it doesn't conflict with Tk's handler in the first place. This turned out to be the solution. However: It appears that Tcl and Python differ in some respects in code execution. Python doesn't appear to return a value from code that is passed to the "exec" statement. Here, first, is my aemreceive code: from aemreceive import * def doScript(script): exec script installeventhandler( doScript, 'CoKvscpt', ('----', 'script', kae.typeUnicodeText) ) And here is my sample AppleScript code: tell application "MyApp" run script "print \"foo\"" end tell The comparable Tcl code snippet, "puts \"foo\"", returns a value of "foo"--the string printed to standard output. I expect to see the same thing in Python. But the Python function above returns no output to AppleScript--the value of "foo" goes down a black hole. I don't see the output logged to Console, either. I didn't see this issue with the sample code that has includes with aemreceive, but that code explicitly returns values: def unicodeNumbers(text): return [ord(c) for c in text] So I'm trying to figure out how to capture the standard output of a Python code snippet that's been "exec'ed." More of a general Python question than a Mac question, granted, but the context wouldn't make much sense on comp.lang.python. As far as the security issues, I agree, that's a concern. My basic idea is to expose a selection of commands in my application, either wrapped in AppleScript commands or simply as Python commands accessed via the "run script" command. The goal *isn't* to encourage arbitrary Python snippets. Thanks, Kevin -- Kevin Walzer Code by Kevin http://www.codebykevin.com From Chris.Barker at noaa.gov Wed Jan 6 01:16:25 2010 From: Chris.Barker at noaa.gov (Christopher Barker) Date: Tue, 05 Jan 2010 16:16:25 -0800 Subject: [Pythonmac-SIG] What to build binaries for??? Message-ID: <4B43D659.4090709@noaa.gov> Hi folks, Another poster on the numpy list has been bitten by the "must have the system python" issue with the binary installer, meaning the python.org build. 1) I thought I provided a patch a good while ago to update that message -- did that get lost in the shuffle? 2) we're talking on that list about implementing what Robin Dunn has done for wxPython -- a single installer that puts numpy somewhere, then puts *.pth files in both the Apple and Python.org Pythons, so that a single installer will work with both. But now we have issues as to what to support: 32+64 bit, PPC + intel. wxPython is strictly 32 bit, so it's a bit easier. What is being delivered now? Is there a 64 bit build at Python.org? What has Apple delivered with 10.6 and 10.5? Are we going to need multiple installers, maybe 32 and 64 bit? This was messy enough a couple years ago! What do you folks suggest? -Chris -- Christopher Barker, Ph.D. Oceanographer Emergency Response Division NOAA/NOS/OR&R (206) 526-6959 voice 7600 Sand Point Way NE (206) 526-6329 fax Seattle, WA 98115 (206) 526-6317 main reception Chris.Barker at noaa.gov From nad at acm.org Wed Jan 6 02:40:23 2010 From: nad at acm.org (Ned Deily) Date: Tue, 05 Jan 2010 17:40:23 -0800 Subject: [Pythonmac-SIG] What to build binaries for??? References: <4B43D659.4090709@noaa.gov> Message-ID: In article <4B43D659.4090709 at noaa.gov>, Christopher Barker wrote: > Another poster on the numpy list has been bitten by the "must have the > system python" issue with the binary installer, meaning the python.org > build. > > 1) I thought I provided a patch a good while ago to update that message > -- did that get lost in the shuffle? Sorry, could you refresh my memory what that issue is? > 2) we're talking on that list about implementing what Robin Dunn has > done for wxPython -- a single installer that puts numpy somewhere, then > puts *.pth files in both the Apple and Python.org Pythons, so that a > single installer will work with both. Without knowing the details, that could be a dicey proposition if there are any C extensions involved. There is no guarantee that a single set of binaries would work on multiple instances of python, even the same source level, if the pythons themselves were not built with the same options and tool chains. At the moment, that certainly is not true for the Apple and the python.org pythons in any of 10.4, 10.5, and especially 10.6. > But now we have issues as to what to support: 32+64 bit, PPC + intel. > wxPython is strictly 32 bit, so it's a bit easier. > > What is being delivered now? Is there a 64 bit build at Python.org? What > has Apple delivered with 10.6 and 10.5? At the moment, python.org's most recent installers are for 2.6.4 and 3.1.1. Both are 32-bit-only i386/ppc and are built with GCC 4.0.1 and the 10.4u SDK using a deployment target of 10.3; they should work correctly on 10.4, 10.5, and 10.6. AFAIK, neither received any pre-release testing on 10.3.9 (the only version of 10.3 that could work), although there was a recent report here of a minor installation problem with 2.6.4 on 10.3.9 (http://bugs.python.org/issue7437). There are a couple of issues with building C extension modules on 10.6 that were fixed in 2.6.4 which was released after 10.6 but not in 3.1.1 which was before 10.6. The two major ones: you need to ensure that the 10.4u SDK is installed from the 10.6 Xcode mpkg (by default, it's not) and you need to tell Distutils to use gcc-4.0 instead of the 10.6 default gcc-4.2: $ export CC=/usr/bin/gcc-4.0 Again, these problems are fixed in 2.6.4. In 10.6, Apple supplies a Python 2.6.1 (3-way build with 64-bit Intel as default) and a Python 2.5.4 (2-way 32-bit only) both built with GCC 4.2.1. 2.6.1 has a deployment target of 10.6 while 2.5.4's is 10.5: $ cd /System/Library/Frameworks/Python.framework/Versions/2.6/bin $ file python2.6 python2.6: Mach-O universal binary with 3 architectures python2.6 (for architecture x86_64): Mach-O 64-bit executable x86_64 python2.6 (for architecture i386): Mach-O executable i386 python2.6 (for architecture ppc7400): Mach-O executable ppc $ cd ../2.5/bin $ file python2.5 python2.5: Mach-O universal binary with 2 architectures python2.5 (for architecture i386): Mach-O executable i386 python2.5 (for architecture ppc7400): Mach-O executable ppc In 10.5.8, the Apple-supplied Python is 2.5.1 (2-way 32-bit) built with GCC 4.0.1 and a 10.5 deployment target. > Are we going to need multiple installers, maybe 32 and 64 bit? Dunno. Again, as it stands at the moment, there are no python.org 64-bit installers although some work is in progress. Ronald has recently checked-in some feature code for 2.7 to make 64-bit/32-bit selection work on 10.6 (the 10.5 4-way build support doesn't work correctly on 10.6 and legacy ppc64 support is largely gone in 10.6 anyway). I'm hopeful we can get that all working and pushed back into future 2.6 and 3.1 maintenance releases, assuming the need for them arises. That will probably result in two separate installers for each python version: one 32-bit only built as in the past for 10.3.9+ and a new 2-way (Intel-only 32/64, 10.6 or higher) or 3-way (2-way plus ppc, 10.5 or higher). That's my (unofficial) impression of the State of the World. Perhaps Ronald has other suggestions/comments/ideas? -- Ned Deily, nad at acm.org From amorris at mistermorris.com Wed Jan 6 03:50:40 2010 From: amorris at mistermorris.com (Adam Morris) Date: Tue, 5 Jan 2010 21:50:40 -0500 Subject: [Pythonmac-SIG] path, xcode, and python In-Reply-To: References: <9b202abc1001050254x6d864ae9wb9c1b84d26b3af1b@mail.gmail.com> <59B32E49-6895-43C6-8B7D-69882776F670@mac.com> <9b202abc1001050502q477338c8k9a49cbd7e5ab5c6f@mail.gmail.com> <47E2AEE5-DC80-4D81-974C-4B8527F514D8@mac.com> <49841E6F-AA0E-4E7B-BB1A-16170308F4B5@optonline.net> Message-ID: <9b202abc1001051850o70d5262araf1e3fd84a168b93@mail.gmail.com> OK I've figured it out. After spending another morning doing a clean re-install (the do do do intro song is catchy the first time but lame after three... :) To get PyObjC working on Python 2.6.4: Install Python 2.6.4 Install setuptools for 2.6.4 Install PyObjC using setuptools This process was not at all clear to me (even though instructions exist on the net in various places) because I hadn't internalized the idea that there is a (untouchable) system python as well as the latest version (which is clearly the one I want). That's where I need to direct my installs to. As for the debate about binaries, it seems to me that if there was better explanation of how to use Python effectively on the various operating systems, it would help a lot. Basically, install 2.6.4 and be done with it. The reason I've chosen Python is because I need the Natural Language Processing Toolkit and wasn't quite ready for the waters that awaited me in getting set up to code! (Maybe I should just post this somewhere more central?) -brainysmurf On Tue, Jan 5, 2010 at 1:12 PM, Ned Deily wrote: > In article <49841E6F-AA0E-4E7B-BB1A-16170308F4B5 at optonline.net>, > Charles Turner wrote: > > Also, given that both "pythons" in /usr/bin and /usr/local/bin are > > symlinks, you can rename these to suit your organizational requirements. > > Don't change the /usr/bin/python symlink or any other existing file in > /usr/bin! Anything there is part of OS X and managed by Apple. At > worst, you can break things on your system that depend on the > Apple-supplied Python and its packages. At best, your change will be > reverted by some future OS X system update. > > -- > Ned Deily, > nad at acm.org > > _______________________________________________ > Pythonmac-SIG maillist - Pythonmac-SIG at python.org > http://mail.python.org/mailman/listinfo/pythonmac-sig > -------------- next part -------------- An HTML attachment was scrubbed... URL: From nad at acm.org Wed Jan 6 05:26:30 2010 From: nad at acm.org (Ned Deily) Date: Tue, 05 Jan 2010 20:26:30 -0800 Subject: [Pythonmac-SIG] path, xcode, and python References: <9b202abc1001050254x6d864ae9wb9c1b84d26b3af1b@mail.gmail.com> <59B32E49-6895-43C6-8B7D-69882776F670@mac.com> <9b202abc1001050502q477338c8k9a49cbd7e5ab5c6f@mail.gmail.com> <47E2AEE5-DC80-4D81-974C-4B8527F514D8@mac.com> <49841E6F-AA0E-4E7B-BB1A-16170308F4B5@optonline.net> <9b202abc1001051850o70d5262araf1e3fd84a168b93@mail.gmail.com> Message-ID: In article <9b202abc1001051850o70d5262araf1e3fd84a168b93 at mail.gmail.com>, Adam Morris wrote: > OK I've figured it out. After spending another morning doing a clean > re-install (the do do do intro song is catchy the first time but lame after > three... :) > > To get PyObjC working on Python 2.6.4: > > Install Python 2.6.4 > Install setuptools for 2.6.4 > Install PyObjC using setuptools > > This process was not at all clear to me (even though instructions exist on > the net in various places) because I hadn't internalized the idea that there > is a (untouchable) system python as well as the latest version (which is > clearly the one I want). That's where I need to direct my installs to. That's pretty much correct. However, Apple's Python isn't totally untouchable. It's fine to install additional packages to it; OS X thoughtfully comes installed with a setuptools easy_install in /usr/bin to make that easy. Additional site packages for it get installed into /Library/Python. What you shouldn't do is try to update the files in the python instance itself, which means anything in /System/Library/Frameworks/Python.frameworks or /usr/bin. And, as Ronald mentioned earlier, the Apple-supplied Python 2.6.1 on 10.6 comes with a version of PyObjC already installed. > As for the debate about binaries, it seems to me that if there was better > explanation of how to use Python effectively on the various operating > systems, it would help a lot. Basically, install 2.6.4 and be done with it. Unfortunately, it's not always that cut-and-dried. For instance, the current python.org installers are currently 32-bit only; the Apple-supplied Python 2.6 supports 64-bit as well. That's important for some users. -- Ned Deily, nad at acm.org From Chris.Barker at noaa.gov Wed Jan 6 07:10:14 2010 From: Chris.Barker at noaa.gov (Christopher Barker) Date: Tue, 05 Jan 2010 22:10:14 -0800 Subject: [Pythonmac-SIG] What to build binaries for??? In-Reply-To: References: <4B43D659.4090709@noaa.gov> Message-ID: <4B442946.4050500@noaa.gov> Ned Deily wrote: > In article <4B43D659.4090709 at noaa.gov>, > Christopher Barker wrote: >> Another poster on the numpy list has been bitten by the "must have the >> system python" issue with the binary installer, meaning the python.org >> build. >> >> 1) I thought I provided a patch a good while ago to update that message >> -- did that get lost in the shuffle? > > Sorry, could you refresh my memory what that issue is? The issue is the mpkgs (build with bdist_mpkg) designed for the python.org python give a coonfusing error message when you try to install them without that python present. It says somethign like: "This package requires the system python" Clearly, people usually think the "system" python is the one Apple provided, so confusion results. It should say something like: "this package requires the binary python version x.x from python.org" I'm pretty sure I worked out a patch for that a good while ago, but maybe not - I did look recently, and it's not as easy as you might think -- that message is somewhat auto-generated. -Chris -- Christopher Barker, Ph.D. Oceanographer Emergency Response Division NOAA/NOS/OR&R (206) 526-6959 voice 7600 Sand Point Way NE (206) 526-6329 fax Seattle, WA 98115 (206) 526-6317 main reception Chris.Barker at noaa.gov From Chris.Barker at noaa.gov Wed Jan 6 07:29:06 2010 From: Chris.Barker at noaa.gov (Christopher Barker) Date: Tue, 05 Jan 2010 22:29:06 -0800 Subject: [Pythonmac-SIG] What to build binaries for??? In-Reply-To: References: <4B43D659.4090709@noaa.gov> Message-ID: <4B442DB2.5060607@noaa.gov> Ned, Thanks for the detailed review -- what a mess! I've got a longer note about this at work -- apparently I failed to send it before catching the bus, but a few clarifications: >> 2) we're talking on that list about implementing what Robin Dunn has >> done for wxPython -- a single installer that puts numpy somewhere, then >> puts *.pth files in both the Apple and Python.org Pythons, so that a >> single installer will work with both. > > Without knowing the details, that could be a dicey proposition if there > are any C extensions involved. well, c extensions are the whole point -- this is all pretty trivial for pure-python. > There is no guarantee that a single set > of binaries would work on multiple instances of python, even the same > source level, if the pythons themselves were not built with the same > options and tool chains. At the moment, that certainly is not true for > the Apple and the python.org pythons in any of 10.4, 10.5, and > especially 10.6. odd -- it's been working for a while for wxPython -- python 2.5 and 2.6 32 bit universal, though I don't know if it works on 10.6. It sounds like Apple has made it even more ugly now. > In 10.6, Apple supplies a Python 2.6.1 (3-way build with 64-bit Intel as > default) so if you type "python" on a stock system, you get 64 bit? > and a Python 2.5.4 (2-way 32-bit only) both built with GCC > 4.2.1. 2.6.1 has a deployment target of 10.6 while 2.5.4's is 10.5: so neither of these is any good if you want to use py2app and distribute to older systems. >> Are we going to need multiple installers, maybe 32 and 64 bit? > > That will probably result in two separate installers for each > python version: one 32-bit only built as in the past for 10.3.9+ and a > new 2-way (Intel-only 32/64, 10.6 or higher) or 3-way (2-way plus ppc, > 10.5 or higher). OK -- I still think it's a good idea for us, as a community to try to support a particular small set of binaries with binary packages. In the past is was "the python.org build" I still don't think distributing binaries for Apple's builds is a good idea -- it's just not universal enough. For now, I suspect these are the best options: python 2.5: python.org build (32 bit PPC and intel) python 2.6: 32 bit python.org 2.6.4 64 bit python.org build? python 2.7: python.org 3-way build, if that happens. or separate 32 and 64 bit builds python 3.1: python.org build (whatever it ends up being) Darn, that's quite a few to support! If there is a 3 (or 4) way build, will you be able to build and install a 32bit only package (like wxPython) for it? From another thread: > Adam Morris wrote: >> As for the debate about binaries, it seems to me that if there was better >> explanation of how to use Python effectively on the various operating >> systems, it would help a lot. Basically, install 2.6.4 and be done with it. He's right -- we want to be able to provide a simple message. > Unfortunately, it's not always that cut-and-dried. For instance, the > current python.org installers are currently 32-bit only; the > Apple-supplied Python 2.6 supports 64-bit as well. That's important for > some users. So at least we can say: if you don't need 64 bit, install the latest python.org build (either 2.5, 2.6, or 3.1) If you need 64 bit, I guess you're stuck with Apple's build, though hopefully there will be another option before too long. Thanks, -Chris -- Christopher Barker, Ph.D. Oceanographer Emergency Response Division NOAA/NOS/OR&R (206) 526-6959 voice 7600 Sand Point Way NE (206) 526-6329 fax Seattle, WA 98115 (206) 526-6317 main reception Chris.Barker at noaa.gov From amorris at mistermorris.com Wed Jan 6 07:49:10 2010 From: amorris at mistermorris.com (Adam Morris) Date: Wed, 6 Jan 2010 01:49:10 -0500 Subject: [Pythonmac-SIG] What to build binaries for??? In-Reply-To: <4B442DB2.5060607@noaa.gov> References: <4B43D659.4090709@noaa.gov> <4B442DB2.5060607@noaa.gov> Message-ID: <9b202abc1001052249k137401bfh9cfb98cbd746931d@mail.gmail.com> >He's right -- we want to be able to provide a simple message. I'm right twice over. An appendum to my instructions: Not only do you have to use setuptools to install PyObjC with 2.6.4 on Snow Leopard, but you have to build the templates manually as well (using instructions found on another site). What's a guy looking for instructions to do? >If you need 64 bit, I guess you're stuck with Apple's build, though >hopefully there will be another option before too long. It's hard to believe python.org aren't close or working on a 64-bit version for release for Mac. My own glances at some forums indicates 64-bit something somethings exist. Hmmm. -Adam aka brainysmurf On Wed, Jan 6, 2010 at 1:29 AM, Christopher Barker wrote: > Ned, > > Thanks for the detailed review -- what a mess! I've got a longer note about > this at work -- apparently I failed to send it before catching the bus, but > a few clarifications: > > > 2) we're talking on that list about implementing what Robin Dunn has done >>> for wxPython -- a single installer that puts numpy somewhere, then puts >>> *.pth files in both the Apple and Python.org Pythons, so that a single >>> installer will work with both. >>> >> >> Without knowing the details, that could be a dicey proposition if there >> are any C extensions involved. >> > > well, c extensions are the whole point -- this is all pretty trivial for > pure-python. > > > There is no guarantee that a single set of binaries would work on >> multiple instances of python, even the same source level, if the pythons >> themselves were not built with the same options and tool chains. At the >> moment, that certainly is not true for the Apple and the python.orgpythons in any of 10.4, 10.5, and especially 10.6. >> > > odd -- it's been working for a while for wxPython -- python 2.5 and 2.6 32 > bit universal, though I don't know if it works on 10.6. It sounds like Apple > has made it even more ugly now. > > > In 10.6, Apple supplies a Python 2.6.1 (3-way build with 64-bit Intel as >> default) >> > > so if you type "python" on a stock system, you get 64 bit? > > > and a Python 2.5.4 (2-way 32-bit only) both built with GCC 4.2.1. 2.6.1 >> has a deployment target of 10.6 while 2.5.4's is 10.5: >> > > so neither of these is any good if you want to use py2app and distribute to > older systems. > > Are we going to need multiple installers, maybe 32 and 64 bit? >>> >> >> That will probably result in two separate installers for each >> python version: one 32-bit only built as in the past for 10.3.9+ and a new >> 2-way (Intel-only 32/64, 10.6 or higher) or 3-way (2-way plus ppc, 10.5 or >> higher). >> > > OK -- I still think it's a good idea for us, as a community to try to > support a particular small set of binaries with binary packages. In the past > is was "the python.org build" > > I still don't think distributing binaries for Apple's builds is a good idea > -- it's just not universal enough. For now, I suspect these are the best > options: > > python 2.5: > python.org build (32 bit PPC and intel) > > python 2.6: > 32 bit python.org 2.6.4 > 64 bit python.org build? > > python 2.7: > python.org 3-way build, if that happens. > or separate 32 and 64 bit builds > > python 3.1: > python.org build (whatever it ends up being) > > Darn, that's quite a few to support! > > If there is a 3 (or 4) way build, will you be able to build and install a > 32bit only package (like wxPython) for it? > > From another thread: > > Adam Morris wrote: >> >>> As for the debate about binaries, it seems to me that if there was better >>> explanation of how to use Python effectively on the various operating >>> systems, it would help a lot. Basically, install 2.6.4 and be done with >>> it. >>> >> > He's right -- we want to be able to provide a simple message. > > Unfortunately, it's not always that cut-and-dried. For instance, the >> current python.org installers are currently 32-bit only; the >> Apple-supplied Python 2.6 supports 64-bit as well. That's important for >> some users. >> > > So at least we can say: > > if you don't need 64 bit, install the latest python.org build (either 2.5, > 2.6, or 3.1) > > If you need 64 bit, I guess you're stuck with Apple's build, though > hopefully there will be another option before too long. > > Thanks, > > > -Chris > > > > > > > > > -- > Christopher Barker, Ph.D. > Oceanographer > > Emergency Response Division > NOAA/NOS/OR&R (206) 526-6959 voice > 7600 Sand Point Way NE (206) 526-6329 fax > Seattle, WA 98115 (206) 526-6317 main reception > > Chris.Barker at noaa.gov > _______________________________________________ > Pythonmac-SIG maillist - Pythonmac-SIG at python.org > http://mail.python.org/mailman/listinfo/pythonmac-sig > -------------- next part -------------- An HTML attachment was scrubbed... URL: From hengist.podd at virgin.net Wed Jan 6 10:58:51 2010 From: hengist.podd at virgin.net (has) Date: Wed, 6 Jan 2010 09:58:51 +0000 Subject: [Pythonmac-SIG] Python app with aemreceive is not scriptable In-Reply-To: References: Message-ID: Kevin Walzer wrote: > It appears that Tcl and Python differ in some respects in code execution. Python doesn't appear to return a value from code that is passed to the "exec" statement. exec evaluates statements, and Python statements don't return values. You'd need to pass global/local dicts to it and exchange values via that. For what you're doing though, eval() might be a more appropriate choice. Though personally I'd be looking to add a proper AE API, even if only procedural, so that users can't just run arbitrary code. But that's your decision, not mine. has -- Control AppleScriptable applications from Python, Ruby and ObjC: http://appscript.sourceforge.net From karstenwo at googlemail.com Wed Jan 6 16:10:15 2010 From: karstenwo at googlemail.com (Karsten Wolf) Date: Wed, 6 Jan 2010 16:10:15 +0100 Subject: [Pythonmac-SIG] py2app with python 2.6 on OSX 10.4.9/Xcode 2.5 Message-ID: <88C9308C-0DE9-49CB-9F45-2403F3E6E435@googlemail.com> Hi, I have an application which I created with python 2.5 and py2app on OSX 10.4.11. All is well. Trying to build it with python 2.6.4 and py2app 0.4.3 ends in pdb. python setup.py -A works. Analyzing the code snippet which causes the exception, one can see it calls a unix tool called 'ibtool' which is not present on my system. Seeing that the same tool is used for .xib files my guess is it belongs to Xcode 3.x. What can I do about it (without going to OSX 10.5 and Xcode 3) -karsten In py2app/converters/nibfile.py: p = subprocess.Popen(['ibtool', '--compile', destination, source]) Stack trace. creating /Users/karstenwo/python/pyobjc/bildimporter-git/build/ bildimporter.app/Contents/Resources/English.lproj Traceback (most recent call last): File "/Library/Frameworks/Python.framework/Versions/2.6/lib/ python2.6/site-packages/py2app-0.4.3-py2.6.egg/py2app/build_app.py", line 589, in _run self.run_normal() File "/Library/Frameworks/Python.framework/Versions/2.6/lib/ python2.6/site-packages/py2app-0.4.3-py2.6.egg/py2app/build_app.py", line 660, in run_normal self.create_binaries(py_files, pkgdirs, extensions, loader_files) File "/Library/Frameworks/Python.framework/Versions/2.6/lib/ python2.6/site-packages/py2app-0.4.3-py2.6.egg/py2app/build_app.py", line 755, in create_binaries target, arcname, pkgexts, copyexts, target.script) File "/Library/Frameworks/Python.framework/Versions/2.6/lib/ python2.6/site-packages/py2app-0.4.3-py2.6.egg/py2app/build_app.py", line 1180, in build_executable copy_resource(src, dest, dry_run=self.dry_run) File "/Library/Frameworks/Python.framework/Versions/2.6/lib/ python2.6/site-packages/py2app-0.4.3-py2.6.egg/py2app/util.py", line 84, in copy_resource converter(source, destination, dry_run=dry_run) File "/Library/Frameworks/Python.framework/Versions/2.6/lib/ python2.6/site-packages/py2app-0.4.3-py2.6.egg/py2app/converters/ nibfile.py", line 27, in convert_nib p = subprocess.Popen(['ibtool', '--compile', destination, source]) File "/Library/Frameworks/Python.framework/Versions/2.6/lib/ python2.6/subprocess.py", line 621, in __init__ errread, errwrite) File "/Library/Frameworks/Python.framework/Versions/2.6/lib/ python2.6/subprocess.py", line 1126, in _execute_child raise child_exception OSError: [Errno 2] No such file or directory > /Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/ subprocess.py(1126)_execute_child() -> raise child_exception (Pdb) From Chris.Barker at noaa.gov Wed Jan 6 17:22:24 2010 From: Chris.Barker at noaa.gov (Christopher Barker) Date: Wed, 06 Jan 2010 08:22:24 -0800 Subject: [Pythonmac-SIG] [Numpy-discussion] 1.4.0 installer fails on OSX 10.6.2 In-Reply-To: <5b8d13221001051709g58103d1ewf4915d8be38a3277@mail.gmail.com> References: <9d5ec4221001050835w5dd4cf97hffd4f2480bf19c3e@mail.gmail.com> <4B43A4FF.3010604@hawaii.edu> <4B43B4CD.3030701@hawaii.edu> <523E341E-A076-465C-938C-EC902F5F0D16@gmail.com> <4B43C4D2.5030701@noaa.gov> <4B43D330.7090608@noaa.gov> <4B43D6E6.80305@noaa.gov> <5b8d13221001051709g58103d1ewf4915d8be38a3277@mail.gmail.com> Message-ID: <4B44B8C0.5010203@noaa.gov> NOTE: cc-d to the pythonmac list from the numpy list -- this is really a Mac issue. It's a discussion of what/how to produce binaries of numpy for OS-X David Cournapeau wrote: > On Wed, Jan 6, 2010 at 9:18 AM, Christopher Barker > wrote: > >> If distutils/setuptools could identify the python version properly, then >> binary eggs and easy-install could be a solution -- but that's a mess, >> too. > > It would not solve the problem, really. Two same versions of python > does not imply compatible python when C extensions are involved. In > current state of affairs, where python does not have a stable ABI, the > only workable solution is to target one specific python So you are saying that binary eggs are simply impossible altogether. Maybe true, I suppose, but... >>> As the 2.6 series is binary compatible, you can build a single >>> installer >>> that will work with both > > I don't think that's true. 2.6.x are compatible with each other iif > they are built with the same compiler options. There are too many > differences between Apple python and the python.org python (dtrace, 64 > bits support, compiler options, etc...) IMHO to make a compatible > installer for both versions worthwhile. Well, it was possible once, and it's been working just fine for wxPython for a good while. Things may have changed with OS-X 10.6, tough I think the wxPython binary still works (32 bit only, of course). > I agree that the lack of 64 bits installer is an issue, but building > numpy on mac os x is not that difficult, and I think people who need > 64 bits often are more knowledgeable. I agree -- but what do you get if you install OS-X 10.6, and then type "python" at the prompt -- is that a 32 bit or 64 bit python? > There are also solutions like > EPD and the likes, which support 64 bits. but not PPC anymore, sigh. There is a key problem here -- folks running OS-X expecting it to be another Unix are fine -- they install the compiler, build their own extensions, probably use some combination of fink and macports, etc. This may well apply to many Scientific programmers, and web developers (though it maybe not). However, there is a different type of Mac user -- the type that has traditionally used Macs. Some of these folks are giving a bit of programming a try, and have heard that python is an easy to learn language -- and, cool, OS-X even comes with it installed! But then they soon enough discover that they need additional packages of some sort --- and numpy is a very, very useful package, and not just for the experienced programmer (think Matlab users, for instance). These folks haven't installed the compiler, don't know 64 from 32 bit, and heaven forbid, have no idea how the heck to compile a dependency with the "./configure && make && make install" dance. Some years ago, the community on the pythonmac list made significant efforts to try to support these folks. Primarily what they need are binary installers. We also more or less declared the python.org python as the official python to support, and even had a repository of pre-built packages (http://pythonmac.org/packages/py25-fat/index.html). It was pretty handy -- you could get python itself and all the major packages there, all working together. That repository is not longer maintained, for a couple reasons: 1) Bob Ippolito is doing other things 2) A lot of package developers are providing binaries themselves 3) It's gotten even messier! But there is still a community out there that it would be nice to support. So the question is: how do we do it? That repository appears to be dead, though it could be revived if there is a bit of interest. But even without it, it would be great if there was some sort of consensus among the pythonmac crowd and the major package developers as to what to provide binaries for. We're really in a mess if you can only get a binary for PIL for the Apple Python, and only get a binary for numpy for the python.org python. Personally, I still think the Apple python is dead-end -- Apple has never supported it properly. And, if you go that route you need a different build for people running 10.4 and 10.5, and 10.6, and ... I'm not sure what the 64 bit story is -- I suspect that David is right -- folks running 64 bits are the ones that know what they are doing, so they have less need for binaries. So maybe for now this is a good goal: python 2.5: python.org build (32 bit PPC and intel) python 2.6: 32 bit python.org 2.6.4 64 bit python.org build? python 2.7: python.org 3-way build, if that happens. or separate 32 and 64 bit builds python 3.1: python.org build (whatever it ends up being) Darn, that's quite a few to support! NOTE: Ned Deily just posted a good summary of what's out there on teh pythonmac list: http://mail.python.org/pipermail/pythonmac-sig/2010-January/022031.html -Chris -- Christopher Barker, Ph.D. Oceanographer Emergency Response Division NOAA/NOS/OR&R (206) 526-6959 voice 7600 Sand Point Way NE (206) 526-6329 fax Seattle, WA 98115 (206) 526-6317 main reception Chris.Barker at noaa.gov From Chris.Barker at noaa.gov Wed Jan 6 17:35:47 2010 From: Chris.Barker at noaa.gov (Christopher Barker) Date: Wed, 06 Jan 2010 08:35:47 -0800 Subject: [Pythonmac-SIG] [Numpy-discussion] 1.4.0 installer fails on OSX 10.6.2 In-Reply-To: <4B44B8C0.5010203@noaa.gov> References: <9d5ec4221001050835w5dd4cf97hffd4f2480bf19c3e@mail.gmail.com> <4B43A4FF.3010604@hawaii.edu> <4B43B4CD.3030701@hawaii.edu> <523E341E-A076-465C-938C-EC902F5F0D16@gmail.com> <4B43C4D2.5030701@noaa.gov> <4B43D330.7090608@noaa.gov> <4B43D6E6.80305@noaa.gov> <5b8d13221001051709g58103d1ewf4915d8be38a3277@mail.gmail.com> <4B44B8C0.5010203@noaa.gov> Message-ID: <4B44BBE3.9090601@noaa.gov> One more note: An easy improvement to the current situation with binaries is to LABEL THEM WELL: It's worse to have a binary you expect to work fail for you than to not have one available. IN the past, I think folks' have used the default name provided by bdist_mpkg, and those are not always clear. Something like: numpy1.4-osx10.4-python.org2.6-32bit.dmg or something -- even better, with a a bit more text -- would help a lot. -Chris -- Christopher Barker, Ph.D. Oceanographer Emergency Response Division NOAA/NOS/OR&R (206) 526-6959 voice 7600 Sand Point Way NE (206) 526-6329 fax Seattle, WA 98115 (206) 526-6317 main reception Chris.Barker at noaa.gov From amorris at mistermorris.com Wed Jan 6 17:41:28 2010 From: amorris at mistermorris.com (Adam Morris) Date: Wed, 6 Jan 2010 11:41:28 -0500 Subject: [Pythonmac-SIG] [Numpy-discussion] 1.4.0 installer fails on OSX 10.6.2 In-Reply-To: <4B44B8C0.5010203@noaa.gov> References: <9d5ec4221001050835w5dd4cf97hffd4f2480bf19c3e@mail.gmail.com> <4B43B4CD.3030701@hawaii.edu> <523E341E-A076-465C-938C-EC902F5F0D16@gmail.com> <4B43C4D2.5030701@noaa.gov> <4B43D330.7090608@noaa.gov> <4B43D6E6.80305@noaa.gov> <5b8d13221001051709g58103d1ewf4915d8be38a3277@mail.gmail.com> <4B44B8C0.5010203@noaa.gov> Message-ID: <9b202abc1001060841j1cbf8571q4fef1b09faf17fdc@mail.gmail.com> > > However, there is a different type of Mac user -- the type that has > traditionally used Macs. Some of these folks are giving a bit of programming > a try, and have heard that python is an easy to learn language -- and, cool, > OS-X even comes with it installed! It's true there is definitely a market. But that last part is most important. I actually think that python is best suited to take over applescript in the scripting business. I mean, what a limited language applescript is, compared to how easy Python is! But then they soon enough discover that they need additional packages of > some sort --- and numpy is a very, very useful package, and not just for the > experienced programmer (think Matlab users, for instance). These folks > haven't installed the compiler, don't know 64 from 32 bit, and heaven > forbid, have no idea how the heck to compile a dependency with the > "./configure && make && make install" dance. I do know my 64 from 32, but since I've been teaching teenagers for the last five years I am definitely rusty. So I would fit into this category. And I definitely think there aren't enough docs out there. Apple's PyObjC still talks about Tiger! Some years ago, the community on the pythonmac list made significant efforts > to try to support these folks. Primarily what they need are binary > installers. We also more or less declared the python.orgpython as the > official python to support, and even had a repository of pre-built packages > (http://pythonmac.org/packages/py25-fat/index.html). It was pretty handy > -- you could get python itself and all the major packages there, all working > together. Python 2.6.4 with setuptools is a fairly simple matter, again, it's just a matter of it being "out there." -------------- next part -------------- An HTML attachment was scrubbed... URL: From Chris.Barker at noaa.gov Thu Jan 7 20:16:40 2010 From: Chris.Barker at noaa.gov (Christopher Barker) Date: Thu, 07 Jan 2010 11:16:40 -0800 Subject: [Pythonmac-SIG] [Numpy-discussion] 1.4.0 installer fails on OSX 10.6.2 In-Reply-To: <5b8d13221001061712m3498390cse4b2ae6b37fc19e2@mail.gmail.com> References: <9d5ec4221001050835w5dd4cf97hffd4f2480bf19c3e@mail.gmail.com> <4B43B4CD.3030701@hawaii.edu> <523E341E-A076-465C-938C-EC902F5F0D16@gmail.com> <4B43C4D2.5030701@noaa.gov> <4B43D330.7090608@noaa.gov> <4B43D6E6.80305@noaa.gov> <5b8d13221001051709g58103d1ewf4915d8be38a3277@mail.gmail.com> <4B44B8C0.5010203@noaa.gov> <4B44BBE3.9090601@noaa.gov> <5b8d13221001061712m3498390cse4b2ae6b37fc19e2@mail.gmail.com> Message-ID: <4B463318.5060902@noaa.gov> David Cournapeau wrote: > On Thu, Jan 7, 2010 at 1:35 AM, Christopher Barker >> In the past, I think folks' have used the default >> name provided by bdist_mpkg, and those are not always clear. Something like: >> >> >> numpy1.4-osx10.4-python.org2.6-32bit.dmg > > The 32 bits is redundant - we support all archs supported by the > official python binary, so python.org is enough. True, though I was anticipating that there may be 32 and 64 bit builds some day. > About osx10.4, As for that -- I put that in 'cause I remembered that in the past it has said "10.5", when, in fact 10.4 was supported. Thinking more, I think it's like 32 bit -- the python.org build supports 10.4, so that's all the information folks need. > still don't know how to make sure we do work there with distutils. The > whole MACOSX_DEPLOYMENT_TARGET confuses me quite a lot. distutils should do it right, and indeed, I just tested the py2.5 and py2.6 binaries on my 10.4 PPC machine ,and most of the tests all pass on both. (though see the note below) I think distutils does do it right, at least if you use the latest version of 2.6 -- a bug was fixed there. What OS/architecture were those built with? > Other than > that, the numpy 1.4.0 follows your advice, and contains the python.org > part. I should have looked first -- thanks, I think that will be helpful. NOTE: When I first installed the binary, I got a whole bunch of errors because "matrix' wasn't found. I recalled this issue from testing, and cleared out the install, then re-installed, and all was fine. I wonder if it's possible to have a mpkg remove anything? Other failed tests: ====================================================================== FAIL: test_umath.test_nextafterl ... return _test_nextafter(np.longdouble) File "/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/numpy/core/tests/test_umath.py", line 852, in _test_nextafter assert np.nextafter(one, two) - one == eps AssertionError ====================================================================== FAIL: test_umath.test_spacingl ---------------------------------------------------------------------- ... Traceback (most recent call last): line 887, in test_spacingl return _test_spacing(np.longdouble) File "/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/numpy/core/tests/test_umath.py", line 873, in _test_spacing assert np.spacing(one) == eps AssertionError I think both of those are known issues, and not a big deal. -Chris -- Christopher Barker, Ph.D. Oceanographer Emergency Response Division NOAA/NOS/OR&R (206) 526-6959 voice 7600 Sand Point Way NE (206) 526-6329 fax Seattle, WA 98115 (206) 526-6317 main reception Chris.Barker at noaa.gov From ohseiya at gmail.com Sat Jan 9 21:31:07 2010 From: ohseiya at gmail.com (Seiya) Date: Sat, 9 Jan 2010 12:31:07 -0800 Subject: [Pythonmac-SIG] Create a new tab with index 1? Message-ID: I would like to use appscript to realize the following applescript: tell application "Safari" tell window 1 make new tab at beginning end tell end tell that is, I want to make a new tab with index 1. The following code safari = app("Safari").windows[1].make(new=k.tab) will create a tab at the end. I know that I should at some "at=" in the parameter. However, I cannot figure out how to use "k.location_reference". I wonder whether someone can help me out. Thanks. -------------- next part -------------- An HTML attachment was scrubbed... URL: From charles.hartman at conncoll.edu Sun Jan 10 01:23:27 2010 From: charles.hartman at conncoll.edu (Charles Hartman) Date: Sat, 9 Jan 2010 19:23:27 -0500 Subject: [Pythonmac-SIG] font-choice dialog in Snow Leopard Message-ID: <445B7272-710B-4F3E-8E64-4CDA83570953@conncoll.edu> I admit I haven't looked into it in detail yet, and I will, but maybe somebody can simplify the hunt. In an app I last built with py2app under Leopard, a standard dialog to choose a font (using wxPython's wx.GetFontFromUser() ) appears on the screen for a brief flash and then vanishes when I run the executable under Snow Leopard. I could begin by just rebuilding with py2app under Snow Leopard, but I'm nervous, given all the S.L. alarms I've seen here. Charles Hartman From nad at acm.org Sun Jan 10 01:54:49 2010 From: nad at acm.org (Ned Deily) Date: Sat, 09 Jan 2010 16:54:49 -0800 Subject: [Pythonmac-SIG] Create a new tab with index 1? References: Message-ID: In article , Seiya wrote: > I would like to use appscript to realize the following applescript: > > tell application "Safari" > tell window 1 > make new tab at beginning > end tell > end tell > > that is, I want to make a new tab with index 1. The following code > safari = app("Safari").windows[1].make(new=k.tab) > will create a tab at the end. I know that I should at some "at=" in the > parameter. However, I cannot figure out how to use "k.location_reference". app("Safari").windows[1].make(new=k.tab, at=app.windows[1].beginning, with_properties={k.URL:"http://python.org"}) P.S. For help with translating existing snippets of AppleScript into appscript, use the ASTranslate.app tool: http://appscript.sourceforge.net/tools.html -- Ned Deily, nad at acm.org From kw at codebykevin.com Sun Jan 10 21:08:52 2010 From: kw at codebykevin.com (Kevin Walzer) Date: Sun, 10 Jan 2010 15:08:52 -0500 Subject: [Pythonmac-SIG] Python app with aemreceive is not scriptable In-Reply-To: References: Message-ID: <4B4A33D4.8060502@codebykevin.com> On 1/6/10 4:58 AM, has wrote: > > Though personally I'd be looking to add a proper AE API, even if only procedural, so that users can't just run arbitrary code. But that's your decision, not mine. > Following has's advice here, I'm trying to implement a basic API (set of Python commands/functions) in one of my apps. However, it's not working, perhaps because of scoping issues. My Python apps basically run in a single fooApp class, and everything runs inside the class. To launch the app (my apps are Tkinter-based), I use something like this: if __name__== '__main__': app = fooApp(None) app.mainloop() I've added a doCommand function inside the app class to provide some basic functionality in response to an AppleScript: it will set some objects/variables, then display the output in the app. In my code it looks like this: def runCommand(self, string): self.searchterm=string self.servertree.selection_set('Default') self.getInfo() However, I'm having some trouble with getting this out to AppleScript. My script: tell application "FooApp" run script "fooApp.runCommand(\"inputstring\")" end tell returns this error: NameError: name 'fooApp' is not defined What's the best way to structure the command so that it can be seen from AppleScript, i.e. run in the proper scope and not return an error? --Kevin -- Kevin Walzer Code by Kevin http://www.codebykevin.com From cournape at gmail.com Thu Jan 7 02:09:42 2010 From: cournape at gmail.com (David Cournapeau) Date: Thu, 7 Jan 2010 10:09:42 +0900 Subject: [Pythonmac-SIG] [Numpy-discussion] 1.4.0 installer fails on OSX 10.6.2 In-Reply-To: <4B44B8C0.5010203@noaa.gov> References: <9d5ec4221001050835w5dd4cf97hffd4f2480bf19c3e@mail.gmail.com> <4B43B4CD.3030701@hawaii.edu> <523E341E-A076-465C-938C-EC902F5F0D16@gmail.com> <4B43C4D2.5030701@noaa.gov> <4B43D330.7090608@noaa.gov> <4B43D6E6.80305@noaa.gov> <5b8d13221001051709g58103d1ewf4915d8be38a3277@mail.gmail.com> <4B44B8C0.5010203@noaa.gov> Message-ID: <5b8d13221001061709u56d72a80m73bacb69d123cd04@mail.gmail.com> On Thu, Jan 7, 2010 at 1:22 AM, Christopher Barker wrote: > NOTE: cc-d to the pythonmac list from the numpy list -- this is really a > Mac issue. It's a discussion of what/how to produce binaries of numpy > for OS-X > > > David Cournapeau wrote: >> On Wed, Jan 6, 2010 at 9:18 AM, Christopher Barker >> wrote: >> >>> If distutils/setuptools could identify the python version properly, then >>> ?binary eggs and easy-install could be a solution -- but that's a mess, >>> too. >> >> It would not solve the problem, really. Two same versions of python >> does not imply compatible python when C extensions are involved. In >> current state of affairs, where python does not have a stable ABI, the >> only workable solution is to target one specific python > > So you are saying that binary eggs are simply impossible altogether. More simply, you can't offer a single binary installer which works on binary-incompatible python versions. > I agree -- but what do you get if you install OS-X 10.6, and then type > "python" at the prompt -- is that a 32 bit or 64 bit python? 64 bits, at least by default. All the userland provided by OS-X is 64 bits AFAIK (the only apps still 32 bits on my macbook are vmware and the kernel). There is also the problem that controlling the minimal supported version of OS X is hard to control (another distutils insanity). > However, there is a different type of Mac user -- the type that has > traditionally used Macs. Some of these folks are giving a bit of > programming a try, and have heard that python is an easy to learn > language -- and, cool, OS-X even comes with it installed! > > But then they soon enough discover that they need additional packages of > some sort --- and numpy is a very, very useful package, and not just for > the experienced programmer (think Matlab users, for instance). These > folks haven't installed the compiler, don't know 64 from 32 bit, and > heaven forbid, have no idea how the heck to compile a dependency with > the "./configure && make && make install" dance. Those people already have numpy installed, though. The only solution I can see for a one-click install is to control the whole stack, e.g. like EPD eos. > Some years ago, the community on the pythonmac list made significant > efforts to try to support these folks. Primarily what they need are > binary installers. We also more or less declared the python.org python > as the official python to support, and even had a repository of > pre-built packages (http://pythonmac.org/packages/py25-fat/index.html). > It was pretty handy -- you could get python itself and all the major > packages there, all working together. I hope that our own scientific repository will be able to do this - at least that's one of the stated goal (see the toydist discussion). The only scalable solution I can see is if the packages are automatically built for every version of Mac OS X we wish to support. > > Personally, I still think the Apple python is dead-end -- Apple has > never supported it properly. And, if you go that route you need a > different build for people running 10.4 and 10.5, and 10.6, and ... I am afraid that this is needed anyway once you start depending on "high-level" stuff from Mac OS X API. > Darn, that's quite a few to support! I would say that's insane :) That's hopeless intractable. If the numpy stats are any indication, only supporting the last released python version is enough for most users. IMHO, it is much better to support only one binary installer which works well rather than a myriad which work half the time, and only confuse people anyway. David From cournape at gmail.com Thu Jan 7 02:12:08 2010 From: cournape at gmail.com (David Cournapeau) Date: Thu, 7 Jan 2010 10:12:08 +0900 Subject: [Pythonmac-SIG] [Numpy-discussion] 1.4.0 installer fails on OSX 10.6.2 In-Reply-To: <4B44BBE3.9090601@noaa.gov> References: <9d5ec4221001050835w5dd4cf97hffd4f2480bf19c3e@mail.gmail.com> <4B43B4CD.3030701@hawaii.edu> <523E341E-A076-465C-938C-EC902F5F0D16@gmail.com> <4B43C4D2.5030701@noaa.gov> <4B43D330.7090608@noaa.gov> <4B43D6E6.80305@noaa.gov> <5b8d13221001051709g58103d1ewf4915d8be38a3277@mail.gmail.com> <4B44B8C0.5010203@noaa.gov> <4B44BBE3.9090601@noaa.gov> Message-ID: <5b8d13221001061712m3498390cse4b2ae6b37fc19e2@mail.gmail.com> On Thu, Jan 7, 2010 at 1:35 AM, Christopher Barker wrote: > One more note: > > An easy improvement to the current situation with binaries is to LABEL > THEM WELL: > > It's worse to have a binary you expect to work fail for you than to not > have one available. IN the past, I think folks' have used the default > name provided by bdist_mpkg, and those are not always clear. Something like: > > > numpy1.4-osx10.4-python.org2.6-32bit.dmg The 32 bits is redundant - we support all archs supported by the official python binary, so python.org is enough. About osx10.4, I still don't know how to make sure we do work there with distutils. The whole MACOSX_DEPLOYMENT_TARGET confuses me quite a lot. Other than that, the numpy 1.4.0 follows your advice, and contains the python.org part. David From david at silveregg.co.jp Fri Jan 8 03:07:03 2010 From: david at silveregg.co.jp (David Cournapeau) Date: Fri, 08 Jan 2010 11:07:03 +0900 Subject: [Pythonmac-SIG] [Numpy-discussion] 1.4.0 installer fails on OSX 10.6.2 In-Reply-To: <4B463318.5060902@noaa.gov> References: <9d5ec4221001050835w5dd4cf97hffd4f2480bf19c3e@mail.gmail.com> <4B43B4CD.3030701@hawaii.edu> <523E341E-A076-465C-938C-EC902F5F0D16@gmail.com> <4B43C4D2.5030701@noaa.gov> <4B43D330.7090608@noaa.gov> <4B43D6E6.80305@noaa.gov> <5b8d13221001051709g58103d1ewf4915d8be38a3277@mail.gmail.com> <4B44B8C0.5010203@noaa.gov> <4B44BBE3.9090601@noaa.gov> <5b8d13221001061712m3498390cse4b2ae6b37fc19e2@mail.gmail.com> <4B463318.5060902@noaa.gov> Message-ID: <4B469347.6000000@silveregg.co.jp> Christopher Barker wrote: > David Cournapeau wrote: >> On Thu, Jan 7, 2010 at 1:35 AM, Christopher Barker >>> In the past, I think folks' have used the default >>> name provided by bdist_mpkg, and those are not always clear. Something like: >>> >>> >>> numpy1.4-osx10.4-python.org2.6-32bit.dmg >> The 32 bits is redundant - we support all archs supported by the >> official python binary, so python.org is enough. > > True, though I was anticipating that there may be 32 and 64 bit builds > some day. I suspect it will be exactly as today, i.e. a universal build with 64 bits. I have not followed closely the discussion on python-dev on that topic, but I believe python 2.7 sill contain 64 bits as an arch. > What OS/architecture were those built with? Snow Leopard. > When I first installed the binary, I got a whole bunch of errors because > "matrix' wasn't found. I recalled this issue from testing, and cleared > out the install, then re-installed, and all was fine. I wonder if it's > possible to have a mpkg remove anything? pkg does not have a uninstaller - I don't think Apple provides one, that's a known limitation of Mac OS X installers (although I believe there are 3rd party ones) > > > I think both of those are known issues, and not a big deal. Maybe the spacing function is wrong on PPC. The underlying is highly architecture dependent. David From m.mohr at johalla.de Sat Jan 9 18:10:19 2010 From: m.mohr at johalla.de (Markus Mohr) Date: Sat, 9 Jan 2010 18:10:19 +0100 Subject: [Pythonmac-SIG] pyopencl In-Reply-To: <9438d60d1001090630i55a63d62k60781fe074b2fd0f@mail.gmail.com> References: <9438d60d1001090630i55a63d62k60781fe074b2fd0f@mail.gmail.com> Message-ID: Hi, I would like to try out OpenCL on 10.6. When I searched for python and opencl I thought I'd just found several mirrors of the same project but it looks like there are at least 4(!) pyopencls. That would be: http://mathema.tician.de/software/pyopencl (has entry on python.org) http://sourceforge.net/projects/pyopencl/ http://python-opencl.next-touch.com/ (has entry on python.org) http://gitorious.org/python-opencl Has someone used any of these? A recomendation perhaps? Thanks, Markus From kw at codebykevin.com Mon Jan 11 03:31:17 2010 From: kw at codebykevin.com (Kevin Walzer) Date: Sun, 10 Jan 2010 21:31:17 -0500 Subject: [Pythonmac-SIG] Python app with aemreceive is not scriptable In-Reply-To: <4B4A33D4.8060502@codebykevin.com> References: <4B4A33D4.8060502@codebykevin.com> Message-ID: <4B4A8D75.3050300@codebykevin.com> On 1/10/10 3:08 PM, Kevin Walzer wrote: > What's the best way to structure the command so that it can be seen from > AppleScript, i.e. run in the proper scope and not return an error? Never mind about the scope question--I found that simply adding the aemreceive bits and the custom function inside the app class resolved that issue, cf: def getDomain(domain): self.searchterm=domain self.searchfield.insert(domain) self.servertree.selection_set('Default') self.getInfo() installeventhandler( getDomain, 'GetDmain', ('----', 'domain', kae.typeUnicodeText) ) The idea is to run the app, set a variable, "self.searchterm," then display the output in the app's GUI. Simple. However, now I'm running into a separate issue. The AppleScript command that corresponds to the "GetDmain" event, "get domain," returns a strange error: tell application "QuickWho" get domain "\"codebykevin.com\"" end tell It launches the app, but returns "missing value." I know "missing value" is an AppleScript constant, but I'm not sure what variable is returning empty here, which I believe is the "missing value" message. Any ideas? --Kevin -- Kevin Walzer Code by Kevin http://www.codebykevin.com From kw at codebykevin.com Tue Jan 12 01:00:29 2010 From: kw at codebykevin.com (Kevin Walzer) Date: Mon, 11 Jan 2010 19:00:29 -0500 Subject: [Pythonmac-SIG] Integrating aemreceive into a class--help Message-ID: <4B4BBB9D.4080108@codebykevin.com> I'm having a harder time than expected integrating aemreceive into my application class. While aemreceive's example code is admirably clear and the docs are thorough, they are geared for procedural code, and I keep tripping over scoping issues in trying to integrate the library into a more OO setting. Here's where things stand: First, I simply import aemreceive into my app class. Next, I wrap its "installeventhandler" function into a class method, cf: def installeventhandler (self, eventcallback, eventcode, *parameterdefinitions): aemreceive.installeventhandler(eventcallback, eventcode, *parameterdefinitions, codecs=aem.Codecs()) Next, in my app class's __init__ method, I install the event handler like so: self.installeventhandler(self.getDomain, 'CoKvdman', ('----', 'self', aemreceive.kae.typeUnicodeText), ('----', 'domain', aemreceive.kae.typeUnicodeText) ) This actually builds and runs the application without any complaints about "self" being undefined. However, I still can't actually get data from my Apple Event. As it's currently set up, I get this error from AppleScript: "Required parameter '----' is missing." I'm not clear on what this means. According to the aemreceive docs, I need to provide a tuple for each parameter included. This means two, i.e. "self" and "domain," as outlined above. I don't know what the missing parameter is. This doesn't *look* right to me: "self" prepends the "getDomain" method and actually shouldn't be included in the parameter setup as well, by my logic. However, the application crashes if I change "self.getDomain" to "getDomain" because, of course, "getDomain" is not defined. Any guidance in getting the parameters for the event handlers correctly fleshed out would be much appreciated. In particular, I'm not sure where "self" should go, nor am I even certain if aemreceive.kae.typeUnicodeText is the correct data type for that. I hope I don't sound too frustrated. Apple Events are very complicated, and has's work on making them accessible via this higher-level interface is admirable. Tk-Aqua's built-in "do-script" functionality is easier to use, and is very flexible in the sense that it allows you to execute *any* Tcl code, but aemreceive allows you to provide a real AppleScript interface to Python commands (you don't have to call raw Python code from AppleScript). There's a richer Tcl interface to Apple Events called TclAE, but it's more low-level and complex, and and it's only minimally maintained, so the extensive work needed to make it 64-bit capable has not yet been done. So, thanks again to has for his good work on this! And looking forward to additional advice on the package. Best, Kevin -- Kevin Walzer Code by Kevin http://www.codebykevin.com From hengist.podd at virgin.net Tue Jan 12 20:13:22 2010 From: hengist.podd at virgin.net (has) Date: Tue, 12 Jan 2010 19:13:22 +0000 Subject: [Pythonmac-SIG] Integrating aemreceive into a class--help In-Reply-To: References: Message-ID: <692A8E73-35C4-4587-B731-4E03127B723F@virgin.net> Kevin Walzer wrote: > First, I simply import aemreceive into my app class. Next, I wrap its "installeventhandler" function into a class method, cf: > > def installeventhandler (self, > eventcallback, > eventcode, > *parameterdefinitions): > aemreceive.installeventhandler(eventcallback, eventcode, *parameterdefinitions, codecs=aem.Codecs()) > > Next, in my app class's __init__ method, I install the event handler like so: > > self.installeventhandler(self.getDomain, > 'CoKvdman', > ('----', 'self', aemreceive.kae.typeUnicodeText), > ('----', 'domain', aemreceive.kae.typeUnicodeText) > ) You don't pass self to a bound method in Python. Delete the ('----', 'self', ...) tuple. HTH has -- Control AppleScriptable applications from Python, Ruby and ObjC: http://appscript.sourceforge.net From kw at codebykevin.com Tue Jan 12 23:51:55 2010 From: kw at codebykevin.com (Kevin Walzer) Date: Tue, 12 Jan 2010 17:51:55 -0500 Subject: [Pythonmac-SIG] Integrating aemreceive into a class--help In-Reply-To: <692A8E73-35C4-4587-B731-4E03127B723F@virgin.net> References: <692A8E73-35C4-4587-B731-4E03127B723F@virgin.net> Message-ID: <4B4CFD0B.4000708@codebykevin.com> On 1/12/10 2:13 PM, has wrote: > You don't pass self to a bound method in Python. Delete the ('----', 'self', ...) tuple. > > My app crashes when I do that. Here's the error message: TypeError: Can't install event handler 'CoKvdman': expected 2 parameters but function 'getDomain' has 1. logout I've gotten things to load, instead, by refactoring the code to import aemreceive into a brief "main" module, into which I also import my app class, like this: import aem import aemreceive from quickwho_main import quickwhoApp #expose basic functionality to AppleScript def getDomain(domain): quickwhoApp.searchterm = StringVar() quickwhoApp.searchterm = "" quickwhoApp.searchterm.set(domain) quickwhoApp.searchfield.insert(0, domain) quickwhoApp.servertree.selection_set('Default') quickwhoApp.getInfo() aemreceive.installeventhandler(getDomain, 'CoKvdman', ('----', 'domain', aemreceive.kae.typeUnicodeText) ) app = quickwhoApp(None) app.mainloop() This plays nicer with aemreceive's procedural API. Thanks, Kevin -- Kevin Walzer Code by Kevin http://www.codebykevin.com From kw at codebykevin.com Wed Jan 13 00:15:55 2010 From: kw at codebykevin.com (Kevin Walzer) Date: Tue, 12 Jan 2010 18:15:55 -0500 Subject: [Pythonmac-SIG] Integrating aemreceive into a class--help In-Reply-To: <692A8E73-35C4-4587-B731-4E03127B723F@virgin.net> References: <692A8E73-35C4-4587-B731-4E03127B723F@virgin.net> Message-ID: <4B4D02AB.3080804@codebykevin.com> On 1/12/10 2:13 PM, has wrote: > Kevin Walzer wrote: > > > You don't pass self to a bound method in Python. Delete the ('----', 'self', ...) tuple. > > HTH One more follow-up: The code now works! I run this code in Script Editor: tell application "QuickWho" get domain "codebykevin.com" end tell and my application fires up, and does what the code intends it to do. Awesome! As noted before, aemreceive doesn't seem to play nice with "self" passed in as a parameter--or at least I can't get it to. So some minor refactoring of my code worked around that issue. I used to stuff all of my app code in a main module, "QuickWho.py," for instance, that I then wrapped in an app bundle. I pulled out the main app class and put that into a different module, quickwho_main, which I then imported into QuickWho.py. Then, in the QuickWho.py module, I ran the "installeventhandler" function as outlined in the docs and sample code, with the parameters correctly set. For posterity's sake, here's my final code layout: --- import aem import aemreceive from quickwho_main import quickwhoApp app = quickwhoApp(None) #expose basic functionality to AppleScript def getDomain(domain): app.searchfield.insert(0, domain) app.servertree.selection_set('Default') app.getInfo() aemreceive.installeventhandler(getDomain, 'CoKvdman', ('----', 'domain', aemreceive.kae.typeUnicodeText) ) app.mainloop() -- Thanks again to has for the help and the great package! --Kevin -- Kevin Walzer Code by Kevin http://www.codebykevin.com From juhasecke at googlemail.com Wed Jan 13 18:50:55 2010 From: juhasecke at googlemail.com (Jan Ulrich Hasecke) Date: Wed, 13 Jan 2010 18:50:55 +0100 Subject: [Pythonmac-SIG] Kernel panics Message-ID: -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi, on my PowerBook 1,67 I get kernel panics when I switch on Airport. When Airport is disabled it just works fine. Is there any software tool to test the Airport card? The PB is running Tiger. Any known driver issues? juh -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.10 (Darwin) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAktOB/8ACgkQPUzUEFbILMQ3bwCbBU6gDvTBDj5QSlktyC2YNiVF WtwAniT23AT33u0rEpUGNZI8PfBd/n1A =Ulyg -----END PGP SIGNATURE----- From aahz at pythoncraft.com Thu Jan 14 03:25:39 2010 From: aahz at pythoncraft.com (Aahz) Date: Wed, 13 Jan 2010 18:25:39 -0800 Subject: [Pythonmac-SIG] 10.6: platform.mac_ver() broken Message-ID: <20100114022538.GA11192@panix.com> After a lot of poking around, it appears that platform.mac_ver() is broken in 10.6 (Snow Leopard) because the gestalt module calls fork(), which causes a crash with USING_FORK_WITHOUT_EXEC_IS_NOT_SUPPORTED_BY_FILE_MANAGER. This seems to only happen with py2app builds; I have not been able to reproduce using strict command-line testing, and I haven't had time to create a stripped-down app to test with. I'd appreciate if someone else could verify before I file a bug. (It's possible that the multiprocessing module is involved if a simple test fails to reproduce -- my AppDelegate starts another process for the main code that then calls mac_ver() to log the current OS version.) I'm using os.uname() instead for now. -- Aahz (aahz at pythoncraft.com) <*> http://www.pythoncraft.com/ "If you think it's expensive to hire a professional to do the job, wait until you hire an amateur." --Red Adair From hamish.sanderson at virgin.net Wed Jan 13 19:42:45 2010 From: hamish.sanderson at virgin.net (has) Date: Wed, 13 Jan 2010 18:42:45 +0000 Subject: [Pythonmac-SIG] Integrating aemreceive into a class--help References: Message-ID: > Kevin Walzer wrote: > >> You don't pass self to a bound method in Python. Delete the ('----', 'self', ...) tuple. > > My app crashes when I do that. Here's the error message: > > TypeError: Can't install event handler 'CoKvdman': expected 2 parameters > but function 'getDomain' has 1. Ah, that would be a bug in aemreceive then. When you can installeventhandler it checks the function object's argument names list. It doesn't check it's an unbound function or bound method, however, so doesn't realise it should ignore the first argument name when validating the tuples that represent your AE-to-Python parameter bindings. I'll need to fix that, but it won't be soon as I'm really busy. For now, try commenting out the relevant validation code in aemreceive.main._processArgDefs: if len(argNames) != len(argDefs): raise TypeError, "Can't install event handler %r: expected %i parameters but function %r has %i." % (eventCode, len(argNames), callback.__name__, len(argDefs)) HTH has -- Control AppleScriptable applications from Python, Ruby and ObjC: http://appscript.sourceforge.net From lists at collab.nl Thu Jan 14 20:14:28 2010 From: lists at collab.nl (Thijs Triemstra | Collab) Date: Thu, 14 Jan 2010 19:14:28 +0000 Subject: [Pythonmac-SIG] 10.6: platform.mac_ver() broken In-Reply-To: <20100114022538.GA11192@panix.com> References: <20100114022538.GA11192@panix.com> Message-ID: <165EB81C-A60B-4742-8271-D8C5F1A32F9F@collab.nl> I tested with my own compiled Python 2.6.4, which returns: Python 2.6.4 (r264:75706, Dec 22 2009, 21:55:52) [GCC 4.2.1 (Apple Inc. build 5646)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> import platform >>> platform.mac_ver() ('10.6.2', ('', '', ''), 'i386') And Apple's Python: Python 2.6.1 (r261:67515, Jul 7 2009, 23:51:51) [GCC 4.2.1 (Apple Inc. build 5646)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> import platform >>> platform.mac_ver() ('10.6.2', ('', '', ''), 'i386') Haven't tested with py2app. Thijs On 14 Jan 2010, at 02:25, Aahz wrote: > After a lot of poking around, it appears that platform.mac_ver() is > broken in 10.6 (Snow Leopard) because the gestalt module calls fork(), > which causes a crash with > USING_FORK_WITHOUT_EXEC_IS_NOT_SUPPORTED_BY_FILE_MANAGER. This seems to > only happen with py2app builds; I have not been able to reproduce using > strict command-line testing, and I haven't had time to create a > stripped-down app to test with. > > I'd appreciate if someone else could verify before I file a bug. (It's > possible that the multiprocessing module is involved if a simple test > fails to reproduce -- my AppDelegate starts another process for the main > code that then calls mac_ver() to log the current OS version.) I'm using > os.uname() instead for now. > -- > Aahz (aahz at pythoncraft.com) <*> http://www.pythoncraft.com/ > > "If you think it's expensive to hire a professional to do the job, wait > until you hire an amateur." --Red Adair > _______________________________________________ > Pythonmac-SIG maillist - Pythonmac-SIG at python.org > http://mail.python.org/mailman/listinfo/pythonmac-sig From chaz at CPHSolutions.com Fri Jan 15 14:40:22 2010 From: chaz at CPHSolutions.com (Chuck Hauge) Date: Fri, 15 Jan 2010 07:40:22 -0600 Subject: [Pythonmac-SIG] Python Complier In-Reply-To: References: Message-ID: <83E275FF-F6C2-4BE3-A5C8-8C9B1B71D1F9@CPHSolutions.com> Hello ~ I'm quite new to Python, and wanted to compile an app, GNS3 (http://www.gns3.net/download) and have everything running from the Python code. I wanted to make it an executable .app so that I can distribute and make it available to the GNS3 community (this would put the Mac on par with Windows and Linux in regards to high-end Cisco networking emulation). I had found py2app and tried to compile it with that, but bumped into what appears to be a couple issues. I could not find documentation on how to overcome the issues, and am not certain if it is that py2app can not compile the Python, or if I'm missing something. I contact Bob Ippolito who informed me that he no longer supports py2app. If there is a compiler better than py2app I'd greatly appreciate the input, or if someone knows how to get around the issues, assuming there is a way. Here are the issues that came up during the compile: File "/Library/Python/2.6/site-packages/py2app-0.4.3-py2.6.egg/py2app/util.py", line 101, in copy_file zf, zp = path_to_zip(source) File "/Library/Python/2.6/site-packages/py2app-0.4.3-py2.6.egg/py2app/util.py", line 133, in path_to_zip raise DistutilsFileError(path) DistutilsFileError: /private/tmp/GNS3-0.7RC1-src > /Library/Python/2.6/site-packages/py2app-0.4.3-py2.6.egg/py2app/util.py(133)path_to_zip() -> raise DistutilsFileError(path) (Pdb) q Traceback (most recent call last): File "/usr/local/bin/py2applet", line 8, in load_entry_point('py2app==0.4.3', 'console_scripts', 'py2applet')() File "/Library/Python/2.6/site-packages/py2app-0.4.3-py2.6.egg/py2app/script_py2applet.py", line 134, in main build(args, scripts, data_files, options) File "/Library/Python/2.6/site-packages/py2app-0.4.3-py2.6.egg/py2app/script_py2applet.py", line 187, in build target.appdir, AttributeError: 'Target' object has no attribute 'appdir' Thanks, Chaz Hauge -------------- next part -------------- An HTML attachment was scrubbed... URL: From karstenwo at googlemail.com Fri Jan 15 17:08:59 2010 From: karstenwo at googlemail.com (Karsten Wolf) Date: Fri, 15 Jan 2010 17:08:59 +0100 Subject: [Pythonmac-SIG] (no subject) Message-ID: <5C75B3E9-2B7F-4F53-956F-72979AB15FD1@googlemail.com> Hi, I have an application which I created with python 2.5 and py2app on OSX 10.4.11. All is well. Trying to build it with python 2.6.4 and py2app 0.4.3 ends in pdb. python setup.py -A works. Analyzing the code snippet which causes the exception, one can see it calls a unix tool called 'ibtool' which is not present on my system. Seeing that the same tool is used for .xib files my guess is it belongs to Xcode 3.x. What can I do about it (without going to OSX 10.5 and Xcode 3) -karsten In py2app/converters/nibfile.py: p = subprocess.Popen(['ibtool', '--compile', destination, source]) python setup.py py2app: ... creating /Users/karstenwo/python/pyobjc/bildimporter-git/build/ bildimporter.app/Contents/Resources/English.lproj Traceback (most recent call last): File "/Library/Frameworks/Python.framework/Versions/2.6/lib/ python2.6/site-packages/py2app-0.4.3-py2.6.egg/py2app/build_app.py", line 589, in _run self.run_normal() File "/Library/Frameworks/Python.framework/Versions/2.6/lib/ python2.6/site-packages/py2app-0.4.3-py2.6.egg/py2app/build_app.py", line 660, in run_normal self.create_binaries(py_files, pkgdirs, extensions, loader_files) File "/Library/Frameworks/Python.framework/Versions/2.6/lib/ python2.6/site-packages/py2app-0.4.3-py2.6.egg/py2app/build_app.py", line 755, in create_binaries target, arcname, pkgexts, copyexts, target.script) File "/Library/Frameworks/Python.framework/Versions/2.6/lib/ python2.6/site-packages/py2app-0.4.3-py2.6.egg/py2app/build_app.py", line 1180, in build_executable copy_resource(src, dest, dry_run=self.dry_run) File "/Library/Frameworks/Python.framework/Versions/2.6/lib/ python2.6/site-packages/py2app-0.4.3-py2.6.egg/py2app/util.py", line 84, in copy_resource converter(source, destination, dry_run=dry_run) File "/Library/Frameworks/Python.framework/Versions/2.6/lib/ python2.6/site-packages/py2app-0.4.3-py2.6.egg/py2app/converters/ nibfile.py", line 27, in convert_nib p = subprocess.Popen(['ibtool', '--compile', destination, source]) File "/Library/Frameworks/Python.framework/Versions/2.6/lib/ python2.6/subprocess.py", line 621, in __init__ errread, errwrite) File "/Library/Frameworks/Python.framework/Versions/2.6/lib/ python2.6/subprocess.py", line 1126, in _execute_child raise child_exception OSError: [Errno 2] No such file or directory > /Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/ subprocess.py(1126)_execute_child() -> raise child_exception (Pdb) From benthejack at gmail.com Tue Jan 19 00:41:04 2010 From: benthejack at gmail.com (Ben Jack) Date: Tue, 19 Jan 2010 12:41:04 +1300 Subject: [Pythonmac-SIG] Loading bridgesupport files - pyObjC Message-ID: Hi there, I am currently delving into pyObjC, but have been running into some difficulty's with using the bridgesupport files for the framework I am using. I have the basics working using objc selectors for example if I have a delegate function buttonChanged_isPressed_ (int1, int2) : buttonChanged_isPressed_ = objc.selector(buttonChanged_isPressed_, signature='v16 at 0:4i8B12') but It seems to me like this is just restating what the bridgesupport file has already defined (I don't think it is even being properly loaded when I load the framework). I could possibly keep defining these signatures for functions, but my problem is with the low level c structures which aren't understood by python. I have this project working fine in ruby, which reads the bridgesupport file when I load the framework and does all the dirty work as far as creating signatures for me. Essentially what I am asking is, is there any simple way to direct python to the bridgesupport file when I load up the framework, and does this negate the need to specifically create selectors for my delegate functions? cheers, Ben -------------- next part -------------- An HTML attachment was scrubbed... URL: From benthejack at gmail.com Tue Jan 19 01:35:35 2010 From: benthejack at gmail.com (Ben Jack) Date: Tue, 19 Jan 2010 13:35:35 +1300 Subject: [Pythonmac-SIG] Loading bridgesupport files - pyObjC In-Reply-To: References: Message-ID: Well! As per usual, after hours of frustration as soon as I send off an email I discover the answer for myself. For those who are curious there is an objc method objc.parseBridgeSupport which converts xml data to the necessary python objects. so the code looks like this: f = open('/Library/Frameworks/frameworkgoeshere.framework/Versions/A/Resources/BridgeSupport/PyObjC.bridgesupport') objc.parseBridgeSupport(f.read(), globals(),"/Library/Frameworks/frameworkgoeshere.framework") On Tue, Jan 19, 2010 at 12:41 PM, Ben Jack wrote: > Hi there, > I am currently delving into pyObjC, but have been running into some > difficulty's with using the bridgesupport files for the framework I am > using. > I have the basics working using objc selectors for example if I have a > delegate function buttonChanged_isPressed_ (int1, int2) : > buttonChanged_isPressed_ = objc.selector(buttonChanged_isPressed_, > signature='v16 at 0:4i8B12') > > but It seems to me like this is just restating what the bridgesupport file > has already defined (I don't think it is even being properly loaded when I > load the framework). I could possibly keep defining these signatures for > functions, but my problem is with the low level c structures which aren't > understood by python. > > I have this project working fine in ruby, which reads the bridgesupport > file when I load the framework and does all the dirty work as far as > creating signatures for me. > > Essentially what I am asking is, is there any simple way to direct python > to the bridgesupport file when I load up the framework, and does this negate > the need to specifically create selectors for my delegate functions? > > > cheers, > Ben > -------------- next part -------------- An HTML attachment was scrubbed... URL: From aahz at pythoncraft.com Tue Jan 19 02:07:10 2010 From: aahz at pythoncraft.com (Aahz) Date: Mon, 18 Jan 2010 17:07:10 -0800 Subject: [Pythonmac-SIG] Loading bridgesupport files - pyObjC In-Reply-To: References: Message-ID: <20100119010710.GA10222@panix.com> On Tue, Jan 19, 2010, Ben Jack wrote: > > Well! As per usual, after hours of frustration as soon as I send off an > email I discover the answer for myself. Put a teddybear on your desk and explain the problem to it. ;-) -- Aahz (aahz at pythoncraft.com) <*> http://www.pythoncraft.com/ "If you think it's expensive to hire a professional to do the job, wait until you hire an amateur." --Red Adair From wdr1 at pobox.com Tue Jan 19 04:04:24 2010 From: wdr1 at pobox.com (William Reardon) Date: Mon, 18 Jan 2010 19:04:24 -0800 Subject: [Pythonmac-SIG] py-appscript: Rating a Song with Applescript Message-ID: <6f0920651001181904p46b4b76an2a7ed8ac941fc05b@mail.gmail.com> I'm attempting to programmatically rate a song in iTunes. I hacked together the following snippet in Applescript, but after reading the docs, I can't figure out how to convert the "every file..." mechanic to the py-appscript equivalent. Any suggestions? tell application "iTunes" set ts to (every file track of playlist "Library" whose name is track_name and artist is track_artist and album is track_album) repeat with t in ts set rating of t to track_rating end repeat end tell Thanks in advance, -Bill -------------- next part -------------- An HTML attachment was scrubbed... URL: From hengist.podd at virgin.net Tue Jan 19 13:40:27 2010 From: hengist.podd at virgin.net (hengist.podd e-mail) Date: Tue, 19 Jan 2010 12:40:27 +0000 Subject: [Pythonmac-SIG] py-appscript: Rating a Song with Applescript Message-ID: William Reardon wrote: > I'm attempting to programmatically rate a song in iTunes.? I hacked together the following snippet in Applescript, but after reading the docs, I can't figure out how to convert the "every file..." mechanic to the py-appscript equivalent.? Any suggestions? > > tell application "iTunes" > ? set ts to (every file track of playlist "Library" whose name is track_name and artist is track_artist and album is track_album) > ? repeat with t in ts > ??? set rating of t to track_rating > ? end repeat > end tell That can probably tidy up to: tell application "iTunes" set rating of (every file track of library playlist 1 whose name is track_name and artist is track_artist and album is track_album) to track_rating end tell Run it through ASTranslate (with some appropriate values) and clean up the resulting Python code, and you should get this: app(u'iTunes').library_playlists[1].file_tracks[((its.name == track_name).AND(its.artist == track_artist)).AND(its.album == track_album)].rating.set(track_rating) HTH has From georg.seifert at gmx.de Fri Jan 22 20:29:07 2010 From: georg.seifert at gmx.de (Georg Seifert) Date: Fri, 22 Jan 2010 20:29:07 +0100 Subject: [Pythonmac-SIG] shild App against crashes in call of PyRun_SimpleString Message-ID: <196517BB-24CC-4DF3-A1EE-C27D52839705@gmx.de> Hi, What is the best way to protect my app from crashes if something went wrong in a PyRun_SimpleString call. I get (very few) crash reports like the on below. Does someone know what is going on? This happened with 10.6.2. Thanks Georg Application Specific Information: Assertion failed: (autoInterpreterState), function PyGILState_Ensure, file Python/pystate.c, line 577. Thread 0 Crashed: Dispatch queue: com.apple.main-thread 0 libSystem.B.dylib 0x9784d732 __kill + 10 1 libSystem.B.dylib 0x9784d724 kill$UNIX2003 + 32 2 libSystem.B.dylib 0x978e098d raise + 26 3 libSystem.B.dylib 0x978f6a44 abort + 93 4 libSystem.B.dylib 0x978e35ec __pthread_markcancel + 0 5 org.python.python 0x000ebfda PyGILState_Ensure + 66 6 _objc.so 0x12f3c767 PyObjC_encodeWithCoder + 10348 7 com.apple.CoreFoundation 0x9765a528 CFRelease + 152 8 com.apple.CoreFoundation 0x976870ed _CFAutoreleasePoolPop + 253 9 com.apple.Foundation 0x92c37dd6 NSPopAutoreleasePool + 76 10 com.apple.Foundation 0x92c37cfe -[NSAutoreleasePool drain] + 130 11 com.apple.AppKit 0x9497055f -[NSApplication run] + 1013 12 com.apple.AppKit 0x94968535 NSApplicationMain + 574 13 com.GeorgSeifert.Glyphs 0x00002348 main + 24 14 com.GeorgSeifert.Glyphs 0x000022f6 start + 54 From aahz at pythoncraft.com Fri Jan 22 22:37:11 2010 From: aahz at pythoncraft.com (Aahz) Date: Fri, 22 Jan 2010 13:37:11 -0800 Subject: [Pythonmac-SIG] shild App against crashes in call of PyRun_SimpleString In-Reply-To: <196517BB-24CC-4DF3-A1EE-C27D52839705@gmx.de> References: <196517BB-24CC-4DF3-A1EE-C27D52839705@gmx.de> Message-ID: <20100122213711.GA11219@panix.com> On Fri, Jan 22, 2010, Georg Seifert wrote: > > What is the best way to protect my app from crashes if something went > wrong in a PyRun_SimpleString call. > > This happened with 10.6.2. What version of Python? What kind of application? Are you linking to any C libraries? This is clearly a threading issue deep in the C threading code, and there's nothing much you can protect against (it's the functional equivalent of a segfault). -- Aahz (aahz at pythoncraft.com) <*> http://www.pythoncraft.com/ import antigravity From Chris.Barker at noaa.gov Sat Jan 23 00:39:48 2010 From: Chris.Barker at noaa.gov (Christopher Barker) Date: Fri, 22 Jan 2010 15:39:48 -0800 Subject: [Pythonmac-SIG] py2app annoyance Message-ID: <4B5A3744.7090301@noaa.gov> Hi all, I've often gotten errors like: /usr/bin/strip: the __LINKEDIT segment does not cover the end of the file (can't be processed) in: /Users/cbarker/HAZMAT/MappingSVN/Maproom/trunk/dist/Maproom.app/Contents/Frameworks/GDAL.framework/Versions/1.6/Programs/gdaltindex (for architecture ppc) They go away if I blow away the previously built app bundle and run it clean. This isn't too big a deal, but I often forget, and then I stare at it while before I remember what to do about it. Is there a bug tracker for py2app that I could put this in? -Chris -- Christopher Barker, Ph.D. Oceanographer Emergency Response Division NOAA/NOS/OR&R (206) 526-6959 voice 7600 Sand Point Way NE (206) 526-6329 fax Seattle, WA 98115 (206) 526-6317 main reception Chris.Barker at noaa.gov From charles.hartman at conncoll.edu Sat Jan 23 02:06:24 2010 From: charles.hartman at conncoll.edu (Charles Hartman) Date: Fri, 22 Jan 2010 20:06:24 -0500 Subject: [Pythonmac-SIG] py2app annoyance In-Reply-To: <4B5A3744.7090301@noaa.gov> References: <4B5A3744.7090301@noaa.gov> Message-ID: On Jan 22, 2010, at 6:39 PM, Christopher Barker wrote: > Is there a bug tracker for py2app that I could put this in? Your mouth to gods' ears. How much I wish someone had both the expertise (not me that's for sure) and the time to take over what is after all *the only way for ordinary Mac-Python dopes like me to make a distributable application*! Isn't this bad for the Python community, the cause of Python, etc? Or substitute "Mac" in those phrases? From kw at codebykevin.com Sat Jan 23 02:24:32 2010 From: kw at codebykevin.com (Kevin Walzer) Date: Fri, 22 Jan 2010 20:24:32 -0500 Subject: [Pythonmac-SIG] py2app annoyance In-Reply-To: References: <4B5A3744.7090301@noaa.gov> Message-ID: <4B5A4FD0.2070209@codebykevin.com> On 1/22/10 8:06 PM, Charles Hartman wrote: > > Your mouth to gods' ears. How much I wish someone had both the expertise (not me that's for sure) and the time to take over what is after all *the only way for ordinary Mac-Python dopes like me to make a distributable application*! Isn't this bad for the Python community, the cause of Python, etc? Or substitute "Mac" in those phrases? > But it isn't the only way. http://wiki.python.org/moin/MacPython/BundleBuilder I've switched back to BundleBuilder, and it works fine. It takes a bit of trial and error to get everything wrapped up, but I've never understood why people bad-mouthed it so much. It's a single-script module, and reasonably easy to understand, and relatively easy to modify: anyone with a reasonably amount of Python skill can get it working. I just used it today to release a fully 64-bit, four-way universal build of one of my commercial/shareware Python apps. py2app may be more powerful than BundleBuilder, but it is also a complex, fragile beast. It consists of several different packages, requiring both a) a deep understanding of OS X mach-o internals and how libraries/load paths/dyld bits are loaded; and b) a deep understanding of Python internals, i.e. object graphs, etc. It's so complicated that there are only two developers in the Python community that I'm aware of who actually understand it: its original author, Bob Ippolito, who has abandoned it; and the current MacPython maintainer, Ronald Oussoren, who is also the only current maintainer of PyObjC, and who does all this stuff in his spare time. (i.e. he has limited time, and many demands on that time). In other words, py2app is now essentially unmaintained, and is starting to suffer from bit-rot. I certainly don't plan to stake my own development platform on it anymore. This isn't a criticism of anyone. Bob has gone on to bigger and better things as the co-founder of his own company, and Ronald's efforts as MacPython maintainer are absolutely essential: his limited time is focused exactly where it needs to be, on general Python/Mac issues and on PyObjC. However, the absence of a maintainer for py2app is real, and that doesn't portend well for its future. I'd encourage others to take another look at BundleBuilder. It works fine with Python 2.x, and I see no reason why it can't work with Python 3.x, with some modification (it's removed from 3.x). When I move my own platform to Python 3.x in the future, I will likely start a separate BundleBuilder 3.x project. --Kevin -- Kevin Walzer Code by Kevin http://www.codebykevin.com From amorris at mistermorris.com Sat Jan 23 05:42:59 2010 From: amorris at mistermorris.com (Adam Morris) Date: Fri, 22 Jan 2010 23:42:59 -0500 Subject: [Pythonmac-SIG] py2app annoyance In-Reply-To: <4B5A4FD0.2070209@codebykevin.com> References: <4B5A3744.7090301@noaa.gov> <4B5A4FD0.2070209@codebykevin.com> Message-ID: <9b202abc1001222042t747d43f3tbbcb0836dd255be1@mail.gmail.com> > > http://wiki.python.org/moin/MacPython/BundleBuilder I've switched back to BundleBuilder, and it works fine. It takes a bit of trial and error to get everything wrapped up, but I've never understood why people bad-mouthed it so much. It's a single-script module, and reasonably easy to understand, and relatively easy to modify: anyone with a reasonably amount of Python skill can get it working. I just used it today to release a fully 64-bit, four-way universal build of one of my commercial/shareware Python apps. I've clearly come late to the game, as I've never heard of it. I've been using XCode with PyObjC to go over the tutorials, but now I see for distribution I have to use py2app which makes me quake with fear. My app is a relatively simple one that is intended for teachers with no time (including myself here) so this bundlebuilder link is a complete life-line. Thanks! -Adam aka brainysmurf -------------- next part -------------- An HTML attachment was scrubbed... URL: From attila.tajti at gmail.com Mon Jan 25 18:04:09 2010 From: attila.tajti at gmail.com (Attila Tajti) Date: Mon, 25 Jan 2010 18:04:09 +0100 Subject: [Pythonmac-SIG] problem running py2app Message-ID: <86D3A325-7304-4FA8-879D-2E9E906AC47C@gmail.com> Hello, As my first Mac OS X project I am trying to build a sample plugin with py2app. I am following this tutorial: http://eaganj.free.fr/weblog/?post/2009/07/14/Demystifying-Mail.app-Plugins-on-Leopard I do not know what am I doing wrong, but I cannot seem to be able to create my plugin in the first place. python setup.py py2app -A works, but creating a standalong plugin fails. Do you know what is wrong? First I tried with py2app 0.4.3, but now I use svn trunk. python setup.py py2app output: running py2app *** using recipe: virtualenv *** *** filtering dependencies *** 369 total 366 filtered 0 orphaned 3 remaining *** create binaries *** *** byte compile python files *** skipping byte-compilation of /Users/ata/Projects/MailArchiveButton/MyPlugin.py to MyPlugin.pyc byte-compiling /Users/ata/Scrap/py2app/py2app/bootstrap/boot_plugin.py to boot_plugin.pyc byte-compiling /Users/ata/Scrap/py2app/py2app/bootstrap/disable_linecache.py to disable_linecache.pyc *** creating plugin bundle: MyPlugin *** copying MyPlugin.py -> /Users/ata/Projects/MailArchiveButton/dist/MyPlugin.mailbundle/Contents/Resources creating /Users/ata/Projects/MailArchiveButton/dist/MyPlugin.mailbundle/Contents/Resources/lib creating /Users/ata/Projects/MailArchiveButton/dist/MyPlugin.mailbundle/Contents/Resources/lib/python2.6 copying build/bdist.macosx-10.6-universal/python2.6-semi_standalone/app/site-packages.zip -> /Users/ata/Projects/MailArchiveButton/dist/MyPlugin.mailbundle/Contents/Resources/lib/python2.6 creating /Users/ata/Projects/MailArchiveButton/dist/MyPlugin.mailbundle/Contents/Resources/lib/python2.6/lib-dynload creating /Users/ata/Projects/MailArchiveButton/dist/MyPlugin.mailbundle/Contents/Frameworks Traceback (most recent call last): File "/Users/ata/Scrap/py2app/py2app/build_app.py", line 589, in _run self.run_normal() File "/Users/ata/Scrap/py2app/py2app/build_app.py", line 660, in run_normal self.create_binaries(py_files, pkgdirs, extensions, loader_files) File "/Users/ata/Scrap/py2app/py2app/build_app.py", line 777, in create_binaries platfiles = mm.run() File "build/bdist.macosx-10.6-universal/egg/macholib/MachOStandalone.py", line 101, in run for fn in platfiles: File "build/bdist.macosx-10.6-universal/egg/macholib/util.py", line 227, in iter_platform_files if is_platform_file(fn): File "build/bdist.macosx-10.6-universal/egg/macholib/util.py", line 206, in is_platform_file header = mach_o.fat_header.from_fileobj(fileobj, _endian_='>') File "build/bdist.macosx-10.6-universal/egg/macholib/ptypes.py", line 44, in from_fileobj return cls.from_str(f.read(cls._size_), **kw) File "build/bdist.macosx-10.6-universal/egg/macholib/ptypes.py", line 48, in from_str return cls.from_tuple(struct.unpack(endian + cls._format_, s), **kw) error: unpack requires a string argument of length 8 > /Users/ata/Projects/MailArchiveButton/build/bdist.macosx-10.6-universal/egg/macholib/ptypes.py(48)from_str() (Pdb) ^D setup.py: from distutils.core import setup import py2app plist = dict( NSPrincipalClass='MyPlugin', CFBundleVersion='1', SupportedPluginCompatibilityUUIDs=[ '225E0A48-2CDB-44A6-8D99-A9BB8AF6BA04', 'B3F3FC72-315D-4323-BE85-7AB76090224D', '2610F061-32C6-4C6B-B90A-7A3102F9B9C8', '99BB3782-6C16-4C6F-B910-25ED1C1CB38B', '2F0CF6F9-35BA-4812-9CB2-155C0FDB9B0F', '0CB5F2A0-A173-4809-86E3-9317261F1745' ] ) setup( plugin = ['MyPlugin.py'], options=dict(py2app=dict(extension='.mailbundle', plist=plist)) ) myplugin.py: from AppKit import * from Foundation import * import objc MVMailBundle = objc.lookUpClass('MVMailBundle') class MyPlugin(MVMailBundle): @classmethod def initialize (cls): cls.registerBundle() NSLog("MyPlugin registered with Mail") initialize = classmethod(initialize) -- Attila -------------- next part -------------- An HTML attachment was scrubbed... URL: From Chris.Barker at noaa.gov Mon Jan 25 19:52:26 2010 From: Chris.Barker at noaa.gov (Christopher Barker) Date: Mon, 25 Jan 2010 10:52:26 -0800 Subject: [Pythonmac-SIG] py2app annoyance In-Reply-To: <4B5A4FD0.2070209@codebykevin.com> References: <4B5A3744.7090301@noaa.gov> <4B5A4FD0.2070209@codebykevin.com> Message-ID: <4B5DE86A.9070100@noaa.gov> Kevin Walzer wrote: > py2app may be more powerful than BundleBuilder, but it is also a > complex, fragile beast. It consists of several different packages, > requiring both a) a deep understanding of OS X mach-o internals and how > libraries/load paths/dyld bits are loaded; I'm a bit confused by this -- how does bundle builder to it in a way that doesn't require this knowledge? > In other words, py2app is now essentially unmaintained, and is starting > to suffer from bit-rot. The fact that it has worked better for you doesn't necessarily mean that it is more robust or more maintainable (though having tried to dig into the Py2app code a couple times, I agree that it is a challenge!). But Ronald sees to think there are real advantages to py2app, and he would know. I have no horse in this race -- like most of us, I just want something that works. Are you offering to maintain BundleBuilder? I"ll take somthing actively maintained over something that isn't. Note that modulegraph is being used by bbfreeze as well, so it's not completely unmaintained. I still wish that the was more unification among all the executable builders, it does seem to be a waste of energy to have so much stuff repeated. If only I had more time for this stuff! -Chris -- Christopher Barker, Ph.D. Oceanographer Emergency Response Division NOAA/NOS/OR&R (206) 526-6959 voice 7600 Sand Point Way NE (206) 526-6329 fax Seattle, WA 98115 (206) 526-6317 main reception Chris.Barker at noaa.gov From dwf at cs.toronto.edu Mon Jan 25 22:55:56 2010 From: dwf at cs.toronto.edu (David Warde-Farley) Date: Mon, 25 Jan 2010 16:55:56 -0500 Subject: [Pythonmac-SIG] pyopencl In-Reply-To: References: <9438d60d1001090630i55a63d62k60781fe074b2fd0f@mail.gmail.com> Message-ID: <0A26BFB6-7766-49BF-B76C-B3C26C2B1792@cs.toronto.edu> On 9-Jan-10, at 12:10 PM, Markus Mohr wrote: > Has someone used any of these? A recomendation perhaps? pyopencl ( http://mathema.tician.de/software/pyopencl ) seems to be the most mature and is very similar to PyCUDA which the same author wrote. It however requires boost; I haven't compiled it on OS X but I've compiled other projects that use boost and it can be a pain I have played around with pyopencl on Linux and found it to be quite usable. David From attila.tajti at gmail.com Tue Jan 26 04:20:33 2010 From: attila.tajti at gmail.com (Attila Tajti) Date: Tue, 26 Jan 2010 04:20:33 +0100 Subject: [Pythonmac-SIG] patch: make --app and --plugin work Message-ID: <843E6374-428B-40E8-BB58-5210271DE9F0@gmail.com> Hello, I restarted my project from stratch starting with py2applet --make-setup and found that the --app and --plugin switches do not work. Without an argument they will be set to True. This will cause problems but py2applet --help is specific enough on this so I could figure out it needs an argument (at first I thought these are actually boolean options to select either an app or plugin to be built, but in fact they need an argument as the app/plugin name). The real problem however they do not work with an argument either, because build_app.py needs an argument here that is a list, so it will end up converting the string to list and ultimately fail. Anyway I attached a patch that fixes this problem, along with a typo ("puglin" -> "plugin"). p.s.: apparently these options worked when initially added on 2007-08-29 but later they were (perhaps accidentally) removed on 2008-01-06. p.s.2.: perhaps it would be nicer to handle the fact --app and --plugin arguments are strings in another place (ie. outside FixupTargets). I would be glad to do that upon request. Theoretically the best way to do it would be to expect only strings as "app" and "plugin" and it would work in py2applet --make-setup well, but in practice they could break existing setup.py scripts created earlier. -- Attila -------------- next part -------------- A non-text attachment was scrubbed... Name: patch1.patch Type: application/octet-stream Size: 802 bytes Desc: not available URL: From ronaldoussoren at mac.com Tue Jan 26 11:52:56 2010 From: ronaldoussoren at mac.com (Ronald Oussoren) Date: Tue, 26 Jan 2010 11:52:56 +0100 Subject: [Pythonmac-SIG] py2app annoyance In-Reply-To: <4B5A3744.7090301@noaa.gov> References: <4B5A3744.7090301@noaa.gov> Message-ID: On 23 Jan, 2010, at 0:39, Christopher Barker wrote: > Hi all, > > I've often gotten errors like: > > > /usr/bin/strip: the __LINKEDIT segment does not cover the end of the file (can't be processed) in: /Users/cbarker/HAZMAT/MappingSVN/Maproom/trunk/dist/Maproom.app/Contents/Frameworks/GDAL.framework/Versions/1.6/Programs/gdaltindex (for architecture ppc) > > > > They go away if I blow away the previously built app bundle and run it clean. > > This isn't too big a deal, but I often forget, and then I stare at it while before I remember what to do about it. > > Is there a bug tracker for py2app that I could put this in? Feel free to use the pyobjc one at SF for this. Ronald -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 3567 bytes Desc: not available URL: From ronaldoussoren at mac.com Tue Jan 26 12:17:44 2010 From: ronaldoussoren at mac.com (Ronald Oussoren) Date: Tue, 26 Jan 2010 12:17:44 +0100 Subject: [Pythonmac-SIG] py2app annoyance In-Reply-To: <4B5DE86A.9070100@noaa.gov> References: <4B5A3744.7090301@noaa.gov> <4B5A4FD0.2070209@codebykevin.com> <4B5DE86A.9070100@noaa.gov> Message-ID: <25B93D41-F730-4F5B-97AF-4503F28CCE09@mac.com> On 25 Jan, 2010, at 19:52, Christopher Barker wrote: > Kevin Walzer wrote: >> py2app may be more powerful than BundleBuilder, but it is also a complex, fragile beast. It consists of several different packages, requiring both a) a deep understanding of OS X mach-o internals and how libraries/load paths/dyld bits are loaded; > > I'm a bit confused by this -- how does bundle builder to it in a way that doesn't require this knowledge? > >> In other words, py2app is now essentially unmaintained, and is starting to suffer from bit-rot. > > > The fact that it has worked better for you doesn't necessarily mean that it is more robust or more maintainable (though having tried to dig into the Py2app code a couple times, I agree that it is a challenge!). The codebase for py2app is incomprehensible at times, although that is partially caused by external contraints (distutils and the attempt to mirror py2exe's interface). It is all python code though and it should therefore be possible to clean it up without diving into C. > > But Ronald sees to think there are real advantages to py2app, and he would know. I prefer py2app over bundlebuilder, mostly because py2app can create standalone application without my specifying each and every file that needs to be included. > > I have no horse in this race -- like most of us, I just want something that works. > > Are you offering to maintain BundleBuilder? I"ll take somthing actively maintained over something that isn't. > > Note that modulegraph is being used by bbfreeze as well, so it's not completely unmaintained. > > I still wish that the was more unification among all the executable builders, it does seem to be a waste of energy to have so much stuff repeated. > > If only I had more time for this stuff! What bugs my most about py2app discussions on this list is that there are too many people that complain and yet no-one seems to be inclined to do anything. Ronald -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 3567 bytes Desc: not available URL: From kw at codebykevin.com Tue Jan 26 15:45:42 2010 From: kw at codebykevin.com (Kevin Walzer) Date: Tue, 26 Jan 2010 09:45:42 -0500 Subject: [Pythonmac-SIG] py2app annoyance In-Reply-To: <4B5DE86A.9070100@noaa.gov> References: <4B5A3744.7090301@noaa.gov> <4B5A4FD0.2070209@codebykevin.com> <4B5DE86A.9070100@noaa.gov> Message-ID: <4B5F0016.3000201@codebykevin.com> On 1/25/10 1:52 PM, Christopher Barker wrote: > Kevin Walzer wrote: >> py2app may be more powerful than BundleBuilder, but it is also a >> complex, fragile beast. It consists of several different packages, >> requiring both a) a deep understanding of OS X mach-o internals and >> how libraries/load paths/dyld bits are loaded; > > I'm a bit confused by this -- how does bundle builder to it in a way > that doesn't require this knowledge? If I understand the code correctly, it uses modulefinder, which doesn't seem to work as well as the modulegraph stuff that py2app uses. > > The fact that it has worked better for you doesn't necessarily mean that > it is more robust or more maintainable (though having tried to dig into > the Py2app code a couple times, I agree that it is a challenge!). It isn't more robust. I never claimed that. It may be more maintainable simply because it's a smaller code base--at least, I can grok its internals a bit better. And "works for me" is better than "doesn't work for me and I don't know how to fix it." > > But Ronald sees to think there are real advantages to py2app, and he > would know. He mentioned that bundlebuilder requires you to specify every file that you include. That's not entirely true, but modulefinder is less effective at picking up dependencies than modulegraph, and you do have to do more trial and error with your builds. I believe that was the main complaint in the past. > > Are you offering to maintain BundleBuilder? I"ll take somthing actively > maintained over something that isn't. It doesn't need an active maintainer for Python 2.x because it's in the standard library, and shouldn't require any tweaking of build scripts that make use of it unless you're trying to build a 64-bit version of your app. (Argvemulator isn't supported in 64-bit because it's part of Carbon.) When I move my code base to Python 3.x, which won't happen until all the libraries I need are ported to work with 3.x, I will look at setting up a separate bundlebuilder project somewhere. > > Note that modulegraph is being used by bbfreeze as well, so it's not > completely unmaintained. > > I still wish that the was more unification among all the executable > builders, it does seem to be a waste of energy to have so much stuff > repeated. bbfreeze and pyinstaller have no constituency on the Mac right now--their Mac support is alpha-level at best. So I don't consider them to be part of the mix. --Kevin -- Kevin Walzer Code by Kevin http://www.codebykevin.com From kw at codebykevin.com Tue Jan 26 15:57:04 2010 From: kw at codebykevin.com (Kevin Walzer) Date: Tue, 26 Jan 2010 09:57:04 -0500 Subject: [Pythonmac-SIG] py2app annoyance In-Reply-To: <25B93D41-F730-4F5B-97AF-4503F28CCE09@mac.com> References: <4B5A3744.7090301@noaa.gov> <4B5A4FD0.2070209@codebykevin.com> <4B5DE86A.9070100@noaa.gov> <25B93D41-F730-4F5B-97AF-4503F28CCE09@mac.com> Message-ID: <4B5F02C0.8060105@codebykevin.com> On 1/26/10 6:17 AM, Ronald Oussoren wrote: > > The codebase for py2app is incomprehensible at times, although that is partially caused by external contraints (distutils and the attempt to mirror py2exe's interface). It is all python code though and it should therefore be possible to clean it up without diving into C. > I ran into difficulties with macholib. I didn't understand how to fix error messages like this: > error: unpack requires a string argument of length 32 > /opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/macholib/ptypes.py(48)from_str() -> return cls.from_tuple(struct.unpack(endian + cls._format_, s), **kw) I tried to isolate what was going on, but nothing I tried worked. Eventually I gave up. >> But Ronald sees to think there are real advantages to py2app, and he would know. > > I prefer py2app over bundlebuilder, mostly because py2app can create standalone application without my specifying each and every file that needs to be included. Bundlebuilder is more work in this respect, that's true. >> >> If only I had more time for this stuff! > > What bugs my most about py2app discussions on this list is that there are too many people that complain and yet no-one seems to be inclined to do anything. > Ronald, did you see the patches included in this message? http://mail.python.org/pipermail/pythonmac-sig/2009-December/021998.html These may solve some of the issues that others have been reporting. I encouraged the author of these patches to send them to you. (They didn't solve my own issues with py2app, which continues to report "New Mach-O header is too large to relocate" even after the patches. According to notes from Bob Ippolito in the list archives, the only solution here may be to recompile Tcl/Tk with different headerpad flags, which I don't have time to do.) --Kevin -- Kevin Walzer Code by Kevin http://www.codebykevin.com From ronaldoussoren at mac.com Wed Jan 27 07:09:43 2010 From: ronaldoussoren at mac.com (Ronald Oussoren) Date: Wed, 27 Jan 2010 07:09:43 +0100 Subject: [Pythonmac-SIG] py2app annoyance In-Reply-To: <4B5F02C0.8060105@codebykevin.com> References: <4B5A3744.7090301@noaa.gov> <4B5A4FD0.2070209@codebykevin.com> <4B5DE86A.9070100@noaa.gov> <25B93D41-F730-4F5B-97AF-4503F28CCE09@mac.com> <4B5F02C0.8060105@codebykevin.com> Message-ID: <0DEBF885-3B8C-49C2-BED0-483DF80C0ED0@mac.com> On 26 Jan, 2010, at 15:57, Kevin Walzer wrote: > On 1/26/10 6:17 AM, Ronald Oussoren wrote: >> >> The codebase for py2app is incomprehensible at times, although that is partially caused by external contraints (distutils and the attempt to mirror py2exe's interface). It is all python code though and it should therefore be possible to clean it up without diving into C. >> > I ran into difficulties with macholib. I didn't understand how to fix error messages like this: > > > error: unpack requires a string argument of length 32 > > /opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/macholib/ptypes.py(48)from_str() > -> return cls.from_tuple(struct.unpack(endian + cls._format_, s), **kw) > > I tried to isolate what was going on, but nothing I tried worked. Eventually I gave up. Adding print statements has enabled me to fix al issues in macholib that I ran into myself. > > >>> But Ronald sees to think there are real advantages to py2app, and he would know. >> >> I prefer py2app over bundlebuilder, mostly because py2app can create standalone application without my specifying each and every file that needs to be included. > > Bundlebuilder is more work in this respect, that's true. > >>> >>> If only I had more time for this stuff! >> >> What bugs my most about py2app discussions on this list is that there are too many people that complain and yet no-one seems to be inclined to do anything. >> > > Ronald, did you see the patches included in this message? > > http://mail.python.org/pipermail/pythonmac-sig/2009-December/021998.html > > These may solve some of the issues that others have been reporting. I encouraged the author of these patches to send them to you. > > (They didn't solve my own issues with py2app, which continues to report "New Mach-O header is too large to relocate" even after the patches. According to notes from Bob Ippolito in the list archives, the only solution here may be to recompile Tcl/Tk with different headerpad flags, which I don't have time to do.) I did see the patches but haven't had time yet to get them into the repository. The py2app patches require remodeling, but now that I look at the patches again I notice that the modulegraph does not and I have applied that patch in r32. Ronald -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 3567 bytes Desc: not available URL: From ronaldoussoren at mac.com Wed Jan 27 07:17:10 2010 From: ronaldoussoren at mac.com (Ronald Oussoren) Date: Wed, 27 Jan 2010 07:17:10 +0100 Subject: [Pythonmac-SIG] py2app annoyance In-Reply-To: <4B5F0016.3000201@codebykevin.com> References: <4B5A3744.7090301@noaa.gov> <4B5A4FD0.2070209@codebykevin.com> <4B5DE86A.9070100@noaa.gov> <4B5F0016.3000201@codebykevin.com> Message-ID: <866BCD40-A893-4F97-9D71-23D9A44DDD53@mac.com> On 26 Jan, 2010, at 15:45, Kevin Walzer wrote: > On 1/25/10 1:52 PM, Christopher Barker wrote: >> Kevin Walzer wrote: >>> py2app may be more powerful than BundleBuilder, but it is also a >>> complex, fragile beast. It consists of several different packages, >>> requiring both a) a deep understanding of OS X mach-o internals and >>> how libraries/load paths/dyld bits are loaded; The bit that requires mach-o understanding is part that copies C libraries into a standalone bundle and that's hardly the most important bit of py2app. It needs some more care to deal with 64-bit binaries (appearently), but for the most part just works. >> >> I'm a bit confused by this -- how does bundle builder to it in a way >> that doesn't require this knowledge? > > If I understand the code correctly, it uses modulefinder, which doesn't seem to work as well as the modulegraph stuff that py2app uses. IIRC modulefinder isn't as good as modulegraph at calculating the depedency graph. Modulefinder definitely does nothing with depedencies of C code. > >> >> The fact that it has worked better for you doesn't necessarily mean that >> it is more robust or more maintainable (though having tried to dig into >> the Py2app code a couple times, I agree that it is a challenge!). > > It isn't more robust. I never claimed that. It may be more maintainable simply because it's a smaller code base--at least, I can grok its internals a bit better. And "works for me" is better than "doesn't work for me and I don't know how to fix it." > >> >> But Ronald sees to think there are real advantages to py2app, and he >> would know. > > He mentioned that bundlebuilder requires you to specify every file that you include. That's not entirely true, but modulefinder is less effective at picking up dependencies than modulegraph, and you do have to do more trial and error with your builds. I believe that was the main complaint in the past. > >> >> Are you offering to maintain BundleBuilder? I"ll take somthing actively >> maintained over something that isn't. > > It doesn't need an active maintainer for Python 2.x because it's in the standard library, and shouldn't require any tweaking of build scripts that make use of it unless you're trying to build a 64-bit version of your app. (Argvemulator isn't supported in 64-bit because it's part of Carbon.) When I move my code base to Python 3.x, which won't happen until all the libraries I need are ported to work with 3.x, I will look at setting up a separate bundlebuilder project somewhere. > >> >> Note that modulegraph is being used by bbfreeze as well, so it's not >> completely unmaintained. It isn't completely unmaintained without bbfreeze as well. I fix issues that I run into and hope to enhance it with egg support in the future. In fact, the usage of modulegraph by bbfreeze isn't "maintance" at all, they ship a modified copy of modulegraph. >> >> I still wish that the was more unification among all the executable >> builders, it does seem to be a waste of energy to have so much stuff >> repeated. > > bbfreeze and pyinstaller have no constituency on the Mac right now--their Mac support is alpha-level at best. So I don't consider them to be part of the mix. > > --Kevin > > -- > Kevin Walzer > Code by Kevin > http://www.codebykevin.com > _______________________________________________ > Pythonmac-SIG maillist - Pythonmac-SIG at python.org > http://mail.python.org/mailman/listinfo/pythonmac-sig -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 3567 bytes Desc: not available URL: From markus at johalla.de Wed Jan 27 15:36:06 2010 From: markus at johalla.de (Markus Mohr) Date: Wed, 27 Jan 2010 15:36:06 +0100 Subject: [Pythonmac-SIG] pyopencl In-Reply-To: <0A26BFB6-7766-49BF-B76C-B3C26C2B1792@cs.toronto.edu> References: <9438d60d1001090630i55a63d62k60781fe074b2fd0f@mail.gmail.com> <0A26BFB6-7766-49BF-B76C-B3C26C2B1792@cs.toronto.edu> Message-ID: <6EBD7F82-986A-47A9-9E0E-99D4A9E1F693@johalla.de> > pyopencl ( http://mathema.tician.de/software/pyopencl ) seems to be > the most mature and is very similar to PyCUDA which the same author > wrote. It however requires boost; I haven't compiled it on OS X but > I've compiled other projects that use boost and it can be a pain > Thats what I've installed in the end. Only problem was, as you said, boost which linked against the system python. I got competent help from the mailing list and now it works. I haven't done any real work with it yet but it looks quite accesible. Markus From dwf at cs.toronto.edu Wed Jan 27 22:21:53 2010 From: dwf at cs.toronto.edu (David Warde-Farley) Date: Wed, 27 Jan 2010 16:21:53 -0500 Subject: [Pythonmac-SIG] pyopencl In-Reply-To: <6EBD7F82-986A-47A9-9E0E-99D4A9E1F693@johalla.de> References: <9438d60d1001090630i55a63d62k60781fe074b2fd0f@mail.gmail.com> <0A26BFB6-7766-49BF-B76C-B3C26C2B1792@cs.toronto.edu> <6EBD7F82-986A-47A9-9E0E-99D4A9E1F693@johalla.de> Message-ID: On 27-Jan-10, at 9:36 AM, Markus Mohr wrote: >> pyopencl ( http://mathema.tician.de/software/pyopencl ) seems to be >> the most mature and is very similar to PyCUDA which the same author >> wrote. It however requires boost; I haven't compiled it on OS X but >> I've compiled other projects that use boost and it can be a pain >> > Thats what I've installed in the end. Only problem was, as you said, > boost which linked against the system python. I got competent help > from the mailing list and now it works. Ah yes, I remember having to relink the libboost_python dylib to the Python.org Python binary with install_name_tool. Pain in the neck. David From kw at codebykevin.com Thu Jan 28 04:17:06 2010 From: kw at codebykevin.com (Kevin Walzer) Date: Wed, 27 Jan 2010 22:17:06 -0500 Subject: [Pythonmac-SIG] Interesting article on 64-bit py2app Message-ID: <4B6101B2.4070507@codebykevin.com> Looks like someone has made some progress with a 64-bit-supporting version of py2app http://www.hardcoded.net/articles/building-64-bit-pyobjc-applications-with-py2app.htm And here are his source trees: http://hg.hardcoded.net/py2app/ http://hg.hardcoded.net/macholib/ (I have not tested these in any way, so use at your own risk...) -- Kevin Walzer Code by Kevin http://www.codebykevin.com From manimol at gmail.com Thu Jan 28 21:23:34 2010 From: manimol at gmail.com (Manisha Pednekar) Date: Thu, 28 Jan 2010 14:23:34 -0600 Subject: [Pythonmac-SIG] pytesser test fails on Mac leopard with python 3.1 installed Message-ID: <7e5a828c1001281223n738432clcbc91835e2cc2f60@mail.gmail.com> Hello, It's showing import error, not executing "from pytesser import *" command. First i thought its giving error because it need some variable values. So i tried to execute the following test commads given on Assignment One page. Here is the log: manisha-macbook:Downloads Manisha$ cd pytesser_v0.0.1 manisha-macbook:pytesser_v0.0.1 Manisha$ python3.1 Python 3.1.1 (r311:74543, Aug 24 2009, 18:44:04) [GCC 4.0.1 (Apple Inc. build 5493)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> from pytesser import * Traceback (most recent call last): File "", line 1, in File "pytesser.py", line 77 print text ^ SyntaxError: invalid syntax >>> x=image_file_to_string('phototest.tif') Traceback (most recent call last): File "", line 1, in NameError: name 'image_file_to_string' is not defined >>> print x File "", line 1 print x ^ SyntaxError: invalid syntax >>> pytesser Traceback (most recent call last): File "", line 1, in NameError: name 'pytesser' is not defined >>> tesseract Traceback (most recent call last): File "", line 1, in NameError: name 'tesseract' is not defined >>> tesseract.exe Traceback (most recent call last): File "", line 1, in NameError: name 'tesseract' is not defined >>> pytesser.pyc Traceback (most recent call last): File "", line 1, in NameError: name 'pytesser' is not defined manisha-macbook:pytesser_v0.0.1 Manisha$ tesseract.exe -bash: tesseract.exe: command not found manisha-macbook:pytesser_v0.0.1 Manisha$ pytesser.pyc -bash: pytesser.pyc: command not found manisha-macbook:pytesser_v0.0.1 Manisha$ tesseract -bash: tesseract: command not found manisha-macbook:pytesser_v0.0.1 Manisha$ pytesser -bash: pytesser: command not found manisha-macbook:pytesser_v0.0.1 Manisha$ readme -bash: readme: command not found Kind regards Manisha -------------- next part -------------- An HTML attachment was scrubbed... URL: From nad at acm.org Fri Jan 29 02:35:14 2010 From: nad at acm.org (Ned Deily) Date: Thu, 28 Jan 2010 17:35:14 -0800 Subject: [Pythonmac-SIG] pytesser test fails on Mac leopard with python 3.1 installed References: <7e5a828c1001281223n738432clcbc91835e2cc2f60@mail.gmail.com> Message-ID: In article <7e5a828c1001281223n738432clcbc91835e2cc2f60 at mail.gmail.com>, Manisha Pednekar wrote: > It's showing import error, not executing "from pytesser import *" > command. First i thought its giving error because it need some > variable values. So i tried to execute the following test commads > given on Assignment One page. > > Here is the log: > > manisha-macbook:Downloads Manisha$ cd pytesser_v0.0.1 > manisha-macbook:pytesser_v0.0.1 Manisha$ python3.1 > Python 3.1.1 (r311:74543, Aug 24 2009, 18:44:04) > [GCC 4.0.1 (Apple Inc. build 5493)] on darwin > Type "help", "copyright", "credits" or "license" for more information. > >>> from pytesser import * > > Traceback (most recent call last): > File "", line 1, in > File "pytesser.py", line 77 > print text > ^ > SyntaxError: invalid syntax > [...] The facts that it is using Python 2 syntax (in Python 3, print is not a statement anymore, rather it's a function) plus that the last release date from the code.google.com project page is from 2007 are both pretty good clues that the package has not been updated to support Python 3. Type installing it with Python 2.6. -- Ned Deily, nad at acm.org From Chris.Barker at noaa.gov Fri Jan 29 23:47:09 2010 From: Chris.Barker at noaa.gov (Christopher Barker) Date: Fri, 29 Jan 2010 14:47:09 -0800 Subject: [Pythonmac-SIG] Interesting article on 64-bit py2app In-Reply-To: <4B6101B2.4070507@codebykevin.com> References: <4B6101B2.4070507@codebykevin.com> Message-ID: <4B63656D.1000304@noaa.gov> Kevin Walzer wrote: > Looks like someone has made some progress with a 64-bit-supporting > version of py2app > > http://www.hardcoded.net/articles/building-64-bit-pyobjc-applications-with-py2app.htm Thanks for the link... I sure wish we could get folks like that on this list, and contributing patches! -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 From morrisbrown94 at gmail.com Sat Jan 30 19:09:14 2010 From: morrisbrown94 at gmail.com (Lawrence Anderson) Date: Sat, 30 Jan 2010 13:09:14 -0500 Subject: [Pythonmac-SIG] Unsubscribe. Message-ID: Please Unsubscribe me. Thank you. -- Lawrence Anderson Jr. -------------- next part -------------- An HTML attachment was scrubbed... URL: From aahz at pythoncraft.com Sat Jan 30 19:57:01 2010 From: aahz at pythoncraft.com (Aahz) Date: Sat, 30 Jan 2010 10:57:01 -0800 Subject: [Pythonmac-SIG] Unsubscribe. In-Reply-To: References: Message-ID: <20100130185701.GA27980@panix.com> On Sat, Jan 30, 2010, Lawrence Anderson wrote: > > Please Unsubscribe me. Thank you. > > _______________________________________________ > Pythonmac-SIG maillist - Pythonmac-SIG at python.org > http://mail.python.org/mailman/listinfo/pythonmac-sig See this .sig? It contains all the info you need to unsub. -- Aahz (aahz at pythoncraft.com) <*> http://www.pythoncraft.com/ import antigravity