From woklist at kyngchaos.com Sun Jun 1 17:23:30 2008 From: woklist at kyngchaos.com (William Kyngesburye) Date: Sun, 1 Jun 2008 10:23:30 -0500 Subject: [Pythonmac-SIG] 64-bit Python? In-Reply-To: References: <302611.62100.qm@web52111.mail.re2.yahoo.com> Message-ID: <6D7FB3D2-1E11-4954-8EE8-C86879B8A366@kyngchaos.com> On May 29, 2008, at 5:13 PM, Boyd Waters wrote: > The MacPorts 2.5.2 doesn't have my 64-bit hacks in it. Are there any changes needed to the python executable binary to support 64bits? I compiled a quick 64bit python executable as a companion to the system's Python like so: gcc -arch x86_64 -arch ppc64 -I/System/Library/Frameworks/ Python.framework/Headers -lpython2.5 -o python64 Modules/python.c Tested OK with gdal-python. sys.maxint gives the 64bit value. > ----- William Kyngesburye http://www.kyngchaos.com/ First Pogril: Why is life like sticking your head in a bucket filled with hyena offal? Second Pogril: I don't know. Why IS life like sticking your head in a bucket filled with hyena offal? First Pogril: I don't know either. Wretched, isn't it? -HitchHiker's Guide to the Galaxy From mailing-lists-1001 at anthonykozar.net Sun Jun 1 18:39:22 2008 From: mailing-lists-1001 at anthonykozar.net (Anthony Kozar) Date: Sun, 01 Jun 2008 12:39:22 -0400 Subject: [Pythonmac-SIG] Trouble installing Tkinter with 2.3.5/10.2 In-Reply-To: Message-ID: Hello again, I want to thank everyone for their responses on this issue -- I appreciate the help! I did get Python 2.3.7 with Tkinter to build on my 10.2 machine and it was incredibly straightforward. (I forgot to install WASTE, so the IDE did not build, but that's OK for now). More comments below, but that is the gist of this message :) Anthony Kozar mailing-lists-1001 AT anthonykozar DOT net http://anthonykozar.net/ Ronald Oussoren wrote on 5/21/08 4:49 PM: > On 21 May, 2008, at 5:00, Anthony Kozar wrote: > >> I would also just upgrade my 10.2 machine to a newer >> Python but all of the 2.4 and 2.5 binary distributions appear to >> require >> 10.3. Is this correct? > > That's correct, they require OSX 10.3.9 or later. There are two major > reasons for that: first of all building universal binaries that > support OSX 10.2 is much more involved than limiting support to > 10.3.9 and later, and furthermore I don't have hardware that's capable > of running 10.2 and therefore could not even test such a build if I > did create it. You may not be able to test the 10.2 support, but a 10.2 build should run fine on later OS versions. But I understand that not having a test machine is a good reason for not supporting older OSes :) > You might have success in building a framework for OSX 10.2 from > source. I don't think anyone has tried to do that for a while, but I > see no reason why that shouldn't work (or could be made to work). The 2.3.7 build I did is a framework. I may try compiling 2.4 or 2.5 on 10.2 in the future unless I upgrade my OS before then (which now seems likely). >> So I am wondering what my options are now for cross-platform GUI >> development with Python on 10.2? > I'd drop support for 10.2. OSX 10.2 is very ancient and Xcode > doesn't even ship with an 10.2 SDK these days Christopher Barker wrote on 5/21/08 2:33 PM: > IIRC, Tk didn't work all that well back then, anyway, do you need to use > Tk? (wxPython never worked on OS-9, though). > > This is an awful lot of work to support a pretty old OS though.... Kevin Walzer wrote on 5/21/08 1:42 PM: > In this case, the platform you are supporting is considered by the > community to be obsolete, and no effort is made to support it with > current binary packages. Your only option, apparently, is to build from > source. I am sorry but not surprised I suppose that so many people feel that 10.2 is "very ancient", "pretty old", or "obsolete". I bought the computer running 10.2 only 5-1/2 years ago. Sure it could run 10.5, but I long ago decided that I did not want to play Apple's "upgrade game" anymore. My Beige G3 can only run up to 10.2 but it is more comfortable running OS 9. These computers satisfy most of my needs quite well. I will point out that AFAICT, the Windows installers for Python 2.5 support Windows 95. The equivalent Mac OS version (timewise) would be System 7.5! Just last year, I completed the Carbonization of a fairly large program. The program now runs on MacOS 7, 8, 9, and 10.2 through at least 10.4 (I assume 10.5 will work too -- the only reason it does not support 10.0 or 10.1 is because CoreMIDI is not functional in those versions). This is probably a specialized case, but it was not too difficult to maintain support for System 7 in this program. Before anyone gets upset by these comments, none of this is intended as a criticism. I am merely griping about the state of Mac development because I have been rather frustrated the last couple of weeks trying to get several open-source programs running on my 10.2 machine. I do understand that the MacPython development team is probably much smaller than the Windows team. And the Mac OS and platform have undergone several very significant changes during the last 13 years and Apple makes it much more difficult to support older systems than Microsoft does. In fact, I think the blame lies with Apple due to the pace of their OS releases and their attitude that anything older than 2-3 years is not worth supporting. I am just continually saddened to see so many developers (especially for open-source projects) who either adopt this attitude or are forced to support only recent systems by the circumstances thrust upon them. > Any reason you have to support 10.2, apart from the fact that it's what > your machine runs? The user base for 10.2 is negligible. I have been asked by a potential client to write a GUI for a cross-platform program written in Python. The request was to support "all platforms" that the underlying program itself will run on. That program has an interactive commandline-like interface and is 100% pure Python, requiring only Python 2.3 to run. It is distributed for Windows, Linux, Mac OS X, and even Mac OS 9. The Python 2.3 minimum thus includes OS X 10.2 as a potential target for the GUI. I've already informed the client that OS 9 support is unlikely. I suppose that 10.2 support may be iffy if I have to upgrade to complete the project. Maybe there are not many 10.2 users left. But I still frequently hear from people who are "just now" giving up their OS 9 machines for something newer. It would be interesting to see some real numbers for how many 10.2 users there are. Sorry for the long "rant". MacPython is a great piece of software and I appreciated the help getting Tkinter working on 10.2. Unfortunately, other tools that I was hoping to use on this project (such as Guib, the successor to SpecTcl) are proving to be much more difficult to install on 10.2 than Tkinter was. Thanks again! Anthony From kw at codebykevin.com Sun Jun 1 22:52:44 2008 From: kw at codebykevin.com (Kevin Walzer) Date: Sun, 01 Jun 2008 16:52:44 -0400 Subject: [Pythonmac-SIG] Trouble installing Tkinter with 2.3.5/10.2 In-Reply-To: References: Message-ID: <48430C1C.6070408@codebykevin.com> Anthony Kozar wrote: > Hello again, > > I want to thank everyone for their responses on this issue -- I appreciate > the help! I did get Python 2.3.7 with Tkinter to build on my 10.2 machine > and it was incredibly straightforward. (I forgot to install WASTE, so the > IDE did not build, but that's OK for now). Glad we were able to help. :-) > > I am sorry but not surprised I suppose that so many people feel that 10.2 is > "very ancient", "pretty old", or "obsolete". I bought the computer running > 10.2 only 5-1/2 years ago. Sure it could run 10.5, but I long ago decided > that I did not want to play Apple's "upgrade game" anymore. My Beige G3 can > only run up to 10.2 but it is more comfortable running OS 9. These > computers satisfy most of my needs quite well. > > I will point out that AFAICT, the Windows installers for Python 2.5 support > Windows 95. The equivalent Mac OS version (timewise) would be System 7.5! > Just last year, I completed the Carbonization of a fairly large program. > The program now runs on MacOS 7, 8, 9, and 10.2 through at least 10.4 (I > assume 10.5 will work too -- the only reason it does not support 10.0 or > 10.1 is because CoreMIDI is not functional in those versions). This is > probably a specialized case, but it was not too difficult to maintain > support for System 7 in this program. > > Before anyone gets upset by these comments, none of this is intended as a > criticism. I am merely griping about the state of Mac development because I > have been rather frustrated the last couple of weeks trying to get several > open-source programs running on my 10.2 machine. > > I do understand that the MacPython development team is probably much smaller > than the Windows team. And the Mac OS and platform have undergone several > very significant changes during the last 13 years and Apple makes it much > more difficult to support older systems than Microsoft does. In fact, I > think the blame lies with Apple due to the pace of their OS releases and > their attitude that anything older than 2-3 years is not worth supporting. > I am just continually saddened to see so many developers (especially for > open-source projects) who either adopt this attitude or are forced to > support only recent systems by the circumstances thrust upon them. Yes, I think the responsibility here lies with Apple rather than with third-party developers. Apple is very aggressive about updating the capabilities of the OS and the pace of development makes maintaining backwards compatability a challenge. It's different from Windows. However, if you want to develop this platform that's what you live with. > >> Any reason you have to support 10.2, apart from the fact that it's what >> your machine runs? The user base for 10.2 is negligible. > > I have been asked by a potential client to write a GUI for a cross-platform > program written in Python. The request was to support "all platforms" that > the underlying program itself will run on. That program has an interactive > commandline-like interface and is 100% pure Python, requiring only Python > 2.3 to run. It is distributed for Windows, Linux, Mac OS X, and even Mac OS > 9. The Python 2.3 minimum thus includes OS X 10.2 as a potential target for > the GUI. I've already informed the client that OS 9 support is unlikely. I > suppose that 10.2 support may be iffy if I have to upgrade to complete the > project. > > Maybe there are not many 10.2 users left. But I still frequently hear from > people who are "just now" giving up their OS 9 machines for something newer. > It would be interesting to see some real numbers for how many 10.2 users > there are. The Omni Group keep statistics on the OS version of folks downloading their software: 99.7% of their users are on Leopard or Tiger. While this isn't absolute, it provides an interesting snapshot. More info: http://update.omnigroup.com/. I'd say, based on this, that there probably aren't many 10.2 users left--at least not many users who are in the market to install new software, free or otherwise, on their machines. > > Sorry for the long "rant". MacPython is a great piece of software and I > appreciated the help getting Tkinter working on 10.2. Unfortunately, other > tools that I was hoping to use on this project (such as Guib, the successor > to SpecTcl) are proving to be much more difficult to install on 10.2 than > Tkinter was. > Again, glad to help. Best, Kevin -- Kevin Walzer Code by Kevin http://www.codebykevin.com From nad at acm.org Mon Jun 2 01:21:57 2008 From: nad at acm.org (Ned Deily) Date: Sun, 01 Jun 2008 16:21:57 -0700 Subject: [Pythonmac-SIG] Trouble installing Tkinter with 2.3.5/10.2 References: Message-ID: In article , Anthony Kozar wrote: > Maybe there are not many 10.2 users left. But I still frequently hear from > people who are "just now" giving up their OS 9 machines for something newer. But that's not really an Apples to Apples comparison, so to speak. I would be rather surprised to find that there aren't more OS 9 users left today than 10.2 users since, in general, once you've made the leap to OS X, it's far easier to move from 10.m to 10.m+n than it is from OS 9 (or earlier) to any 10.n. Likewise, I suspect most people who've gone through both processes would say that the leap from OS9 to 10.n is bigger conceptually than from W95 to XP or Vista. But that's just my not particularly well-informed speculation. Another factor is that the early releases of OS X were immature - not surprisingly. The improvements from release to release have no doubt been a motivator to many users to keep current. All that is somewhat independent of issues of supported hardware, such as you cited with an early G3. There are, of course, various reasons why Apple might be seen as more aggressive than Microsoft about retiring older hardware, the most obvious being that, unlike Microsoft, Apple's primary business is selling hardware, not software. > It would be interesting to see some real numbers for how many 10.2 users > there are. I've nothing equivalent to the Omni data to draw on but, in my small sample of users, I don't know of anyone still using 10.2. Another interesting set of data points might be to look at the documented current supported os versions for a representative set of "popular" third-party OSX applications. I'd be surprised if 10.2 shows up much any more. What is pretty indisputable, I think, is that Apple has some pretty powerful carrots and sticks out there; users of new hardware aren't going to be running anything but the latest releases so the number of systems running older OS X versions will likely always tend to drop off pretty rapidly after a few years. -- Ned Deily, nad at acm.org From w.northcott at unsw.edu.au Mon Jun 2 03:05:12 2008 From: w.northcott at unsw.edu.au (Bill Northcott) Date: Mon, 2 Jun 2008 11:05:12 +1000 Subject: [Pythonmac-SIG] 64-bit Python? In-Reply-To: References: Message-ID: <658773F6-59A0-45FA-BA6E-DEF987C32494@unsw.edu.au> > On May 29, 2008, at 2:53 PM, Frank Schima wrote: > >> I have the latest Mac Pro with 10.5.3. I ran the sys.maxint test >> and got the 32-bit result. I tried both the Apple python and the >> MacPorts python 2.5.2. > I had a quick look and it seems that the main Python library in the standard Apple framework is 4-way fat including both ppc64 and x86_64. However, the python executable is only 32 bit. So if you use the library through that it will be in 32 bit mode. I would have thought it was not too hard to build a 64 bit python executable against the installed library. It is just a command interpreter. Bill Northcott From joaoleao at gmx.net Mon Jun 2 13:59:51 2008 From: joaoleao at gmx.net (=?ISO-8859-1?Q?Jo=E3o_Le=E3o?=) Date: Mon, 2 Jun 2008 12:59:51 +0100 Subject: [Pythonmac-SIG] Problem with CoreGraphics and py2app References: Message-ID: Hi list Is anyone having trouble building applications from CoreGraphics scripts? Details here: > Hi > > I'm running Mac OS X 10.5.2 on a G4 MacBook and I didn't install any > addons in what concerns Python. > I was happy to see that apple is now including PyObjc and py2app. > > I tried to build applications with py2app from my old CoreGraphics > scripts (made on 10.4 / python2.3) that used to work ok. py2app > actually creates the application but when I run it, it unexpectedly > quits. The Console spits this: > 5/23/08 7:12:19 PM [0x0-0x85085].org.pythonmac.unspecified.Test[647] > Fatal Python error: Interpreter not initialized (version mismatch?) > 5/23/08 7:12:36 PM com.apple.launchd[66] > ([0x0-0x85085].org.pythonmac.unspecified.Test[647]) Exited > abnormally: Abort trap > > To exclude some error in my script, I tried this with one the Apple > supplied examples under /Developer/Examples/Quartz/Python/. > I ran py2app with the following "setup.py" (I chose the example > "circle.py"): > ### > from distutils.core import setup > import py2app > > setup( > name='Test', > app=["circle.py"], > ) > ### > > Incidentally, I discovered that my system isn't finding py2applet too: > ibook-joao:Desktop joao$ py2applet --make-setup circle.py > -bash: py2applet: command not found > > Finally, py2app seems to work ok with other scripts that don't use > CoreGraphics. > > Thanks. > Jo?o P.S. Meanwhile I updated to 10.5.3. The behavior is the same. From Chris.Barker at noaa.gov Mon Jun 2 19:14:27 2008 From: Chris.Barker at noaa.gov (Christopher Barker) Date: Mon, 02 Jun 2008 10:14:27 -0700 Subject: [Pythonmac-SIG] Strange python behavior after upgrading to OS X 10.5.3 In-Reply-To: <917629CA-D531-4403-93AD-A2A3F8C6483E@nasa.gov> References: <917629CA-D531-4403-93AD-A2A3F8C6483E@nasa.gov> Message-ID: <48442A73.3000905@noaa.gov> Larry Meyn wrote: > I had the same problem on another Mac just upgraded to 10.5.3 from > 10.5.2. This time the traceback was a little more helpful and the > error occurred after opening a .pyc file. The solution was to delete > all the .pyc files used and the newly regenerated ones worked fine. Does this mean that Apple upgraded Python? That would be a first, and a good sign. However, an upgrade to python within the 2.5 series shouldn't break *.pyc files, so I wonder what's up. Did they go 64 bit with the interpreter? -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 djcypod at gmail.com Tue Jun 3 00:27:25 2008 From: djcypod at gmail.com (beau) Date: Mon, 2 Jun 2008 15:27:25 -0700 Subject: [Pythonmac-SIG] PyQt4 Style Sheet questions Message-ID: Hello, When I try to run this and script: #!/usr/bin/python2.4 # colordialog.py import sys from PyQt4 import QtGui from PyQt4 import QtCore class ColorDialog(QtGui.QWidget): def __init__(self, parent=None): QtGui.QWidget.__init__(self, parent) color = QtGui.QColor(0, 0, 0) self.setGeometry(300, 300, 250, 180) self.setWindowTitle('ColorDialog') self.button = QtGui.QPushButton('Dialog', self) self.button.setFocusPolicy(QtCore.Qt.NoFocus) self.button.move(20, 20) self.connect(self.button, QtCore.SIGNAL('clicked()'), self.showDialog) self.setFocus() self.widget = QtGui.QWidget(self) self.widget.setStyleSheet("QWidget { background-color: %s }" % color.name()) self.widget.setGeometry(130, 22, 100, 100) def showDialog(self): color = QtGui.QColorDialog.getColor() self.widget.setStyleSheet("QWidget { background-color: %s }" % color.name()) app = QtGui.QApplication(sys.argv) cd = ColorDialog() cd.show() app.exec_() I get the following error message: Traceback (most recent call last): File "untitled text 5", line 39, in ? cd = ColorDialog() File "untitled text 5", line 27, in __init__ self.widget.setStyleSheet("QWidget { background-color: %s }" AttributeError: setStyleSheet This code came from: http://www.zetcode.com/tutorials/pyqt4/dialogs/ From ed_hartley at mac.com Tue Jun 3 00:40:06 2008 From: ed_hartley at mac.com (Edward Hartley) Date: Mon, 02 Jun 2008 23:40:06 +0100 Subject: [Pythonmac-SIG] Pythonmac-SIG Digest, Vol 61, Issue 23 In-Reply-To: References: Message-ID: <4E8190C5-968D-4D4D-AEB1-2E2990044195@mac.com> On 29 May 2008, at 11:00, pythonmac-sig-request at python.org wrote: > Send Pythonmac-SIG mailing list submissions to > pythonmac-sig at python.org > > To subscribe or unsubscribe via the World Wide Web, visit > http://mail.python.org/mailman/listinfo/pythonmac-sig > or, via email, send a message with subject or body 'help' to > pythonmac-sig-request at python.org > > You can reach the person managing the list at > pythonmac-sig-owner at python.org > > When replying, please edit your Subject line so it is more specific > than "Re: Contents of Pythonmac-SIG digest..." > Today's Topics: > > 1. Is there still a good reason for separate macpython and > pyobjc mailing lists? (Jack Jansen) > 2. Re: Is there still a good reason for separate macpython and > pyobjc mailing lists? (Christopher Barker) > > From: Jack Jansen > Date: 28 May 2008 22:03:44 BST > To: pyobjc-dev at lists.sourceforge.net, PythonMac mac > > Subject: [Pythonmac-SIG] Is there still a good reason for separate > macpython and pyobjc mailing lists? > > > Now that pyobjc is a first-class citizen of MacPython, is there any > reason to maintain two mailing lists? Are there any people who are > on one of the lists and not the other? > -- > Jack Jansen, , http://www.cwi.nl/~jack > If I can't dance I don't want to be part of your revolution -- Emma > Goldman > > > > > > > From: Christopher Barker > Date: 28 May 2008 23:50:22 BST > To: pyobjc-dev at lists.sourceforge.net, PythonMac mac > > Subject: Re: [Pythonmac-SIG] Is there still a good reason for > separate macpython and pyobjc mailing lists? > > > Jack Jansen wrote: >> Now that pyobjc is a first-class citizen of MacPython, is there any >> reason to maintain two mailing lists? Are there any people who are >> on one of the lists and not the other? > > yup -- I never touch pyObjC. However, I have no issue with sharing a > list, unless there is a HUGE amount of PyObjC traffic! > > -CHB > +1 merging the two lists, the disparity between the two views on at least py2app has been a significant source of confusion in the last year. The hard core here seem to be a small community and there are a multitude of corner cases when porting FLOSS or GNU python libraries and apps to OSX to make a single point of contact seem essential to me. Best Ed > > > -- > Christopher Barker, Ph.D. > Oceanographer > > Emergency Response Division > NOAA/NOS/OR&R (206) 526-6959 voice > 7600 Sand Point Way NE (206) 526-6329 fax > Seattle, WA 98115 (206) 526-6317 main reception > > Chris.Barker at noaa.gov > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From larry.meyn at nasa.gov Tue Jun 3 01:10:13 2008 From: larry.meyn at nasa.gov (Larry Meyn) Date: Mon, 02 Jun 2008 16:10:13 -0700 Subject: [Pythonmac-SIG] Strange python behavior after upgrading to OS X 10.5.3 In-Reply-To: <48442A73.3000905@noaa.gov> Message-ID: I was using a 2.5.2 framework build not the system python. So the system python shouldn't have been involved and the framework build wasn't changed after the upgrade. Another interesting quirk was that the new .pyc files from my machine running OS 10.5.3 worked fine on my machine downgraded to OS 10.5.2. I'll try to preserve the different .pyc files for future investigation if I get some spare time, but "fix" of deleting the .pyc files is simple enough for now. --Larry On 6/2/08 10:14 AM, "Christopher Barker" wrote: > Larry Meyn wrote: >> I had the same problem on another Mac just upgraded to 10.5.3 from >> 10.5.2. This time the traceback was a little more helpful and the >> error occurred after opening a .pyc file. The solution was to delete >> all the .pyc files used and the newly regenerated ones worked fine. > > Does this mean that Apple upgraded Python? That would be a first, and a > good sign. > > However, an upgrade to python within the 2.5 series shouldn't break > *.pyc files, so I wonder what's up. Did they go 64 bit with the interpreter? > > -Chris > > From ronaldoussoren at mac.com Tue Jun 3 07:26:07 2008 From: ronaldoussoren at mac.com (Ronald Oussoren) Date: Tue, 03 Jun 2008 07:26:07 +0200 Subject: [Pythonmac-SIG] (no subject) In-Reply-To: <296607.88819.qm@web52104.mail.re2.yahoo.com> References: <296607.88819.qm@web52104.mail.re2.yahoo.com> Message-ID: <68B82836-2DF6-4087-A713-B136E2ED5003@mac.com> On 29 May, 2008, at 17:25, Georg wrote: > > Hello, > > I'm running Python under OS X 10.4 on a MacPro, and I'm running up > against the limitations of a 32 bit address space (i.e., I can't use > more than 4gb of space). I have 64 bit processors in my machine -- > will upgrading to Leopard allow Python to use a 64 bit address space? > > sorry if this seems like a dumb/naive question, but I can't for the > life of me figure this out by googling around. Sort of... the python framework is 4-way universal, that is it supports 32-bit as well as 64-bit code. The command-line tools are 32- bit only though, which means the 64-bit support in the framework is less than useful. Ronald > > > Thanks > > _______________________________________________ > 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: 2224 bytes Desc: not available URL: From georg.seifert at gmx.de Tue Jun 3 16:14:34 2008 From: georg.seifert at gmx.de (Georg Seifert) Date: Tue, 3 Jun 2008 16:14:34 +0200 Subject: [Pythonmac-SIG] extractClasses and NIB 3.0 Message-ID: <80B7D17E-383A-4368-8E13-D2D2DCCD1EE8@gmx.de> Hello, I try to write a plugin to my app using py2app (the app itself is written in ObjectC). My program is targeted for Leopard only so my NIB- Files are version 3.x. it seems, that "NibClassBuilder.extractClasses()" cannot read this NIB files as I get the following when loading the bundle: [..] File "/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/ site-packages/PyObjC/PyObjCTools/NibClassBuilder.py", line 134, in extractClasses self._extractClassesFromNibFromBundle(nibName, bundle) File "/Library/Frameworks/Python.framework/Versions/2.4/lib/ python2.4/site-packages/PyObjC/PyObjCTools/NibClassBuilder.py", line 152, in _extractClassesFromNibFromBundle self._extractClassesFromNibFromPath(path) File "/Library/Frameworks/Python.framework/Versions/2.4/lib/ python2.4/site-packages/PyObjC/PyObjCTools/NibClassBuilder.py", line 162, in _extractClassesFromNibFromPath raise NibLoaderError, "Invalid NIB file [%s]" % path PyObjCTools.NibClassBuilder.NibLoaderError: Invalid NIB file [/Users/ G..... Is there a problem with my python installation as is uses the python 2.4 path ( in the ? Or are NIB 3.x file not supported Or do I miss something obvious? My Python code: NibClassBuilder.extractClasses("MyWindow", bundle=NSBundle.mainBundle()) class MyExporter(NibClassBuilder.AutoBaseClass): Thanks Georg From ronaldoussoren at mac.com Tue Jun 3 16:38:51 2008 From: ronaldoussoren at mac.com (Ronald Oussoren) Date: Tue, 03 Jun 2008 07:38:51 -0700 Subject: [Pythonmac-SIG] extractClasses and NIB 3.0 In-Reply-To: <80B7D17E-383A-4368-8E13-D2D2DCCD1EE8@gmx.de> References: <80B7D17E-383A-4368-8E13-D2D2DCCD1EE8@gmx.de> Message-ID: Georg, PyObjCTools.NibClassBuilder does not support NIB files that are created with Interface Builder 3. On the positive side: when you use Xcode 3 to edit your source code Interface Builder will automaticly pick up class definitions in your python code, which takes away a major reason for having NibClassBuilder in the first place. Ronald On Tuesday, June 03, 2008, at 04:15PM, "Georg Seifert" wrote: >Hello, > >I try to write a plugin to my app using py2app (the app itself is >written in ObjectC). My program is targeted for Leopard only so my NIB- >Files are version 3.x. > >it seems, that "NibClassBuilder.extractClasses()" cannot read this NIB >files as I get the following when loading the bundle: >[..] >File "/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/ >site-packages/PyObjC/PyObjCTools/NibClassBuilder.py", line 134, in >extractClasses > self._extractClassesFromNibFromBundle(nibName, bundle) > File "/Library/Frameworks/Python.framework/Versions/2.4/lib/ >python2.4/site-packages/PyObjC/PyObjCTools/NibClassBuilder.py", line >152, in _extractClassesFromNibFromBundle > self._extractClassesFromNibFromPath(path) > File "/Library/Frameworks/Python.framework/Versions/2.4/lib/ >python2.4/site-packages/PyObjC/PyObjCTools/NibClassBuilder.py", line >162, in _extractClassesFromNibFromPath > raise NibLoaderError, "Invalid NIB file [%s]" % path >PyObjCTools.NibClassBuilder.NibLoaderError: Invalid NIB file [/Users/ >G..... > > > >Is there a problem with my python installation as is uses the python >2.4 path ( in the ? > >Or are NIB 3.x file not supported >Or do I miss something obvious? > > >My Python code: > >NibClassBuilder.extractClasses("MyWindow", bundle=NSBundle.mainBundle()) > >class MyExporter(NibClassBuilder.AutoBaseClass): > > >Thanks >Georg >_______________________________________________ >Pythonmac-SIG maillist - Pythonmac-SIG at python.org >http://mail.python.org/mailman/listinfo/pythonmac-sig > > From ronaldoussoren at mac.com Tue Jun 3 16:38:54 2008 From: ronaldoussoren at mac.com (Ronald Oussoren) Date: Tue, 03 Jun 2008 07:38:54 -0700 Subject: [Pythonmac-SIG] extractClasses and NIB 3.0 In-Reply-To: <80B7D17E-383A-4368-8E13-D2D2DCCD1EE8@gmx.de> References: <80B7D17E-383A-4368-8E13-D2D2DCCD1EE8@gmx.de> Message-ID: Georg, PyObjCTools.NibClassBuilder does not support NIB files that are created with Interface Builder 3. On the positive side: when you use Xcode 3 to edit your source code Interface Builder will automaticly pick up class definitions in your python code, which takes away a major reason for having NibClassBuilder in the first place. Ronald On Tuesday, June 03, 2008, at 04:15PM, "Georg Seifert" wrote: >Hello, > >I try to write a plugin to my app using py2app (the app itself is >written in ObjectC). My program is targeted for Leopard only so my NIB- >Files are version 3.x. > >it seems, that "NibClassBuilder.extractClasses()" cannot read this NIB >files as I get the following when loading the bundle: >[..] >File "/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/ >site-packages/PyObjC/PyObjCTools/NibClassBuilder.py", line 134, in >extractClasses > self._extractClassesFromNibFromBundle(nibName, bundle) > File "/Library/Frameworks/Python.framework/Versions/2.4/lib/ >python2.4/site-packages/PyObjC/PyObjCTools/NibClassBuilder.py", line >152, in _extractClassesFromNibFromBundle > self._extractClassesFromNibFromPath(path) > File "/Library/Frameworks/Python.framework/Versions/2.4/lib/ >python2.4/site-packages/PyObjC/PyObjCTools/NibClassBuilder.py", line >162, in _extractClassesFromNibFromPath > raise NibLoaderError, "Invalid NIB file [%s]" % path >PyObjCTools.NibClassBuilder.NibLoaderError: Invalid NIB file [/Users/ >G..... > > > >Is there a problem with my python installation as is uses the python >2.4 path ( in the ? > >Or are NIB 3.x file not supported >Or do I miss something obvious? > > >My Python code: > >NibClassBuilder.extractClasses("MyWindow", bundle=NSBundle.mainBundle()) > >class MyExporter(NibClassBuilder.AutoBaseClass): > > >Thanks >Georg >_______________________________________________ >Pythonmac-SIG maillist - Pythonmac-SIG at python.org >http://mail.python.org/mailman/listinfo/pythonmac-sig > > From georg.seifert at gmx.de Tue Jun 3 22:11:02 2008 From: georg.seifert at gmx.de (Georg Seifert) Date: Tue, 3 Jun 2008 22:11:02 +0200 Subject: [Pythonmac-SIG] plugin destroys python? Message-ID: Hello once again me ;( I have an other problem: My program load some plugins with this code: for(NSString * currPath in bundlePaths) { currBundle = [NSBundle bundleWithPath:currPath]; if(currBundle) { currPrincipalClass = [currBundle principalClass]; //if(currPrincipalClass && [currPrincipalClass conformsToProtocol:aProtocol]) //1 if(currPrincipalClass) { [bundles addObject:currBundle]; } } } The plugin looks like this: import objc from Foundation import * from AppKit import * #import sys, os, re MyExport = objc.protocolNamed('MyExport') class GSExporter(NSObject, MyExport): def description(self): return "This is a description" def interfaceVersion(self): return 1 def fileType(self): return "txt" def export_toPath_(self, GSObj, Path): if GSFontObj: print "Exportiere:", GSObj.name() # Do the Stuff If I do load this Plugin, I cannot run python scripts with "PyRun_SimpleString()" any more. I get the following Message in the Console: > Re-enabling shared library breakpoint 1 > Xcode could not locate source file: import.c (line: 320) I do init python in the main.m does anyone has a suggestion? Thanks in advance Georg p.s. an other small question: why does the python plugin does not "conformsToProtocol:" even if I declare it? Do I miss something? From bwaters+sqrl at nrao.edu Mon Jun 2 01:32:33 2008 From: bwaters+sqrl at nrao.edu (Boyd Waters) Date: Sun, 1 Jun 2008 17:32:33 -0600 (MDT) Subject: [Pythonmac-SIG] 64-bit Python? In-Reply-To: <6D7FB3D2-1E11-4954-8EE8-C86879B8A366@kyngchaos.com> References: <302611.62100.qm@web52111.mail.re2.yahoo.com> <6D7FB3D2-1E11-4954-8EE8-C86879B8A366@kyngchaos.com> Message-ID: <34955.75.161.92.250.1212363153.squirrel@webmail.aoc.nrao.edu> Interesting! Cool! I should look at the header file in the System Python... I had to patch the Python.h in the standard Python distribution to have the "ifdef 64-bit" conditional code, so that the single header file works with both 32- and 64-bit. NOTE that the patches I used in the modified MacPorts came from Apple: http://www.opensource.apple.com/darwinsource/10.5.2/python-30.1.2/ > On May 29, 2008, at 5:13 PM, Boyd Waters wrote: > >> The MacPorts 2.5.2 doesn't have my 64-bit hacks in it. > > Are there any changes needed to the python executable binary to > support 64bits? I compiled a quick 64bit python executable as a > companion to the system's Python like so: > > gcc -arch x86_64 -arch ppc64 -I/System/Library/Frameworks/ > Python.framework/Headers -lpython2.5 -o python64 Modules/python.c > > Tested OK with gdal-python. sys.maxint gives the 64bit value. > >> > > ----- > William Kyngesburye > http://www.kyngchaos.com/ > > First Pogril: Why is life like sticking your head in a bucket filled > with hyena offal? > Second Pogril: I don't know. Why IS life like sticking your head in a > bucket filled with hyena offal? > First Pogril: I don't know either. Wretched, isn't it? > > -HitchHiker's Guide to the Galaxy > > ~ boyd Boyd Waters National Radio Astronomy Observatory Socorro, New Mexico http://www.aoc.nrao.edu/~bwaters From jstroud at mbi.ucla.edu Tue Jun 3 12:37:27 2008 From: jstroud at mbi.ucla.edu (xld00d) Date: Tue, 3 Jun 2008 03:37:27 -0700 (PDT) Subject: [Pythonmac-SIG] py2app and missed modules In-Reply-To: <77141B00-56FB-457E-A79A-688DE0303B9B@yahoo.it> References: <77141B00-56FB-457E-A79A-688DE0303B9B@yahoo.it> Message-ID: <17620597.post@talk.nabble.com> Massimo Di Stefano wrote: > > i'm tring for the first time to use py2app :-) > i need to create a .app > > [snip] > > ImportError: No module named pytz.zoneinfo > > /System/Library/Frameworks/Python.framework/Versions/2.5/Extras/lib/ > python/modulegraph/modulegraph.py(444)load_tail() > -> raise ImportError, "No module named " + mname > (Pdb) q > > i tried to copy a zipped file of my site packages into > > may.app/Contents/Resources/lib/python2.5/ > but without succes :-( > > i installed py2app using easy_install > on a mac osx 10.5.2 > I think your first problem is that you are using the "packages" option in the setup options dictionary as a catchall. You need to add modules to the "includes" option and genuine packages to the "packages" options. Python packages exist as a directory of python files with an "__init__.py" and modules exist as ".py" files. See the python docs on http://docs.python.org/tut/node8.html Modules for more info. Your second problem is the fault of the pytz maintainers. Somehow, they managed to hose backwards compatibility of the pytz module by ridding it of the "zoneinfo" submodule and pytz.zoneinfo's attribute "UTC". I think they did this for evil fun because no one would do this out of the blue like that without thinking of all of the stuff it would break. To fix this, I think its easiest just to modify the pytz package in the setup.py file by importing it and modifying its attributes appropriately. Here, I have fixed both problems in my own setup.py file: from setuptools import setup import pytz pytz.zoneinfo = pytz.tzinfo pytz.zoneinfo.UTC = pytz.UTC APPNAME = 'myapp' APP = ['%s.py' % APPNAME] DATA_FILES = [] OPTIONS = {'argv_emulation': False, 'iconfile': "%s.icns" % APPNAME, 'includes': ['ScAdvancedWidgets', 'configobj'], 'packages': ['Pmw', 'pyTableLib', 'matplotlib']} setup( app=APP, data_files=DATA_FILES, options={'py2app': OPTIONS}, setup_requires=['py2app'], ) Hopefully, if anyone sees any problems with this latter approach, especially pytz, py2app, or matplotlib people, they will speak up and suggest a better fix. -- View this message in context: http://www.nabble.com/py2app-and-missed-modules-tp17309983p17620597.html Sent from the Python - pythonmac-sig mailing list archive at Nabble.com. -------------- next part -------------- An HTML attachment was scrubbed... URL: From saurik at saurik.com Tue Jun 3 11:51:44 2008 From: saurik at saurik.com (Jay Freeman (saurik)) Date: Tue, 3 Jun 2008 02:51:44 -0700 Subject: [Pythonmac-SIG] Is there still a good reason for separate macpythonand pyobjc mailing lists? References: Message-ID: <0329BC70A54D4130A56A880F4423AA96@ccs.ucsb.edu> Personally, I have no interest in any issues relating to Python that don't have to do with its integration with Objective-C. In fact, until this e-mail I had never heard of the PythonMac list, and now that I have I went and took a look at it and it doesn't seem particularly interesting to me: I don't actually own a Mac and use PyObjC purely on my iPhone (which means any and all topics about Cocoa are lost on me), I've never used Xcode and don't see why I would want to, and I have no interest in AppleScript or tk. I'm almost certainly in the minority, though. (I'm a programming languages researcher who focuses on language interop, have written a similar library for Java, and maintain a port of PyObjC to the iPhone.) Out of curiosity, why are you interested in merging the mailing lists? There seems to be hardly any converstions (pretty much no conversations, really: last one was in January) directly about PyObjC on PythonMac. Sincerely, Jay Freeman (saurik) saurik at saurik.com http://www.saurik.com/ ----- Original Message ----- From: "Jack Jansen" To: ; "PythonMac mac" Sent: Wednesday, May 28, 2008 2:03 PM Subject: [Pyobjc-dev] Is there still a good reason for separate macpythonand pyobjc mailing lists? > Now that pyobjc is a first-class citizen of MacPython, is there any > reason to maintain two mailing lists? Are there any people who are on > one of the lists and not the other? > -- > Jack Jansen, , http://www.cwi.nl/~jack > If I can't dance I don't want to be part of your revolution -- Emma > Goldman > > > > ------------------------------------------------------------------------- > This SF.net email is sponsored by: Microsoft > Defy all challenges. Microsoft(R) Visual Studio 2008. > http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ > _______________________________________________ > Pyobjc-dev mailing list > Pyobjc-dev at lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/pyobjc-dev > From ronaldoussoren at mac.com Wed Jun 4 07:50:39 2008 From: ronaldoussoren at mac.com (Ronald Oussoren) Date: Wed, 04 Jun 2008 07:50:39 +0200 Subject: [Pythonmac-SIG] 64-bit Python? In-Reply-To: <34955.75.161.92.250.1212363153.squirrel@webmail.aoc.nrao.edu> References: <302611.62100.qm@web52111.mail.re2.yahoo.com> <6D7FB3D2-1E11-4954-8EE8-C86879B8A366@kyngchaos.com> <34955.75.161.92.250.1212363153.squirrel@webmail.aoc.nrao.edu> Message-ID: On 2 Jun, 2008, at 1:32, Boyd Waters wrote: > Interesting! Cool! > > I should look at the header file in the System Python... > > I had to patch the Python.h in the standard Python distribution to > have > the "ifdef 64-bit" conditional code, so that the single header file > works > with both 32- and 64-bit. > > NOTE that the patches I used in the modified MacPorts came from Apple: > http://www.opensource.apple.com/darwinsource/10.5.2/python-30.1.2/ I'll probably commit a patch that enables 4-way universal builds for Python 2.6 on Leopard later this week. That patch is more involved than just patching a header file, I've also enabled building most of the Carbon bindings in 64-bit mode (by disabling everything that isn't supported in 64-bit mode). The patch should be complete by now, I just have to do some more testing before I commit. Ronald > > >> On May 29, 2008, at 5:13 PM, Boyd Waters wrote: >> >>> The MacPorts 2.5.2 doesn't have my 64-bit hacks in it. >> >> Are there any changes needed to the python executable binary to >> support 64bits? I compiled a quick 64bit python executable as a >> companion to the system's Python like so: >> >> gcc -arch x86_64 -arch ppc64 -I/System/Library/Frameworks/ >> Python.framework/Headers -lpython2.5 -o python64 Modules/python.c >> >> Tested OK with gdal-python. sys.maxint gives the 64bit value. >> >>> >> >> ----- >> William Kyngesburye >> http://www.kyngchaos.com/ >> >> First Pogril: Why is life like sticking your head in a bucket filled >> with hyena offal? >> Second Pogril: I don't know. Why IS life like sticking your head >> in a >> bucket filled with hyena offal? >> First Pogril: I don't know either. Wretched, isn't it? >> >> -HitchHiker's Guide to the Galaxy >> >> > > > ~ boyd > > Boyd Waters > National Radio Astronomy Observatory > Socorro, New Mexico > http://www.aoc.nrao.edu/~bwaters > > _______________________________________________ > 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: 2224 bytes Desc: not available URL: From bwaters at nrao.edu Wed Jun 4 08:22:45 2008 From: bwaters at nrao.edu (Boyd Waters) Date: Wed, 4 Jun 2008 00:22:45 -0600 Subject: [Pythonmac-SIG] 64-bit Python? In-Reply-To: References: <302611.62100.qm@web52111.mail.re2.yahoo.com> <6D7FB3D2-1E11-4954-8EE8-C86879B8A366@kyngchaos.com> <34955.75.161.92.250.1212363153.squirrel@webmail.aoc.nrao.edu> Message-ID: <949D3F16-78A1-4FBD-A78F-C6B0E321E64D@nrao.edu> On Jun 3, 2008, at 11:50 PM, Ronald Oussoren wrote: >> I had to patch the Python.h in the standard Python distribution to >> have >> the "ifdef 64-bit" conditional code, so that the single header file >> works >> with both 32- and 64-bit. >> >> NOTE that the patches I used in the modified MacPorts came from >> Apple: >> http://www.opensource.apple.com/darwinsource/10.5.2/python-30.1.2/ > > I'll probably commit a patch that enables 4-way universal builds for > Python 2.6 on Leopard later this week. That patch is more involved > than just patching a header file, I've also enabled building most of > the Carbon bindings in 64-bit mode (by disabling everything that > isn't supported in 64-bit mode). > > The patch should be complete by now, I just have to do some more > testing before I commit. Very nice! Do these patches get pushed upstream to Apple? Who do we rattle over there to get this in an Apple OS release? From ronaldoussoren at mac.com Wed Jun 4 09:33:06 2008 From: ronaldoussoren at mac.com (Ronald Oussoren) Date: Wed, 04 Jun 2008 00:33:06 -0700 Subject: [Pythonmac-SIG] 64-bit Python? In-Reply-To: <949D3F16-78A1-4FBD-A78F-C6B0E321E64D@nrao.edu> References: <302611.62100.qm@web52111.mail.re2.yahoo.com> <6D7FB3D2-1E11-4954-8EE8-C86879B8A366@kyngchaos.com> <34955.75.161.92.250.1212363153.squirrel@webmail.aoc.nrao.edu> <949D3F16-78A1-4FBD-A78F-C6B0E321E64D@nrao.edu> Message-ID: On Wednesday, June 04, 2008, at 08:23AM, "Boyd Waters" wrote: > >On Jun 3, 2008, at 11:50 PM, Ronald Oussoren wrote: > >>> I had to patch the Python.h in the standard Python distribution to >>> have >>> the "ifdef 64-bit" conditional code, so that the single header file >>> works >>> with both 32- and 64-bit. >>> >>> NOTE that the patches I used in the modified MacPorts came from >>> Apple: >>> http://www.opensource.apple.com/darwinsource/10.5.2/python-30.1.2/ >> >> I'll probably commit a patch that enables 4-way universal builds for >> Python 2.6 on Leopard later this week. That patch is more involved >> than just patching a header file, I've also enabled building most of >> the Carbon bindings in 64-bit mode (by disabling everything that >> isn't supported in 64-bit mode). >> >> The patch should be complete by now, I just have to do some more >> testing before I commit. > > >Very nice! > >Do these patches get pushed upstream to Apple? Who do we rattle over >there to get this in an Apple OS release? I won't push them explicitly, but the feature hopefully will get used when Apple upgrades to Python 2.6. Hopefully I'll run into the Python maintainer at WWDC. BTW. As a born nitpicker I have to react to your use of the word "upstream" ;-). Apple is downstream from me, that is they are a user of the Python.org code. Ronald > > > > From christopher.e.kees at usace.army.mil Wed Jun 4 18:02:46 2008 From: christopher.e.kees at usace.army.mil (Chris Kees) Date: Wed, 4 Jun 2008 11:02:46 -0500 Subject: [Pythonmac-SIG] 64-bit Python? In-Reply-To: References: <302611.62100.qm@web52111.mail.re2.yahoo.com> <6D7FB3D2-1E11-4954-8EE8-C86879B8A366@kyngchaos.com> <34955.75.161.92.250.1212363153.squirrel@webmail.aoc.nrao.edu> <949D3F16-78A1-4FBD-A78F-C6B0E321E64D@nrao.edu> Message-ID: <67977D00-725B-4EB3-83A4-215BD8F78F16@usace.army.mil> I'm wondering how to coordinate having python executables in 32 and 64 bit mode on the same machine. Will the patched python 2.6 build a python and a python64? When I build extension models do I then need to build/install each module twice e.g. 'python setup.py install' and 'python64 setup.py install'? Could I help this effort out by starting to work with your branch of python 2.6? I've been building a non- framework, non-universal build of python to work in 64 bit but it would be nice to take advantage of the universal build stuff as well as use some gui tools in 64 bit. Chris On Jun 4, 2008, at 2:33 AM, Ronald Oussoren wrote: > > > On Wednesday, June 04, 2008, at 08:23AM, "Boyd Waters" > wrote: >> >> On Jun 3, 2008, at 11:50 PM, Ronald Oussoren wrote: >> >>>> I had to patch the Python.h in the standard Python distribution to >>>> have >>>> the "ifdef 64-bit" conditional code, so that the single header file >>>> works >>>> with both 32- and 64-bit. >>>> >>>> NOTE that the patches I used in the modified MacPorts came from >>>> Apple: >>>> http://www.opensource.apple.com/darwinsource/10.5.2/python-30.1.2/ >>> >>> I'll probably commit a patch that enables 4-way universal builds for >>> Python 2.6 on Leopard later this week. That patch is more involved >>> than just patching a header file, I've also enabled building most of >>> the Carbon bindings in 64-bit mode (by disabling everything that >>> isn't supported in 64-bit mode). >>> >>> The patch should be complete by now, I just have to do some more >>> testing before I commit. >> >> >> Very nice! >> >> Do these patches get pushed upstream to Apple? Who do we rattle over >> there to get this in an Apple OS release? > > I won't push them explicitly, but the feature hopefully will get > used when Apple upgrades to Python 2.6. Hopefully I'll run into the > Python maintainer at WWDC. > > BTW. As a born nitpicker I have to react to your use of the word > "upstream" ;-). Apple is downstream from me, that is they are a user > of the Python.org code. > > Ronald >> >> >> >> > _______________________________________________ > Pythonmac-SIG maillist - Pythonmac-SIG at python.org > http://mail.python.org/mailman/listinfo/pythonmac-sig From njriley at uiuc.edu Wed Jun 4 18:46:51 2008 From: njriley at uiuc.edu (Nicholas Riley) Date: Wed, 4 Jun 2008 11:46:51 -0500 Subject: [Pythonmac-SIG] 64-bit Python? In-Reply-To: <67977D00-725B-4EB3-83A4-215BD8F78F16@usace.army.mil> References: <302611.62100.qm@web52111.mail.re2.yahoo.com> <6D7FB3D2-1E11-4954-8EE8-C86879B8A366@kyngchaos.com> <34955.75.161.92.250.1212363153.squirrel@webmail.aoc.nrao.edu> <949D3F16-78A1-4FBD-A78F-C6B0E321E64D@nrao.edu> <67977D00-725B-4EB3-83A4-215BD8F78F16@usace.army.mil> Message-ID: <20080604164651.GA22801@uiuc.edu> On Wed, Jun 04, 2008 at 11:02:46AM -0500, Chris Kees wrote: > I'm wondering how to coordinate having python executables in 32 and 64 > bit mode on the same machine. Will the patched python 2.6 build a > python and a python64? There's no need for two separate executables; Mach-O files can contain 1-4 architectures (or more, potentially for CPU specific variants). You can use the 'arch' command in Leopard to choose whether you want to execute the 64-bit or 32-bit version of an executable (a bit like isaexec on Solaris). > When I build extension models do I then need to build/install each > module twice e.g. 'python setup.py install' and 'python64 setup.py > install'? Could I help this effort out by starting to work with your > branch of python 2.6? I've been building a non- framework, > non-universal build of python to work in 64 bit but it would be nice > to take advantage of the universal build stuff as well as use some > gui tools in 64 bit. That's up to how Ronald modifies distutils I guess. Unfortunately there are lots of places where code makes assumptions that it's building for a single architecture, so short of for example running the setup script once for each architecture and merging the build products it would be difficult to find a fully general solution. -- Nicholas Riley | From stringfellow at sucs.org Wed Jun 4 19:26:52 2008 From: stringfellow at sucs.org (Steve Pike) Date: Wed, 4 Jun 2008 18:26:52 +0100 Subject: [Pythonmac-SIG] Symbol not found: _NSInternalInconsistencyException Message-ID: <01168A00-2B47-433C-810F-4C0483D8B780@sucs.org> Getting this error when running an app built in XCode 3 on Leopard on a PPC iBook running 10.4 Trac report: http://projects.sucs.org/projects/shtaggle/ticket/5 Any ideas what is causing this? (Google doesnt throw up much) -S From ronaldoussoren at mac.com Wed Jun 4 21:16:13 2008 From: ronaldoussoren at mac.com (Ronald Oussoren) Date: Wed, 04 Jun 2008 21:16:13 +0200 Subject: [Pythonmac-SIG] 64-bit Python? In-Reply-To: <67977D00-725B-4EB3-83A4-215BD8F78F16@usace.army.mil> References: <302611.62100.qm@web52111.mail.re2.yahoo.com> <6D7FB3D2-1E11-4954-8EE8-C86879B8A366@kyngchaos.com> <34955.75.161.92.250.1212363153.squirrel@webmail.aoc.nrao.edu> <949D3F16-78A1-4FBD-A78F-C6B0E321E64D@nrao.edu> <67977D00-725B-4EB3-83A4-215BD8F78F16@usace.army.mil> Message-ID: <2B454361-D5DB-4B60-A00F-E99AA3C200AE@mac.com> On 4 Jun, 2008, at 18:02, Chris Kees wrote: > I'm wondering how to coordinate having python executables in 32 and > 64 bit mode on the same machine. Will the patched python 2.6 build a > python and a python64? I currently build 3 variants: python-32, python-64 and python-all, with python being an alias for python-32. > When I build extension models do I then need to build/install each > module twice e.g. 'python setup.py install' and 'python64 setup.py > install'? No, there is only one tree were all executable files are 4-way universal. If you need to run distutils twice you might as well install two copies of python. Distutils will always build 4-way universal extensions unless explictly told otherwise (by and environment variable or explicit '- arch' flags in the Extension definition). > Could I help this effort out by starting to work with your branch of > python 2.6? I've been building a non-framework, non-universal build > of python to work in 64 bit but it would be nice to take advantage > of the universal build stuff as well as use some gui tools in 64 bit. I don't have branch for this, I just have a checkout of python's subversion tree with my patches applied to that. I will try to commit tomorrow, and will post instructions on how to build the framework afterwards. Ronald -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 2224 bytes Desc: not available URL: From gongchangzhaojie at gmail.com Thu Jun 5 00:52:53 2008 From: gongchangzhaojie at gmail.com (Zhaojie Boulder) Date: Wed, 4 Jun 2008 16:52:53 -0600 Subject: [Pythonmac-SIG] gcc error in Mac OS X In-Reply-To: <12956470806041550k7e2815b4ga6823ee7967a8718@mail.gmail.com> References: <12956470806041550k7e2815b4ga6823ee7967a8718@mail.gmail.com> Message-ID: <12956470806041552j54baf857uddd5a0db270ef701@mail.gmail.com> Hello, I am new to Mac and used python in linux before. What I am trying to do is to install "Ipython" and "PyCogent" in Mac OS X. For PyCogent, after entering the package path, I typed "python setup.py install". The results are as follows: Didn't find Pyrex - will compile from .c files running install running build running build_py running build_ext building 'cogent.align._compare' extension gcc -fno-strict-aliasing -Wno-long-double -no-cpp-precomp -mno-fused-madd -fno-common -dynamic -DNDEBUG -g -Os -Wall -Wstrict-prototypes -DMACOSX -I/usr/include/ffi -DENABLE_DTRACE -arch i386 -arch ppc -pipe -I/Users/zhaojie/Downloads/PyCogent-1.0.1/include -I/System/Library/Frameworks/Python.framework/Versions/2.5/include/python2.5 -c cogent/align/_compare.c -o build/temp.macosx-10.5-i386-2.5/cogent/align/_compare.o -w unable to execute gcc: No such file or directory error: command 'gcc' failed with exit status 1 After google, I installed Xcode,but it did not help. Also, the Xcode folder is not within "applications" folder, but a separate one parallel with "applications". Dragging Xcode folder into the applications folder did not make a difference, either. Hope someone familiar with Mac can help me out. Thank you, Jie -------------- next part -------------- An HTML attachment was scrubbed... URL: From Chris.Barker at noaa.gov Thu Jun 5 01:36:33 2008 From: Chris.Barker at noaa.gov (Christopher Barker) Date: Wed, 04 Jun 2008 16:36:33 -0700 Subject: [Pythonmac-SIG] gcc error in Mac OS X In-Reply-To: <12956470806041552j54baf857uddd5a0db270ef701@mail.gmail.com> References: <12956470806041550k7e2815b4ga6823ee7967a8718@mail.gmail.com> <12956470806041552j54baf857uddd5a0db270ef701@mail.gmail.com> Message-ID: <48472701.3010602@noaa.gov> Zhaojie Boulder wrote: > After google, I installed Xcode,but it did not help. Also, the Xcode > folder is not within "applications" folder, but a separate one parallel > with "applications". Dragging Xcode folder into the applications folder > did not make a difference, either. Well, you don't really need XCode, just the compiler it uses, which is a command line tool anyway. Try typing: which gcc at the command line. You should get: /usr/bin/gcc if you get something like: no gcc in .....[long list of paths] Then you haven't installed XCode tools properly. You need the whole development tool set. The other option is to find binaries of the stuff you need. You should be able to find IPython, but I don't know about PyCogent. -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 georg.seifert at gmx.de Thu Jun 5 11:10:02 2008 From: georg.seifert at gmx.de (Georg Seifert) Date: Thu, 5 Jun 2008 11:10:02 +0200 Subject: [Pythonmac-SIG] build Python Plugin in XCode Message-ID: <3628F144-2D90-45C3-87F6-E5074368995A@gmx.de> hello, is is possible, to build plugins (like the Cocoa Bundles) written in python? I could use py2app, but I have problems with it (as you can see in my last post). There are presets for python apps, but not for bundles. regards Georg From ronaldoussoren at mac.com Thu Jun 5 15:08:46 2008 From: ronaldoussoren at mac.com (Ronald Oussoren) Date: Thu, 05 Jun 2008 15:08:46 +0200 Subject: [Pythonmac-SIG] 64-bit Python? In-Reply-To: <2B454361-D5DB-4B60-A00F-E99AA3C200AE@mac.com> References: <302611.62100.qm@web52111.mail.re2.yahoo.com> <6D7FB3D2-1E11-4954-8EE8-C86879B8A366@kyngchaos.com> <34955.75.161.92.250.1212363153.squirrel@webmail.aoc.nrao.edu> <949D3F16-78A1-4FBD-A78F-C6B0E321E64D@nrao.edu> <67977D00-725B-4EB3-83A4-215BD8F78F16@usace.army.mil> <2B454361-D5DB-4B60-A00F-E99AA3C200AE@mac.com> Message-ID: <8C89BF8B-F9F6-4480-894E-285DE83F2DC8@mac.com> I've just commited support for building python as a 4-way universal binary to the python repository (revision 63955). What does does: This patch adds a new configure argument on OSX: --with-universal-archs=[32-bit|64-bit|all] When used with the --enable-universalsdk option this controls which CPU architectures are includes in the framework. The default is 32-bit, meaning i386 and ppc. The most useful alternative is 'all', which includes all 4 CPU architectures supported by MacOS X (i386, ppc, x86_64 and ppc64). This includes limited support for the Carbon bindings in 64-bit mode as well, limited because (a) I haven't done extensive testing and (b) a large portion of the Carbon API's aren't available in 64-bit mode anyway. I've also duplicated a feature of Apple's build of python: setting the environment variable 'ARCHFLAGS' controls the '-arch' flags used for building extensions using distutils. How to build the tree: - Checkout a copy of the python trunk (that is, the code that will be python 2.6 in the future) - in the root of that checkout: - mkdir build - cd build - ../configure --with-framework-name=Python64' '--with-universal- archs=all' '--enable-framework' '--enable-universalsdk=/' 'MACOSX_DEPLOYMENT_TARGET=10.5' - make - sudo make install This will install a 4-way universal build of Python 2.6 in /Library/ Frameworks/Python64.framework. Add the 'bin' directory inside the framework to your shell's PATH to use this. Note how the framework name is "Python64.framework" and not "Python.framework", this allows you to easily remove this build. There a 3 variants of the command-line interpreter: python-32, python-64 and python-all, python-32 will always run in 32-bit mode, python-64 runs in 64-bit mode and python-all will run in whatever mode is available on a machine. The command "python" without a suffix is an alias for python-32 (because most GUI libraries aren't available in 64- bit mode yet). Distutils will build extensions 4-way universal as well, use ARCHFLAGS to override this (as documented on Apple's website). There are some minor issues in this build: - the tools installed in /usr/local/bin don't include the 3 variants - I haven't tested the Carbon bindings in 64-bit mode. I'll be traveling for the next couple of weeks (WWDC and then some down time) and will probably not be able to provide support during this time. Please file bugs about any issues with this configuration, preferable including patching ;-) Ronald -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 2224 bytes Desc: not available URL: From woklist at kyngchaos.com Thu Jun 5 16:23:03 2008 From: woklist at kyngchaos.com (William Kyngesburye) Date: Thu, 5 Jun 2008 09:23:03 -0500 Subject: [Pythonmac-SIG] 64-bit Python? In-Reply-To: <8C89BF8B-F9F6-4480-894E-285DE83F2DC8@mac.com> References: <302611.62100.qm@web52111.mail.re2.yahoo.com> <6D7FB3D2-1E11-4954-8EE8-C86879B8A366@kyngchaos.com> <34955.75.161.92.250.1212363153.squirrel@webmail.aoc.nrao.edu> <949D3F16-78A1-4FBD-A78F-C6B0E321E64D@nrao.edu> <67977D00-725B-4EB3-83A4-215BD8F78F16@usace.army.mil> <2B454361-D5DB-4B60-A00F-E99AA3C200AE@mac.com> <8C89BF8B-F9F6-4480-894E-285DE83F2DC8@mac.com> Message-ID: Here's an interesting twist (!! just a rumor so far !!) OSX 10.6 may drop PPC support. Dunno, with G5s as recent as 2005, this seems like a bit of a stretch, but you never know with Apple. http://www.powerpage.org/2008/06/rumor_apple_to_drop_powerpc_architecture_support_in_mac_os_x_106.html But people will still want to compile Python 2.6 for Leopard (and the next cat, if 2.6 doesn't make it there), so the quad-arch issue is still valid. On Jun 5, 2008, at 8:08 AM, Ronald Oussoren wrote: > > I've just commited support for building python as a 4-way universal > binary to the python repository (revision 63955). > > What does does: > > This patch adds a new configure argument on OSX: > --with-universal-archs=[32-bit|64-bit|all] > > When used with the --enable-universalsdk option this controls which > CPU architectures are includes in the framework. The default is 32- > bit, > meaning i386 and ppc. The most useful alternative is 'all', which > includes > all 4 CPU architectures supported by MacOS X (i386, ppc, x86_64 and > ppc64). ----- William Kyngesburye http://www.kyngchaos.com/ "Time is an illusion - lunchtime doubly so." - Ford Prefect From shamusom at gmail.com Fri Jun 6 00:48:31 2008 From: shamusom at gmail.com (Shamus) Date: Thu, 5 Jun 2008 18:48:31 -0400 Subject: [Pythonmac-SIG] using for reference Message-ID: <2502A2B0-C924-4AE4-BAF1-48C141FAC619@gmail.com> Perhaps I am not using the right syntax, but here is the applescript command I am trying to use in pyappscript: make new collection with name "Test1" for library "Shamus" for the life of me I cannot get this to work in pyappscript: bn.libraries['Shamus'].make(new=k.collection, with_name='Test1', for=bn.libraries['Shamus']) I get this error: File "", line 1 bn.libraries['James'].make(new=k.collection, with_name='James', for=bn.libraries['James']) Is there some bug with the for reference?? thanks in advance.. From garyrob at mac.com Mon Jun 2 17:36:09 2008 From: garyrob at mac.com (Gary Robinson) Date: Mon, 02 Jun 2008 11:36:09 -0400 Subject: [Pythonmac-SIG] 2.5.2 vs Shed Skin Message-ID: <20080602113609882104.e898a4ab@mac.com> I've been having good luck using the Shed Skin python-to-c++ compiler to create fast extension modules. But since upgrading to python 2.5.2 on my Leopard box using the OS X python binary on the python.org download page, it no longer works. (I get a "SystemError: dynamic module not initialized properly" when trying to import a Shed Skin-generated module; however I can still import it into the old python by invoking that environment with /usr/bin/python.) I've communicated with Shed Skin's author about this, and he hasn't been able to figure what's wrong. (If anyone reading this has any guesses, I'd appreciate that.) So, I've been thinking about removing python 2.5.2 and going back to 2.5.1 for now. Also, I noticed a posting on the Pyobjc-dev list from Ronald Oussoren on 4/11/08 recommending uninstalling 2.5.2 in order to use PyObjC. While I don't need PyObjC at the moment, this does seem like another strike against 2.5.2 at least for the time being. I'm not sure how to uninstall 2.5.2. The readme for the installer says: > The installer puts the applications in "MacPython 2.5" > in your Applications folder, command-line tools in > /usr/local/bin and the underlying machinery in > /Library/Frameworks/Python.framework. So, I assume that to uninstall it, I get rid of ~/Applications/MacPython 2.5 and /Library/Frameworks/Python.framework. I'm not sure what to do about usr/local/bin though. That directory has the following python-related contents: pydoc pydoc2.5 python python-config python2.5 python2.5-config The python entry is a link to Library/Frameworks/Python.framework/Versions/2.5/bin/python. Do I simply delete all these entries? Or are any of them relevant to Apple's original 2.5.1 installation? Thanks, Gary -- Gary Robinson CTO Emergent Music, LLC personal email: garyrob at mac.com work email: grobinson at emergentmusic.com Company: http://www.emergentmusic.com Blog: http://www.garyrobinson.net From nad at acm.org Fri Jun 6 01:33:16 2008 From: nad at acm.org (Ned Deily) Date: Thu, 05 Jun 2008 16:33:16 -0700 Subject: [Pythonmac-SIG] using for reference References: <2502A2B0-C924-4AE4-BAF1-48C141FAC619@gmail.com> Message-ID: In article <2502A2B0-C924-4AE4-BAF1-48C141FAC619 at gmail.com>, Shamus wrote: > Perhaps I am not using the right syntax, but here is the applescript > command I am trying to use in pyappscript: > > make new collection with name "Test1" for library "Shamus" > > for the life of me I cannot get this to work in pyappscript: > > bn.libraries['Shamus'].make(new=k.collection, with_name='Test1', > for=bn.libraries['Shamus']) > > I get this error: > > File "", line 1 > bn.libraries['James'].make(new=k.collection, with_name='James', > for=bn.libraries['James']) Which app/version are you trying to script? What's the rest of the error traceback? And which versions of py-appscript, python, and OS X? -- Ned Deily, nad at acm.org From Chris.Barker at noaa.gov Fri Jun 6 02:14:06 2008 From: Chris.Barker at noaa.gov (Christopher Barker) Date: Thu, 05 Jun 2008 17:14:06 -0700 Subject: [Pythonmac-SIG] gcc error in Mac OS X In-Reply-To: <12956470806051003y24bb4d9el1794c6055fce3357@mail.gmail.com> References: <12956470806041550k7e2815b4ga6823ee7967a8718@mail.gmail.com> <12956470806041552j54baf857uddd5a0db270ef701@mail.gmail.com> <48472701.3010602@noaa.gov> <12956470806051003y24bb4d9el1794c6055fce3357@mail.gmail.com> Message-ID: <4848814E.2080804@noaa.gov> Zhaojie Boulder wrote: > Hi Chris, > > When I typed which gcc,nothing happened,I checked the /usr/bin path > myself and gcc was not there. It looks like you haven't installed the entire package. I think you need XCode3.0(for 10.5) or XCode2.5(for 10.4), from here: http://developer.apple.com/tools/download/ you need the whole thing, all 1GB or so of it! Also, it should be somewhere on the Install disks that came with your OS. It's an optional install. I wish the had a command-line tools only installer, but I haven't seen that. -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 roger.herikstad at gmail.com Fri Jun 6 07:51:14 2008 From: roger.herikstad at gmail.com (Roger Herikstad) Date: Fri, 6 Jun 2008 13:51:14 +0800 Subject: [Pythonmac-SIG] running Cocoa application from python Message-ID: Hi all, I'm new to the list, so this is my first question. I hope it's not been extensively covered already; I couldn't find anything while browsing through the archives. Anyway, I'm developing a Cocoa application for plotting relatively large data sets (10000-100 000 points) containing waveforms recorded from electrophysiological experiments. The program allows for efficient panning through the data, zooming, as well as other features. Since I am doing most of my analysis in python, the idea occurred to me to try creating an interface of sort to my Cocoa application using python. Let me just say first that I'm using matplotlib for plotting smaller subsets of the data set, which works just fine, but I find it doesn't quite measure up to the task of efficiently viewing the entire data set. So, my question is if the list as any good advice as to how to unite these two tools? My idea for an approach so far is to somehow build the cocoa application into a bundle, and then load this from a python C-extension module, but I have not been able to find enough documentation on how to do this to get me started. I apologise if this has already been covered, or if there is some obvious source of information that I've overlooked, but I was hoping to find documenation/examples on how my approach could be implemented. Failing that, any other good approach will do. The functionality I'm looking for is basically being able to send data in the form of numpy arrays from a running python session to my application, which accepts input in the form of NSData. In my application, there is a function that basically takes an NSData object and converts into points that are then plotted by CoreGraphics drawing routines. I think there should be a way for me to gain access to this function in python, so that I can call it on my data, of course with some intermediary data conversion. Any advice is greatly appreciated. ~ Roger From abhiram.dwivedi at yahoo.com Fri Jun 6 08:42:12 2008 From: abhiram.dwivedi at yahoo.com (Abhiram Dwivedi) Date: Thu, 5 Jun 2008 23:42:12 -0700 (PDT) Subject: [Pythonmac-SIG] NewBie question: Building GUI for Mac Message-ID: <50894.54236.qm@web34402.mail.mud.yahoo.com> Hello, I want to know if its possible to build a standalone GUI app for Mac using python. I need to build some application and still going through pythong tutorials. It seems Cocoa is the only option, but I want to be sure before moving away from python. I need to integrate it with RSS and growl notifications as well. Thanks in advance. Abhiram Send instant messages to your online friends http://uk.messenger.yahoo.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From daniellord at mac.com Fri Jun 6 08:55:39 2008 From: daniellord at mac.com (Daniel Lord) Date: Thu, 05 Jun 2008 23:55:39 -0700 Subject: [Pythonmac-SIG] NewBie question: Building GUI for Mac In-Reply-To: <50894.54236.qm@web34402.mail.mud.yahoo.com> References: <50894.54236.qm@web34402.mail.mud.yahoo.com> Message-ID: <968F401A-2BC7-462B-81C5-8C8881B56DC0@mac.com> On Jun 5, 2008, at 23:42 PM, Abhiram Dwivedi wrote: > Hello, > > I want to know if its possible to build a standalone GUI app for Mac > using python. Yes it is. > I need to build some application and still going through pythong > tutorials. It seems Cocoa is the only option, Not true. wxPython, Tkinter, GTK, and others are all available. PyObjC/ Cocoa is Mac-only and the richest for a Mac-only app. There are trade- offs with every choice. > but I want to be sure before moving away from python. Using PyObjC (or any GUI framework) is not moving away from Python--it is using a platform-specific GUI framework as a UI adjunct to Python and little different from wxPtyhon or Tkinter except in platform scope. > > > I need to integrate it with RSS and growl notifications as well. I believe that can be done--try Googling for support: RSS is multi- platform while Growl is Mac-only. > > > Thanks in advance. > > Abhiram > > Send instant messages to your online friends http://uk.messenger.yahoo.com > _______________________________________________ > 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 deveritt at innotts.co.uk Fri Jun 6 10:42:48 2008 From: deveritt at innotts.co.uk (Dave Everitt) Date: Fri, 6 Jun 2008 09:42:48 +0100 Subject: [Pythonmac-SIG] gcc error in Mac OS X In-Reply-To: <4848814E.2080804@noaa.gov> References: <12956470806041550k7e2815b4ga6823ee7967a8718@mail.gmail.com> <12956470806041552j54baf857uddd5a0db270ef701@mail.gmail.com> <48472701.3010602@noaa.gov> <12956470806051003y24bb4d9el1794c6055fce3357@mail.gmail.com> <4848814E.2080804@noaa.gov> Message-ID: This may be useful: Darwin source code releases including all developer tools versions: http://www.opensource.apple.com/darwinsource/ Dave Everitt On 6 Jun 2008, at 01:14, Christopher Barker wrote: > It looks like you haven't installed the entire package. I think you > need XCode3.0(for 10.5) or XCode2.5(for 10.4), from here: > > http://developer.apple.com/tools/download/ > > you need the whole thing, all 1GB or so of it! > > Also, it should be somewhere on the Install disks that came with > your OS. It's an optional install. From hengist.podd at virgin.net Fri Jun 6 15:01:04 2008 From: hengist.podd at virgin.net (has) Date: Fri, 6 Jun 2008 14:01:04 +0100 Subject: [Pythonmac-SIG] running Cocoa application from python In-Reply-To: References: Message-ID: <7249EC40-95C3-4B80-B259-74A4DBA6F76B@virgin.net> Roger Herikstad wrote: > I'm developing a Cocoa > application for plotting relatively large data sets (10000-100 000 > points) containing waveforms recorded from electrophysiological > experiments. The program allows for efficient panning through the > data, zooming, as well as other features. Since I am doing most of my > analysis in python, the idea occurred to me to try creating an > interface of sort to my Cocoa application using python. Options: 1. Use IPC (e.g. Apple events, Distributed Objects) to communicate with your application from a separate Python process. 2. Embed a Python interpreter in your application and use PyObjC to interact with Cocoa objects from Python and vice-versa. (This topic came up last month if you check the archives.) Two variations on this: i. embed the interpreter directly in your application (simpler) ii. create an NSBundle-based plugin API (c.f. VoodooPad) which takes a suitably packaged Python interpreter or anything else you might want to add (more flexible). 3. Package your application's Model layer as a self-contained framework (as you suggest) which a Python process can import via PyObjC. Since you're dealing with fairly large amounts of data and speed is presumably a requirement, that probably eliminates #1. Of #2 and #3, #2 is probably the easier to implement as it can easily be added to an existing application without having to do lots of refactoring to break out the Model as an independent framework. #3 might be worth considering if you'd have other uses for such a framework, however. HTH has -- Control AppleScriptable applications from Python, Ruby and ObjC: http://appscript.sourceforge.net From ed at leafe.com Fri Jun 6 15:22:43 2008 From: ed at leafe.com (Ed Leafe) Date: Fri, 6 Jun 2008 09:22:43 -0400 Subject: [Pythonmac-SIG] NewBie question: Building GUI for Mac In-Reply-To: <50894.54236.qm@web34402.mail.mud.yahoo.com> References: <50894.54236.qm@web34402.mail.mud.yahoo.com> Message-ID: <7247C60F-1115-43EC-9661-E5FD0CC02242@leafe.com> On Jun 6, 2008, at 2:42 AM, Abhiram Dwivedi wrote: > I want to know if its possible to build a standalone GUI app for Mac > using python. I need to build some application and still going > through pythong tutorials. It seems Cocoa is the only option, but I > want to be sure before moving away from python. > > I need to integrate it with RSS and growl notifications as well. I'm one of the authors of Dabo, a Python framework for building GUI apps that run on Mac, Windows and Linux. Currently we're working on a client for Twitter; you can see what it looks like at http://dabodev.com/wiki/TwitterClient . The screenshots on that page are the app running under OS X, since that's what I use as my main development platform. -- Ed Leafe -- http://dabodev.com From kw at codebykevin.com Fri Jun 6 16:33:08 2008 From: kw at codebykevin.com (Kevin Walzer) Date: Fri, 06 Jun 2008 10:33:08 -0400 Subject: [Pythonmac-SIG] NewBie question: Building GUI for Mac In-Reply-To: <50894.54236.qm@web34402.mail.mud.yahoo.com> References: <50894.54236.qm@web34402.mail.mud.yahoo.com> Message-ID: <48494AA4.6080508@codebykevin.com> Abhiram Dwivedi wrote: > Hello, > > I want to know if its possible to build a standalone GUI app for Mac using python. I need to build some application and still going through pythong tutorials. It seems Cocoa is the only option, but I want to be sure before moving away from python. > > I need to integrate it with RSS and growl notifications as well. > > Thanks in advance. Ah, welcome to the wonderful world of Python GUI toolkits! So many to choose from... You can use PyObjC, wxPython, PyQt, and Tkinter--these are the major "native" GUI toolkits on Mac. Gtk/PyGtk is still an X11 application mainly (there's a port to running natively on OSX in progress, but it's not stable yet). A few quick notes: 1. PyObjC is, as you say, the "most-Mac" approach. It allows full access to the Cocoa frameworks. The main drawback to using PyObjC is that it is pretty much a thin wrapper over Objective-C, and so you really need to understand Objective-C to learn the Cocoa frameworks. There have been a lot of changes between PyObjC 2.0 and older versions, and a lot of the documentation is either out-of-date or nonexistent. The best approach to learning PyObjC these days seems to be to buy a good Cocoa textbook and translate the examples to Python. (Aaron Hillegass's book is highly recommended and has just been updated--see http://www.amazon.com/exec/obidos/ASIN/0321503619/bignerdranch-20.) 2. wxPython is cross-platform but looks great on the Mac with some attention to UI design, is well-documented (both in terms of available sample code online and books), and has a supportive community. It doesn't provide many Mac-specific hooks like PyObjC does, but it's quite sufficient for a nice application. One possible drawback to wxPython is that it runs on top of the Carbon frameworks, which are now deprecated on the Mac and will probably go away in the next several years. The plan to port wxPython to use Cocoa is somewhat hazy at this moment--wxWidget's Mac maintainer says he is implementing things gradually. 3. PyQt is also cross-platform, and also looks good on the Mac with some attention to UI design--it might take a bit more effort here. It also has a supportive community, and good documentation--lots of online code samples and a new book can help you get going. Like wxPython, it doesn't provide many Mac-specific hooks. PyQt currently runs on Carbon, but the underlying toolkit (Qt) is actively being ported to Cocoa by its developers, Trolltech, so it is heading in Apple's recommended direction. 4. Tkinter comes with Python, and is easier to learn than the other toolkits. Basic Tkinter is well-documented and has a supportive community around it. The drawback is that it is a more spartan toolkit out of the box, and you have to work with a lot of extension packages to get a more sophisticated GUI. I use Tkinter as my toolkit and have not found a compelling reason to switch, but I've also done a lot of work on assembling a set of libraries that give the UI of my Python program the polish that Mac users demand. Like wxPython and PyQt, Tkinter doesn't offer a lot of Mac-specific hooks, and it also runs on Carbon. The plan to port Tkinter to Cocoa is also somewhat hazy at this point; a developer says he's working on it, but no releases or even much public discussion of his progress have been posted. As far as the other components of your app, the available Python libraries for RSS would work (the best one is Mark Pilgrim's Universal Feed Parser, see http://feedparser.org/). Growl has Python bindings, and can also be called from the command-line via AppleScript. Hope this helps, Kevin -- Kevin Walzer Code by Kevin http://www.codebykevin.com From roger.herikstad at gmail.com Fri Jun 6 16:42:34 2008 From: roger.herikstad at gmail.com (Roger Herikstad) Date: Fri, 6 Jun 2008 22:42:34 +0800 Subject: [Pythonmac-SIG] running Cocoa application from python In-Reply-To: <7249EC40-95C3-4B80-B259-74A4DBA6F76B@virgin.net> References: <7249EC40-95C3-4B80-B259-74A4DBA6F76B@virgin.net> Message-ID: Hi, Thanks for your quick reply. I'm leaning towards case 2 i) as it seems the simpler. You are quite right in that speed is an issue for me, so I'll have to do some testing to see what suits my needs. I guess as long as I have access to the python interpreter, it might as well be from within the application itself. Thanks again! ~ Roger On Fri, Jun 6, 2008 at 9:01 PM, has wrote: > > Roger Herikstad wrote: > >> I'm developing a Cocoa >> application for plotting relatively large data sets (10000-100 000 >> points) containing waveforms recorded from electrophysiological >> experiments. The program allows for efficient panning through the >> data, zooming, as well as other features. Since I am doing most of my >> analysis in python, the idea occurred to me to try creating an >> interface of sort to my Cocoa application using python. > > Options: > > 1. Use IPC (e.g. Apple events, Distributed Objects) to communicate with your > application from a separate Python process. > > > 2. Embed a Python interpreter in your application and use PyObjC to interact > with Cocoa objects from Python and vice-versa. (This topic came up last > month if you check the archives.) Two variations on this: > > i. embed the interpreter directly in your application (simpler) > > ii. create an NSBundle-based plugin API (c.f. VoodooPad) which takes a > suitably packaged Python interpreter or anything else you might want to add > (more flexible). > > > 3. Package your application's Model layer as a self-contained framework (as > you suggest) which a Python process can import via PyObjC. > > > Since you're dealing with fairly large amounts of data and speed is > presumably a requirement, that probably eliminates #1. Of #2 and #3, #2 is > probably the easier to implement as it can easily be added to an existing > application without having to do lots of refactoring to break out the Model > as an independent framework. #3 might be worth considering if you'd have > other uses for such a framework, however. > > HTH > > has > -- > Control AppleScriptable applications from Python, Ruby and ObjC: > http://appscript.sourceforge.net > > _______________________________________________ > Pythonmac-SIG maillist - Pythonmac-SIG at python.org > http://mail.python.org/mailman/listinfo/pythonmac-sig > From rajanikanth at gmail.com Fri Jun 6 18:57:05 2008 From: rajanikanth at gmail.com (Rajanikanth Jammalamadaka) Date: Fri, 6 Jun 2008 09:57:05 -0700 Subject: [Pythonmac-SIG] Applescript equivalent in appscript Message-ID: <84bdef3c0806060957o29014339v5c4074413159d372@mail.gmail.com> Hi! Could some tell me what would be the appscript equivalent of the following applescript? tell application "SomeApplication" activate open "some file" delay 300 quit end tell Also, is it possible to call apple scripts from appscript? Ideally, I just want to use appscript as I have to process the log files created by the application after it quits. Thanks, Raj -- "For him who has conquered the mind, the mind is the best of friends; but for one who has failed to do so, his very mind will be the greatest enemy." Rajanikanth From hengist.podd at virgin.net Sat Jun 7 12:36:33 2008 From: hengist.podd at virgin.net (has) Date: Sat, 7 Jun 2008 11:36:33 +0100 Subject: [Pythonmac-SIG] Pythonmac-SIG] Applescript equivalent in appscript In-Reply-To: References: Message-ID: <1197464F-6867-4F05-9029-66442D74737B@virgin.net> Rajanikanth Jammalamadaka wrote: > Could some tell me what would be the appscript equivalent of the > following applescript? > > tell application "SomeApplication" > activate > open "some file" > delay 300 > quit > end tell ASTranslate is your friend. While it won't necessarily produce production-ready code, it will give you a pretty good idea of the equivalent syntax for each application command you send from AppleScript. The only bit it won't translate is the 'delay' command, as that's a scripting addition command, not an application command, and ASTranslate only does the latter. You need to use the osax module for that and translate it yourself. Anyway, with a bit of tidying your code should look something like this: from appscript import * import osax someapp = app('SomeApplication') stdadditions = osax.ScriptingAddition() someapp.activate() someapp.open(mactypes.Alias('/path/to/somefile')) stdadditions.delay(300) someapp.quit() > Also, is it possible to call apple scripts from appscript? Sure. For a specific recommendation, you'll need to say more about what it is you need to do, but here are the options (note: these will work for both AS source code and compiled script files): 1. Invoke the osascript command-line tool via os.command() or subprocess.Popen. It's a crude, lowest-common-denominator approach and a real pain for passing complex values such as lists and dates since everything has to go as UTF8 text, but it avoids any extra dependencies. 2. Use StandardAdditions' 'run script' command via the osax module. Since the osax module is built on appscript, the AppleScript's parameters and results will be converted between Python and Ruby types automatically, although you are still limited to calling 'run' handlers. 3. Use the osascript module included in the appscript package. This is a high-level Python wrapper around most of the OSA API, allowing you to load the AppleScript component into your process and call an AppleScript's handlers directly (with help from the aem module). Main disadvantage is that it isn't documented, so you'll need to grok the API from the module's source code. 4. Use Cocoa's NSAppleScript or OSAKit APIs via PyObjC. Main disadvantage of this approach is that you don't get the same level of type bridging that you do with #2 or #3 above unless you use objc- appscript's AEMCodecs class, which again means another dependency. HTH has -- Control AppleScriptable applications from Python, Ruby and ObjC: http://appscript.sourceforge.net From Laurent.Pierron at loria.fr Sat Jun 7 15:12:43 2008 From: Laurent.Pierron at loria.fr (Pierron Laurent) Date: Sat, 7 Jun 2008 15:12:43 +0200 Subject: [Pythonmac-SIG] Applescript equivalent in appscript In-Reply-To: <84bdef3c0806060957o29014339v5c4074413159d372@mail.gmail.com> References: <84bdef3c0806060957o29014339v5c4074413159d372@mail.gmail.com> Message-ID: <37542A6A-A7E2-4D75-8CF8-20F507286187@loria.fr> Another idea : put your script in myscript.scpt In python write : from subprocess import Popen p = Popen("osascript" + " myscript.scpt", shell=True) sts = os.waitpid(p.pid, 0) See : http://docs.python.org/lib/node536.html Look at man osascript, to know more about osascript. --- Laurent PIERRON Le 6 juin 08 ? 18:57, Rajanikanth Jammalamadaka a ?crit : > Hi! > > Could some tell me what would be the appscript equivalent of the > following applescript? > > tell application "SomeApplication" > activate > open "some file" > delay 300 > quit > end tell > > Also, is it possible to call apple scripts from appscript? > > Ideally, I just want to use appscript as I have to process the log > files created by the application after it quits. > > Thanks, > > Raj > > -- > "For him who has conquered the mind, the mind is the best of friends; > but for one who has failed to do so, his very mind will be the > greatest enemy." > > Rajanikanth > _______________________________________________ > Pythonmac-SIG maillist - Pythonmac-SIG at python.org > http://mail.python.org/mailman/listinfo/pythonmac-sig From rajanikanth at gmail.com Sat Jun 7 20:48:08 2008 From: rajanikanth at gmail.com (Rajanikanth Jammalamadaka) Date: Sat, 7 Jun 2008 11:48:08 -0700 Subject: [Pythonmac-SIG] Applescript equivalent in appscript In-Reply-To: <37542A6A-A7E2-4D75-8CF8-20F507286187@loria.fr> References: <84bdef3c0806060957o29014339v5c4074413159d372@mail.gmail.com> <37542A6A-A7E2-4D75-8CF8-20F507286187@loria.fr> Message-ID: <84bdef3c0806071148w44ed0af8h7db269b0ae1a7320@mail.gmail.com> Thanks for your reply Laurent. Also, could somebody tell me how to do this: Suppose the application pops up a window while its running and gives me two choices: Ok or Cancel how can I tell it to select the Ok option always? Thanks, Rajanikanth On Sat, Jun 7, 2008 at 6:12 AM, Pierron Laurent wrote: > Another idea : put your script in myscript.scpt > > In python write : > > from subprocess import Popen > p = Popen("osascript" + " myscript.scpt", shell=True) > sts = os.waitpid(p.pid, 0) > > See : http://docs.python.org/lib/node536.html > > Look at man osascript, to know more about osascript. > > --- > Laurent PIERRON > > Le 6 juin 08 ? 18:57, Rajanikanth Jammalamadaka a ?crit : > >> Hi! >> >> Could some tell me what would be the appscript equivalent of the >> following applescript? >> >> tell application "SomeApplication" >> activate >> open "some file" >> delay 300 >> quit >> end tell >> >> Also, is it possible to call apple scripts from appscript? >> >> Ideally, I just want to use appscript as I have to process the log >> files created by the application after it quits. >> >> Thanks, >> >> Raj >> >> -- >> "For him who has conquered the mind, the mind is the best of friends; >> but for one who has failed to do so, his very mind will be the >> greatest enemy." >> >> Rajanikanth >> _______________________________________________ >> Pythonmac-SIG maillist - Pythonmac-SIG at python.org >> http://mail.python.org/mailman/listinfo/pythonmac-sig > > -- "For him who has conquered the mind, the mind is the best of friends; but for one who has failed to do so, his very mind will be the greatest enemy." Rajanikanth From daniellord at mac.com Sat Jun 7 21:14:08 2008 From: daniellord at mac.com (Daniel Lord) Date: Sat, 07 Jun 2008 12:14:08 -0700 Subject: [Pythonmac-SIG] Applescript equivalent in appscript In-Reply-To: <84bdef3c0806071148w44ed0af8h7db269b0ae1a7320@mail.gmail.com> References: <84bdef3c0806060957o29014339v5c4074413159d372@mail.gmail.com> <37542A6A-A7E2-4D75-8CF8-20F507286187@loria.fr> <84bdef3c0806071148w44ed0af8h7db269b0ae1a7320@mail.gmail.com> Message-ID: <53E9C1DE-2587-43E2-ADE6-513977D8B0A7@mac.com> On Jun 7, 2008, at 11:48 AM, Rajanikanth Jammalamadaka wrote: > Thanks for your reply Laurent. > > Also, could somebody tell me how to do this: > > Suppose the application pops up a window while its running and gives > me two choices: Ok or Cancel > how can I tell it to select the Ok option always? I don't have time to work up a demo right now, but you should be able to use System Events: Apple info: http://www.apple.com/applescript/uiscripting/ Daniel --- "The secret of a life well-lived is not how many years you have in your life--it is how much life you put into your years" -- from a Sierra Mountain Guides newsletter From rajanikanth at gmail.com Sat Jun 7 21:31:45 2008 From: rajanikanth at gmail.com (Rajanikanth Jammalamadaka) Date: Sat, 7 Jun 2008 12:31:45 -0700 Subject: [Pythonmac-SIG] Applescript equivalent in appscript In-Reply-To: <53E9C1DE-2587-43E2-ADE6-513977D8B0A7@mac.com> References: <84bdef3c0806060957o29014339v5c4074413159d372@mail.gmail.com> <37542A6A-A7E2-4D75-8CF8-20F507286187@loria.fr> <84bdef3c0806071148w44ed0af8h7db269b0ae1a7320@mail.gmail.com> <53E9C1DE-2587-43E2-ADE6-513977D8B0A7@mac.com> Message-ID: <84bdef3c0806071231v2005ea04o738810edeb96f21c@mail.gmail.com> Thanks very much for the link Daniel. Raj On Sat, Jun 7, 2008 at 12:14 PM, Daniel Lord wrote: > > On Jun 7, 2008, at 11:48 AM, Rajanikanth Jammalamadaka wrote: > >> Thanks for your reply Laurent. >> >> Also, could somebody tell me how to do this: >> >> Suppose the application pops up a window while its running and gives >> me two choices: Ok or Cancel >> how can I tell it to select the Ok option always? > > > I don't have time to work up a demo right now, but you should be able to use > System Events: > > Apple info: http://www.apple.com/applescript/uiscripting/ > > Daniel > > --- > "The secret of a life well-lived is not how many years you have in your > life--it is how much life you put into your years" > -- from a Sierra Mountain Guides newsletter > -- "For him who has conquered the mind, the mind is the best of friends; but for one who has failed to do so, his very mind will be the greatest enemy." Rajanikanth From hexsprite at gmail.com Sat Jun 7 21:52:05 2008 From: hexsprite at gmail.com (Jordan Baker) Date: Sat, 7 Jun 2008 15:52:05 -0400 Subject: [Pythonmac-SIG] Applescript equivalent in appscript In-Reply-To: <53E9C1DE-2587-43E2-ADE6-513977D8B0A7@mac.com> References: <84bdef3c0806060957o29014339v5c4074413159d372@mail.gmail.com> <37542A6A-A7E2-4D75-8CF8-20F507286187@loria.fr> <84bdef3c0806071148w44ed0af8h7db269b0ae1a7320@mail.gmail.com> <53E9C1DE-2587-43E2-ADE6-513977D8B0A7@mac.com> Message-ID: <46E61E87-6226-4E16-868E-F3FDCA34BF45@gmail.com> On 7-Jun-08, at 3:14 PM, Daniel Lord wrote: > > On Jun 7, 2008, at 11:48 AM, Rajanikanth Jammalamadaka wrote: > >> Suppose the application pops up a window while its running and gives >> me two choices: Ok or Cancel >> how can I tell it to select the Ok option always? > > I don't have time to work up a demo right now, but you should be > able to use System Events: > > Apple info: http://www.apple.com/applescript/uiscripting/ Here's a blog post that has a Python example you can use: http://hexsprite.blogspot.com/2008/03/testing-osx-applications-with-python.html Heres some random snippets of code from a test that may or may not be useful that manipulate a file open dialog. myapp.windows['Choose a Folder'].sheets[1].buttons['Go'].click() myapp.windows['Choose a Folder'].buttons['Choose'].click() Have fun, -jordan (hexsprite) From rajanikanth at gmail.com Sun Jun 8 00:46:15 2008 From: rajanikanth at gmail.com (Rajanikanth Jammalamadaka) Date: Sat, 7 Jun 2008 15:46:15 -0700 Subject: [Pythonmac-SIG] Applescript equivalent in appscript In-Reply-To: <46E61E87-6226-4E16-868E-F3FDCA34BF45@gmail.com> References: <84bdef3c0806060957o29014339v5c4074413159d372@mail.gmail.com> <37542A6A-A7E2-4D75-8CF8-20F507286187@loria.fr> <84bdef3c0806071148w44ed0af8h7db269b0ae1a7320@mail.gmail.com> <53E9C1DE-2587-43E2-ADE6-513977D8B0A7@mac.com> <46E61E87-6226-4E16-868E-F3FDCA34BF45@gmail.com> Message-ID: <84bdef3c0806071546t6b4df2f7v143f97f70d22b1f0@mail.gmail.com> Thanks a lot for the links Jordan. Could you tell me why there is a "u" before some names in appscript for example: menus[u'Apple'] Thanks, Raj On Sat, Jun 7, 2008 at 12:52 PM, Jordan Baker wrote: > On 7-Jun-08, at 3:14 PM, Daniel Lord wrote: >> >> On Jun 7, 2008, at 11:48 AM, Rajanikanth Jammalamadaka wrote: >> >>> Suppose the application pops up a window while its running and gives >>> me two choices: Ok or Cancel >>> how can I tell it to select the Ok option always? >> >> I don't have time to work up a demo right now, but you should be able to >> use System Events: >> >> Apple info: http://www.apple.com/applescript/uiscripting/ > > Here's a blog post that has a Python example you can use: > > http://hexsprite.blogspot.com/2008/03/testing-osx-applications-with-python.html > > Heres some random snippets of code from a test that may or may not be useful > that manipulate a file open dialog. > > myapp.windows['Choose a Folder'].sheets[1].buttons['Go'].click() > myapp.windows['Choose a Folder'].buttons['Choose'].click() > > Have fun, > > -jordan (hexsprite) > -- "For him who has conquered the mind, the mind is the best of friends; but for one who has failed to do so, his very mind will be the greatest enemy." Rajanikanth From daniellord at mac.com Sun Jun 8 18:08:46 2008 From: daniellord at mac.com (Daniel Lord) Date: Sun, 08 Jun 2008 09:08:46 -0700 Subject: [Pythonmac-SIG] Applescript equivalent in appscript In-Reply-To: <84bdef3c0806071546t6b4df2f7v143f97f70d22b1f0@mail.gmail.com> References: <84bdef3c0806060957o29014339v5c4074413159d372@mail.gmail.com> <37542A6A-A7E2-4D75-8CF8-20F507286187@loria.fr> <84bdef3c0806071148w44ed0af8h7db269b0ae1a7320@mail.gmail.com> <53E9C1DE-2587-43E2-ADE6-513977D8B0A7@mac.com> <46E61E87-6226-4E16-868E-F3FDCA34BF45@gmail.com> <84bdef3c0806071546t6b4df2f7v143f97f70d22b1f0@mail.gmail.com> Message-ID: <2174A0B9-6AAB-4281-8D10-5396B5E07ADD@mac.com> On Jun 7, 2008, at 15:46 PM, Rajanikanth Jammalamadaka wrote: > Thanks a lot for the links Jordan. Could you tell me why there is a > "u" before some names in appscript > > for example: > menus[u'Apple'] > That's the Python code to designate a Unicode string. Daniel From hraban at fiee.net Sun Jun 8 20:04:28 2008 From: hraban at fiee.net (Henning Hraban Ramm) Date: Sun, 8 Jun 2008 20:04:28 +0200 Subject: [Pythonmac-SIG] NewBie question: Building GUI for Mac In-Reply-To: <48494AA4.6080508@codebykevin.com> References: <50894.54236.qm@web34402.mail.mud.yahoo.com> <48494AA4.6080508@codebykevin.com> Message-ID: <64C940C7-A5D4-4C1D-BDBB-F61ADEBF5B83@fiee.net> Am 2008-06-06 um 16:33 schrieb Kevin Walzer: > 2. wxPython is cross-platform but looks great on the Mac with some > attention to UI design, is well-documented (both in terms of > available sample code online and books), and has a supportive > community. It doesn't provide many Mac-specific hooks like PyObjC > does, but it's quite sufficient for a nice application. One possible > drawback to wxPython is that it runs on top of the Carbon > frameworks, which are now deprecated on the Mac and will probably go > away in the next several years. The plan to port wxPython to use > Cocoa is somewhat hazy at this moment--wxWidget's Mac maintainer > says he is implementing things gradually. I'd suggest to use dabo (as Ed suggested), its GUI part is a "more pythonic" wxPython wrapper (for now - there are plans to wrap also Tkinter and Qt, but nobody's working at that). dabo is a three layer framework actually, but you don't need to use the database stuff. Unfortunately a lot of useful functionality is still mostly undocumented. > 4. Tkinter comes with Python, and is easier to learn than the other > toolkits. Basic Tkinter is well-documented and has a supportive > community around it. The drawback is that it is a more spartan > toolkit out of the box, and you have to work with a lot of extension > packages to get a more sophisticated GUI. I use Tkinter as my > toolkit and have not found a compelling reason to switch, but I've > also done a lot of work on assembling a set of libraries that give > the UI of my Python program the polish that Mac users demand. Like > wxPython and PyQt, Tkinter doesn't offer a lot of Mac-specific > hooks, and it also runs on Carbon. The plan to port Tkinter to Cocoa > is also somewhat hazy at this point; a developer says he's working > on it, but no releases or even much public discussion of his > progress have been posted. In my experience Tkinter is much slower than wxPython. > Growl has Python bindings, and can also be called from the command- > line via AppleScript. Growl is very easy to use from Python, I do it all the time (and thus spreading Growl in our company). If you'd like to stay multi-platform, there's something similar ... for Windows: Snarl http://www.fullphat.net/ for Gnome: Mumbles http://www.mumbles-project.org/ Greetlings from Lake Constance! Hraban --- http://www.fiee.net https://www.cacert.org (I'm an assurer) From christopher.e.kees at usace.army.mil Mon Jun 9 17:52:24 2008 From: christopher.e.kees at usace.army.mil (Chris Kees) Date: Mon, 9 Jun 2008 10:52:24 -0500 Subject: [Pythonmac-SIG] 64-bit Python? In-Reply-To: <8C89BF8B-F9F6-4480-894E-285DE83F2DC8@mac.com> References: <302611.62100.qm@web52111.mail.re2.yahoo.com> <6D7FB3D2-1E11-4954-8EE8-C86879B8A366@kyngchaos.com> <34955.75.161.92.250.1212363153.squirrel@webmail.aoc.nrao.edu> <949D3F16-78A1-4FBD-A78F-C6B0E321E64D@nrao.edu> <67977D00-725B-4EB3-83A4-215BD8F78F16@usace.army.mil> <2B454361-D5DB-4B60-A00F-E99AA3C200AE@mac.com> <8C89BF8B-F9F6-4480-894E-285DE83F2DC8@mac.com> Message-ID: <96585BCA-1F5D-4822-B42C-2E2BAB59B5D5@usace.army.mil> FYI, I built this revision on an iMac and a MacPro without any trouble. I've run it in 32 and 64 bit mode on a non-graphical application. My gui uses Qt4, which I haven't been able to build as a 4-way universal yet. Chris On Jun 5, 2008, at 8:08 AM, Ronald Oussoren wrote: > > I've just commited support for building python as a 4-way universal > binary to the python repository (revision 63955). > > What does does: > > This patch adds a new configure argument on OSX: > --with-universal-archs=[32-bit|64-bit|all] > > When used with the --enable-universalsdk option this controls which > CPU architectures are includes in the framework. The default is 32- > bit, > meaning i386 and ppc. The most useful alternative is 'all', which > includes > all 4 CPU architectures supported by MacOS X (i386, ppc, x86_64 and > ppc64). > > This includes limited support for the Carbon bindings in 64-bit mode > as well, > limited because (a) I haven't done extensive testing and (b) a large > portion > of the Carbon API's aren't available in 64-bit mode anyway. > > I've also duplicated a feature of Apple's build of python: setting the > environment variable 'ARCHFLAGS' controls the '-arch' flags used for > building > extensions using distutils. > > > How to build the tree: > > - Checkout a copy of the python trunk (that is, the code that will > be python 2.6 in the future) > - in the root of that checkout: > - mkdir build > - cd build > - ../configure --with-framework-name=Python64' '--with-universal- > archs=all' '--enable-framework' '--enable-universalsdk=/' > 'MACOSX_DEPLOYMENT_TARGET=10.5' > - make > - sudo make install > > This will install a 4-way universal build of Python 2.6 in /Library/ > Frameworks/Python64.framework. Add the 'bin' directory inside the > framework to your shell's PATH to use this. Note how the framework > name is "Python64.framework" and not "Python.framework", this allows > you to easily remove this build. > > There a 3 variants of the command-line interpreter: python-32, > python-64 and python-all, python-32 will always run in 32-bit mode, > python-64 runs in 64-bit mode and python-all will run in whatever > mode is available on a machine. The command "python" without a > suffix is an alias for python-32 (because most GUI libraries aren't > available in 64-bit mode yet). > > Distutils will build extensions 4-way universal as well, use > ARCHFLAGS to override this (as documented on Apple's website). > > There are some minor issues in this build: > - the tools installed in /usr/local/bin don't include the 3 variants > - I haven't tested the Carbon bindings in 64-bit mode. > > > I'll be traveling for the next couple of weeks (WWDC and then some > down time) and will probably not be able to provide support during > this time. Please file bugs about any issues with this > configuration, preferable including patching ;-) > > Ronald From bwaters at nrao.edu Mon Jun 9 19:51:00 2008 From: bwaters at nrao.edu (Boyd Waters) Date: Mon, 9 Jun 2008 11:51:00 -0600 Subject: [Pythonmac-SIG] 64-bit Python? In-Reply-To: <96585BCA-1F5D-4822-B42C-2E2BAB59B5D5@usace.army.mil> References: <302611.62100.qm@web52111.mail.re2.yahoo.com> <6D7FB3D2-1E11-4954-8EE8-C86879B8A366@kyngchaos.com> <34955.75.161.92.250.1212363153.squirrel@webmail.aoc.nrao.edu> <949D3F16-78A1-4FBD-A78F-C6B0E321E64D@nrao.edu> <67977D00-725B-4EB3-83A4-215BD8F78F16@usace.army.mil> <2B454361-D5DB-4B60-A00F-E99AA3C200AE@mac.com> <8C89BF8B-F9F6-4480-894E-285DE83F2DC8@mac.com> <96585BCA-1F5D-4822-B42C-2E2BAB59B5D5@usace.army.mil> Message-ID: <7DEC184F-54BE-4E16-87A3-F63FD4262E0D@nrao.edu> On Jun 9, 2008, at 9:52 AM, Chris Kees wrote: > My gui uses Qt4, which I haven't been able to build as a 4-way > universal yet. I have a four-way universal of Qt4.4-beta (the Cocoa version) as a MacPort... -------------- next part -------------- A non-text attachment was scrubbed... Name: qt4-mac-alpha1.tbz Type: application/octet-stream Size: 10602 bytes Desc: not available URL: -------------- next part -------------- From Chris.Barker at noaa.gov Mon Jun 9 20:54:10 2008 From: Chris.Barker at noaa.gov (Christopher Barker) Date: Mon, 09 Jun 2008 11:54:10 -0700 Subject: [Pythonmac-SIG] [Matplotlib-users] What is the recommended way of Installing MPL 0.9.8 on Leopard? In-Reply-To: <6382066a0806091053i7545c758k5412f76adf24612f@mail.gmail.com> References: <311EDFFD-A563-4CD5-B0FC-CE189C9F2402@samuelsmith.org> <484ADCD7.1020700@fastmail.fm> <6382066a0806071246m33d293fbi7da9cdb78ffe684b@mail.gmail.com> <484D6253.1000107@noaa.gov> <6382066a0806091053i7545c758k5412f76adf24612f@mail.gmail.com> Message-ID: <484D7C52.5060304@noaa.gov> Charlie Moad wrote: > I have had horrible luck with bdist_mpkg for the last several > months. Do you remember what the problems were? It certainly used to work, though it's been a good while since I've tried. > I did poke at the setuptools code and it looks like we just > won't be able to make it happy with a universal binary. The preferred > extensions have ppc or i386 in them depending on your arch. hmm -- it seems that folks are finding that re-naming them does the trick, so we could just re-name -- maybe even have two identical fields that happen to have different names -- though maybe this wouldn't fool easy_install and pyPi I think the > best way to move forward is to just post binaries for each architecture > and not have a universal build. Please, Please, Please, NO! I really think it is very, very important to have universal binaries. We really want as few possibilities for what-to-install as possible. Also, py2app is pretty much out of the question if you're processor dependent. I really appreciate that you've been building Universal -- I'll see what I can do to help facilitate that continuing. For what it's worth, Apple appears to be dropping PPC support for 10.6, so someday, this will be a non-issue (quite a ways out, though...) Have you tried communicating with either the setuptools folks and.or the pyhtonmac folks that work on py2app (maybe on only Ronald now -- what ever happened to Bob I.?) about how to fix these issues. > I statically compile in universal builds of libpng and freetype so > end-users don't have to worry about it. I just build these by hand What a pain -- I do wish we could get more of these support libraries setup so you can just call Configure with a flag -- oh well. > the process is documented here: > http://ipython.scipy.org/moin/MatplotlibOSXBuildNotes Thanks, that does look easier than other ways I've seen it done. I'm going to give it a try. -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 cwmoad at gmail.com Mon Jun 9 21:07:25 2008 From: cwmoad at gmail.com (Charlie Moad) Date: Mon, 9 Jun 2008 15:07:25 -0400 Subject: [Pythonmac-SIG] [Matplotlib-users] What is the recommended way of Installing MPL 0.9.8 on Leopard? In-Reply-To: <484D7C52.5060304@noaa.gov> References: <311EDFFD-A563-4CD5-B0FC-CE189C9F2402@samuelsmith.org> <484ADCD7.1020700@fastmail.fm> <6382066a0806071246m33d293fbi7da9cdb78ffe684b@mail.gmail.com> <484D6253.1000107@noaa.gov> <6382066a0806091053i7545c758k5412f76adf24612f@mail.gmail.com> <484D7C52.5060304@noaa.gov> Message-ID: <6382066a0806091207y4f77fc55y8a703b4934a0293e@mail.gmail.com> > > > I think the > >> best way to move forward is to just post binaries for each architecture >> and not have a universal build. >> > > Please, Please, Please, NO! This seems to be the only solution to make "easy_install matplotlib" actually work. > > I really think it is very, very important to have universal binaries. We > really want as few possibilities for what-to-install as possible. > > Also, py2app is pretty much out of the question if you're processor > dependent. > > I really appreciate that you've been building Universal -- I'll see what I > can do to help facilitate that continuing. > > For what it's worth, Apple appears to be dropping PPC support for 10.6, so > someday, this will be a non-issue (quite a ways out, though...) I thought this was a rumor? A rumor that my G4 powerbook really hates. > > Have you tried communicating with either the setuptools folks and.or the > pyhtonmac folks that work on py2app (maybe on only Ronald now -- what ever > happened to Bob I.?) about how to fix these issues. > No. Communicating with the setuptools people makes more sense to me, but I am not currently on the distutils list. - Charlie -------------- next part -------------- An HTML attachment was scrubbed... URL: From bwaters at nrao.edu Mon Jun 9 21:18:29 2008 From: bwaters at nrao.edu (Boyd Waters) Date: Mon, 9 Jun 2008 13:18:29 -0600 Subject: [Pythonmac-SIG] 64-bit Python? In-Reply-To: <7DEC184F-54BE-4E16-87A3-F63FD4262E0D@nrao.edu> References: <302611.62100.qm@web52111.mail.re2.yahoo.com> <6D7FB3D2-1E11-4954-8EE8-C86879B8A366@kyngchaos.com> <34955.75.161.92.250.1212363153.squirrel@webmail.aoc.nrao.edu> <949D3F16-78A1-4FBD-A78F-C6B0E321E64D@nrao.edu> <67977D00-725B-4EB3-83A4-215BD8F78F16@usace.army.mil> <2B454361-D5DB-4B60-A00F-E99AA3C200AE@mac.com> <8C89BF8B-F9F6-4480-894E-285DE83F2DC8@mac.com> <96585BCA-1F5D-4822-B42C-2E2BAB59B5D5@usace.army.mil> <7DEC184F-54BE-4E16-87A3-F63FD4262E0D@nrao.edu> Message-ID: <5768781A-B985-4577-A9A7-ADBC6FB3A302@nrao.edu> Oy, the Trolls dropped a second alpha of the Cocoa Qt4 today... It's going to be a busy week... On Jun 9, 2008, at 11:51 AM, Boyd Waters wrote: > > On Jun 9, 2008, at 9:52 AM, Chris Kees wrote: > >> My gui uses Qt4, which I haven't been able to build as a 4-way >> universal yet. > > I have a four-way universal of Qt4.4-beta (the Cocoa version) as a > MacPort... > > > > > > From Chris.Barker at noaa.gov Mon Jun 9 21:30:27 2008 From: Chris.Barker at noaa.gov (Christopher Barker) Date: Mon, 09 Jun 2008 12:30:27 -0700 Subject: [Pythonmac-SIG] [Matplotlib-users] What is the recommended way of Installing MPL 0.9.8 on Leopard? In-Reply-To: <6382066a0806091207y4f77fc55y8a703b4934a0293e@mail.gmail.com> References: <311EDFFD-A563-4CD5-B0FC-CE189C9F2402@samuelsmith.org> <484ADCD7.1020700@fastmail.fm> <6382066a0806071246m33d293fbi7da9cdb78ffe684b@mail.gmail.com> <484D6253.1000107@noaa.gov> <6382066a0806091053i7545c758k5412f76adf24612f@mail.gmail.com> <484D7C52.5060304@noaa.gov> <6382066a0806091207y4f77fc55y8a703b4934a0293e@mail.gmail.com> Message-ID: <484D84D3.8090104@noaa.gov> Charlie Moad wrote: > best way to move forward is to just post binaries for each > architecture and not have a universal build. > Please, Please, Please, NO! > This seems to be the only solution to make "easy_install matplotlib" > actually work. Well, I guess that question then is: how important is it for "easy_install matplotlib" to work. Is it so bad to have to download something? Anyway, I suppose there could be non-universal eggs for that, if there is still a universal egg that can be downloaded. > I thought this was a rumor? A rumor that my G4 powerbook really hates. Well rumor or no, they could change their mind any day anyway. I'm pretty happy with my Dual G5 desktop too, but I'm not even running 10.5 yet, anyway. > No. Communicating with the setuptools people makes more sense to me, > but I am not currently on the distutils list. nor am I, but maybe I'll post a message and see what we get. Just to be clear: Python version: 2.5 Universal from python.org $ python setupegg.py bdist_egg creates an egg called: matplotlib-0.91.1-py2.5-macosx-10.3-fat.egg which will install with: $ easy_install name_of_egg.egg if the name is changed to: matplotlib-0.91.1-py2.5.egg on both OS-X 10.5 and 10.4 (and 10.3.9?) However, if the full name is used (with -fat, etc), then easy_install tried to go download it from the net instead. Also: easy_install matplotlib will not find the binary on PyPI, but rather try to download and build the source. Have I got that right? Have you tried putting the binary up on pyPI with some of these different names to see if it will find them? -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 ronaldoussoren at mac.com Mon Jun 9 22:13:53 2008 From: ronaldoussoren at mac.com (Ronald Oussoren) Date: Mon, 09 Jun 2008 13:13:53 -0700 Subject: [Pythonmac-SIG] [Matplotlib-users] What is the recommended way of Installing MPL 0.9.8 on Leopard? In-Reply-To: <6382066a0806091207y4f77fc55y8a703b4934a0293e@mail.gmail.com> References: <311EDFFD-A563-4CD5-B0FC-CE189C9F2402@samuelsmith.org> <484ADCD7.1020700@fastmail.fm> <6382066a0806071246m33d293fbi7da9cdb78ffe684b@mail.gmail.com> <484D6253.1000107@noaa.gov> <6382066a0806091053i7545c758k5412f76adf24612f@mail.gmail.com> <484D7C52.5060304@noaa.gov> <6382066a0806091207y4f77fc55y8a703b4934a0293e@mail.gmail.com> Message-ID: <0AC5B928-27E2-4BB8-8D40-C72BB2FBBAAA@mac.com> On 9 Jun, 2008, at 12:07, Charlie Moad wrote: > > I think the > best way to move forward is to just post binaries for each > architecture and not have a universal build. > > Please, Please, Please, NO! > > This seems to be the only solution to make "easy_install matplotlib" > actually work. No, the better solution is to investigate why a universal binary wouldn't work and try to fix that. Platform-specific eggs make it very hard to distribute apps in a user-friendly way. Ronald -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 2224 bytes Desc: not available URL: From cwmoad at gmail.com Mon Jun 9 22:15:18 2008 From: cwmoad at gmail.com (Charlie Moad) Date: Mon, 9 Jun 2008 16:15:18 -0400 Subject: [Pythonmac-SIG] [Matplotlib-users] What is the recommended way of Installing MPL 0.9.8 on Leopard? In-Reply-To: <484D84D3.8090104@noaa.gov> References: <311EDFFD-A563-4CD5-B0FC-CE189C9F2402@samuelsmith.org> <484ADCD7.1020700@fastmail.fm> <6382066a0806071246m33d293fbi7da9cdb78ffe684b@mail.gmail.com> <484D6253.1000107@noaa.gov> <6382066a0806091053i7545c758k5412f76adf24612f@mail.gmail.com> <484D7C52.5060304@noaa.gov> <6382066a0806091207y4f77fc55y8a703b4934a0293e@mail.gmail.com> <484D84D3.8090104@noaa.gov> Message-ID: <6382066a0806091315x2d20ff77kf2cbd7eb5ad89b72@mail.gmail.com> On Mon, Jun 9, 2008 at 3:30 PM, Christopher Barker wrote: > Charlie Moad wrote: > >> best way to move forward is to just post binaries for each >> architecture and not have a universal build. >> Please, Please, Please, NO! >> This seems to be the only solution to make "easy_install matplotlib" >> actually work. >> > > Well, I guess that question then is: how important is it for "easy_install > matplotlib" to work. Is it so bad to have to download something? Anyway, I > suppose there could be non-universal eggs for that, if there is still a > universal egg that can be downloaded. > > I thought this was a rumor? A rumor that my G4 powerbook really hates. >> > > Well rumor or no, they could change their mind any day anyway. I'm pretty > happy with my Dual G5 desktop too, but I'm not even running 10.5 yet, > anyway. > > No. Communicating with the setuptools people makes more sense to me, but >> I am not currently on the distutils list. >> > > nor am I, but maybe I'll post a message and see what we get. Just to be > clear: > > Python version: 2.5 Universal from python.org > > $ python setupegg.py bdist_egg > > creates an egg called: > > matplotlib-0.91.1-py2.5-macosx-10.3-fat.egg > > which will install with: > > $ easy_install name_of_egg.egg > > if the name is changed to: > > matplotlib-0.91.1-py2.5.egg > > on both OS-X 10.5 and 10.4 (and 10.3.9?) > > However, if the full name is used (with -fat, etc), then easy_install tried > to go download it from the net instead. > > Also: > easy_install matplotlib > > will not find the binary on PyPI, but rather try to download and build the > source. > > Have I got that right? > > Have you tried putting the binary up on pyPI with some of these different > names to see if it will find them? > I tried a variation on the SF download page and it doesn't help. Here is the doc I found. http://peak.telecommunity.com/DevCenter/PkgResources#platform-utilities pkg_resources.get_build_platform() returns *macosx-10.3-i386 *on my iMac, but *macosx-10.3-ppc *on my g4. This is what the file extensions are depending on the machine I build on. *NOTE* the "-fat" extension is not outputted from setuptools. I just renamed it to that so people would know it is a fat binary. I'm not a fan of renaming it to "matplotlib-0.91.1-py2.5.egg" since it implies a platform-independent binary. - Charlie -------------- next part -------------- An HTML attachment was scrubbed... URL: From cwmoad at gmail.com Mon Jun 9 22:19:02 2008 From: cwmoad at gmail.com (Charlie Moad) Date: Mon, 9 Jun 2008 16:19:02 -0400 Subject: [Pythonmac-SIG] [Matplotlib-users] What is the recommended way of Installing MPL 0.9.8 on Leopard? In-Reply-To: <0AC5B928-27E2-4BB8-8D40-C72BB2FBBAAA@mac.com> References: <311EDFFD-A563-4CD5-B0FC-CE189C9F2402@samuelsmith.org> <484ADCD7.1020700@fastmail.fm> <6382066a0806071246m33d293fbi7da9cdb78ffe684b@mail.gmail.com> <484D6253.1000107@noaa.gov> <6382066a0806091053i7545c758k5412f76adf24612f@mail.gmail.com> <484D7C52.5060304@noaa.gov> <6382066a0806091207y4f77fc55y8a703b4934a0293e@mail.gmail.com> <0AC5B928-27E2-4BB8-8D40-C72BB2FBBAAA@mac.com> Message-ID: <6382066a0806091319p51324779y2ecd5614f660febb@mail.gmail.com> On Mon, Jun 9, 2008 at 4:13 PM, Ronald Oussoren wrote: > > On 9 Jun, 2008, at 12:07, Charlie Moad wrote: > > >> I think the >> best way to move forward is to just post binaries for each architecture >> and not have a universal build. >> >> Please, Please, Please, NO! >> >> This seems to be the only solution to make "easy_install matplotlib" >> actually work. >> > > No, the better solution is to investigate why a universal binary wouldn't > work and try to fix that. Platform-specific eggs make it very hard to > distribute apps in a user-friendly way. > Ok, so let's probe the distutils list and ask them to add support for fat binaries. You would think they could inspect the CFLAGS or library output with the "file" command to see if the build is outputting fat binaries. - Charlie -------------- next part -------------- An HTML attachment was scrubbed... URL: From ronaldoussoren at mac.com Mon Jun 9 22:38:57 2008 From: ronaldoussoren at mac.com (Ronald Oussoren) Date: Mon, 09 Jun 2008 13:38:57 -0700 Subject: [Pythonmac-SIG] [Matplotlib-users] What is the recommended way of Installing MPL 0.9.8 on Leopard? In-Reply-To: <6382066a0806091319p51324779y2ecd5614f660febb@mail.gmail.com> References: <311EDFFD-A563-4CD5-B0FC-CE189C9F2402@samuelsmith.org> <484ADCD7.1020700@fastmail.fm> <6382066a0806071246m33d293fbi7da9cdb78ffe684b@mail.gmail.com> <484D6253.1000107@noaa.gov> <6382066a0806091053i7545c758k5412f76adf24612f@mail.gmail.com> <484D7C52.5060304@noaa.gov> <6382066a0806091207y4f77fc55y8a703b4934a0293e@mail.gmail.com> <0AC5B928-27E2-4BB8-8D40-C72BB2FBBAAA@mac.com> <6382066a0806091319p51324779y2ecd5614f660febb@mail.gmail.com> Message-ID: On 9 Jun, 2008, at 13:19, Charlie Moad wrote: > On Mon, Jun 9, 2008 at 4:13 PM, Ronald Oussoren > wrote: > > On 9 Jun, 2008, at 12:07, Charlie Moad wrote: > > > I think the > best way to move forward is to just post binaries for each > architecture and not have a universal build. > > Please, Please, Please, NO! > > This seems to be the only solution to make "easy_install matplotlib" > actually work. > > No, the better solution is to investigate why a universal binary > wouldn't work and try to fix that. Platform-specific eggs make it > very hard to distribute apps in a user-friendly way. > > Ok, so let's probe the distutils list and ask them to add support > for fat binaries. You would think they could inspect the CFLAGS or > library output with the "file" command to see if the build is > outputting fat binaries. Why not investigate yourself? Distutils already supports fat binaries when building using a python.org build. The python build that Apple ships did have some issues and those should be easy to fix, and to be honest I can't recall if they are already fixed. Automaticly detecting which architectures are present in a binary would be harder, distutils determines the platform architecture before building the extensions and not afterwards. 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: 2224 bytes Desc: not available URL: From Chris.Barker at noaa.gov Tue Jun 10 00:11:58 2008 From: Chris.Barker at noaa.gov (Christopher Barker) Date: Mon, 09 Jun 2008 15:11:58 -0700 Subject: [Pythonmac-SIG] [Matplotlib-users] What is the recommended way of Installing MPL 0.9.8 on Leopard? In-Reply-To: References: <311EDFFD-A563-4CD5-B0FC-CE189C9F2402@samuelsmith.org> <484ADCD7.1020700@fastmail.fm> <6382066a0806071246m33d293fbi7da9cdb78ffe684b@mail.gmail.com> <484D6253.1000107@noaa.gov> <6382066a0806091053i7545c758k5412f76adf24612f@mail.gmail.com> <484D7C52.5060304@noaa.gov> <6382066a0806091207y4f77fc55y8a703b4934a0293e@mail.gmail.com> <0AC5B928-27E2-4BB8-8D40-C72BB2FBBAAA@mac.com> <6382066a0806091319p51324779y2ecd5614f660febb@mail.gmail.com> Message-ID: <484DAAAE.8020901@noaa.gov> Ronald Oussoren wrote: > On 9 Jun, 2008, at 13:19, Charlie Moad wrote: >> Ok, so let's probe the distutils list and ask them to add support for >> fat binaries. You would think they could inspect the CFLAGS or >> library output with the "file" command to see if the build is >> outputting fat binaries. > > Why not investigate yourself? Distutils already supports fat binaries > when building using a python.org build. The python build that Apple > ships did have some issues and those should be easy to fix, and to be > honest I can't recall if they are already fixed. > > Automaticly detecting which architectures are present in a binary would > be harder, distutils determines the platform architecture before > building the extensions and not afterwards. I don't think the issue here is building -- I think the eggs that are built do work -- the issue here is easy_install knowing what to look for, and being able to find that, in the case of a Universal build. It seems when you run "easy_install matplotlib", fro man intel machine -- it goes and looks for a i386 binary, and when you run it from a PPC, it looks for a ppc binary -- and in neither case does it find the Universal one. So we need to either: 1) Know it is a Universal build of Python, and thus look for, and finid, a Universal binary. 2) Or accept a Universal binary when it is looking for either an Intle of PPC version. I like the first option better, but have no idea how all this works. -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 collinsjames9 at gmail.com Mon Jun 9 18:01:34 2008 From: collinsjames9 at gmail.com (james collins) Date: Mon, 9 Jun 2008 12:01:34 -0400 Subject: [Pythonmac-SIG] python settings Message-ID: <7F37595E-B2BF-475B-9048-558BCE3A7CB9@gmail.com> hello, i own a macbook pro running mac os x 10.5.2. Just wondering about my MacPython settings. I have two versions of MacPython on my computer. One version came with the developer(programming) tools which was an optional install. The other version i downloaded from the web. I added PYTHONPATH to my .bash_profile file, and now when i open terminal i can import scripts, from my home folder in a folder i called python. My question is when i open my IDLE of the version of python which i downloaded i can't import scripts which i have in my home folder in a folder I called python. My IDLE gives me an error message saying it can't import the scripts. I was told that when i added PYTHONPATH to my .bash_profile file that it should work for both versions of python. I was also told to research the settings of the version i downloaded. Any help would be appreciated. From vivacarlie at gmail.com Sat Jun 14 04:36:37 2008 From: vivacarlie at gmail.com (Nehemiah Dacres) Date: Fri, 13 Jun 2008 21:36:37 -0500 Subject: [Pythonmac-SIG] python settings In-Reply-To: <7F37595E-B2BF-475B-9048-558BCE3A7CB9@gmail.com> References: <7F37595E-B2BF-475B-9048-558BCE3A7CB9@gmail.com> Message-ID: <65fadfc30806131936l21f43ce4j3197cc47776f6568@mail.gmail.com> On Mon, Jun 9, 2008 at 11:01 AM, james collins wrote: > hello, > i own a macbook pro running mac os x 10.5.2. Just wondering about my > MacPython settings. > I have two versions of MacPython on my computer. One version came with the > developer(programming) tools which was an optional install. The other > version i downloaded from the web. I added PYTHONPATH to my .bash_profile > file, and now when i open terminal i can import scripts, from my home folder > in a folder i called python. My question is when i open my IDLE of the > version of python which i downloaded i can't import scripts which i have in > my home folder in a folder I called python. My IDLE gives me an error > message saying it can't import the scripts. I was told that when i added > PYTHONPATH to my .bash_profile file that it should work for both versions of > python. I was also told to research the settings of the version i > downloaded. Any help would be appreciated. > _______________________________________________ > Pythonmac-SIG maillist - Pythonmac-SIG at python.org > http://mail.python.org/mailman/listinfo/pythonmac-sig > when you start python from the terminal, the first response is 3 lines containing the version, build time, compiler and version and OS for example, mine on leopard Python 2.5.1 adsl-70-130-244-74:~ Nehemiah$ python Python 2.5.1 (r251:54869, Apr 18 2007, 22:08:04) [GCC 4.0.1 (Apple Computer, Inc. build 5367)] on darwin Type "help", "copyright", "credits" or "license" for more information. and on linux Python 2.5.1 (r251:54863, Oct 5 2007, 13:50:07) [GCC 4.1.3 20070929 (prerelease) (Ubuntu 4.1.2-16ubuntu2)] on linux2 Type "help", "copyright", "credits" or "license" for more information. see? -- "lalalalala! it's not broken because I can use it" http://linux.slashdot.org/comments.pl?sid=194281&threshold=1&commentsort=0&mode=thread&cid=15927703 -------------- next part -------------- An HTML attachment was scrubbed... URL: From elescargot at hotmail.com Tue Jun 17 09:48:02 2008 From: elescargot at hotmail.com (El Duvelle) Date: Tue, 17 Jun 2008 07:48:02 +0000 Subject: [Pythonmac-SIG] [py2app] how to make a .app running on mac intel 10.5 Message-ID: Hello everybody, I'd like to make a .app file from a python program I've written. For this, I use py2app and I've got a mac on which I've installed all the packages I need in order to run my python program. But the processor of this mac doesn't correspond to the processor of the mac on which the .app must run, which is an Intel with mac os 10.5. So my question is : are there options in py2app which would enable to make the .app running for another processor than the one on which py2app is installed, and more precisely an Intel with mac os 10.5 ? I hope someone will know about this... And sorry for my bad english. Thanks. Leos _________________________________________________________________ Avec Hotmail, vos e-mails vous suivent partout ! Mettez Hotmail sur votre mobile ! http://www.messengersurvotremobile.com/?d=hotmail -------------- next part -------------- An HTML attachment was scrubbed... URL: From Chris.Barker at noaa.gov Tue Jun 17 19:10:30 2008 From: Chris.Barker at noaa.gov (Christopher Barker) Date: Tue, 17 Jun 2008 10:10:30 -0700 Subject: [Pythonmac-SIG] [py2app] how to make a .app running on mac intel 10.5 In-Reply-To: References: Message-ID: <4857F006.3040403@noaa.gov> El Duvelle wrote: > So my question is : are there options in py2app which would enable to > make the .app running for another processor than the one on which py2app > is installed, and more precisely an Intel with mac os 10.5 ? If you run py2app with the version of Python you get from python.org (Universal Framework Build), you will get a Universal build, and it should run on any Mac running OS-X 10.4 and above, and maybe even 10.3.9. Sometimes things "just work"! -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 pdorange at mac.com Tue Jun 17 22:24:41 2008 From: pdorange at mac.com (Pierre-Alain Dorange) Date: Tue, 17 Jun 2008 22:24:41 +0200 Subject: [Pythonmac-SIG] [py2app] [pygame] can't build my app Message-ID: <208E1221-B4F2-4652-99DD-2C548C9724FE@mac.com> First, sorry for my bad english, I got trouble building in app with pygame. I run on MacOS X 10.4.11 as advice from pygame i've installed Python 2.5.2 pygame prebuild package 1.8.0rc5 for python 2.5 I've also installed py2app. For developping it works fine, but i was not able to build any app with pygame. I've tested some apps from py2app example : it works, but the pygame sample (alien from py2app) break on building... It happen the same with my own software... I check all i can, but i'm a beginner and it's my first attemp to build an app. py2app break on "Graphing ..._numericsndarray.so (ppc)", then traceback the call : File "setup.py", line 26, in app=[dict(script="microwar.py", plist=plist)], File "/Library/Frameworks/Python.framework/Versions/2.5/lib/ python2.5/distutils/core.py", line 151, in setup dist.run_commands() File "/Library/Frameworks/Python.framework/Versions/2.5/lib/ python2.5/distutils/dist.py", line 974, in run_commands self.run_command(cmd) File "/Library/Frameworks/Python.framework/Versions/2.5/lib/ python2.5/distutils/dist.py", line 994, in run_command cmd_obj.run() File "/Library/Frameworks/Python.framework/Versions/2.5/lib/ python2.5/site-packages/Py2App/py2app/build_app.py", line 389, in run self._run() File "/Library/Frameworks/Python.framework/Versions/2.5/lib/ python2.5/site-packages/Py2App/py2app/build_app.py", line 510, in _run self.run_normal() File "/Library/Frameworks/Python.framework/Versions/2.5/lib/ python2.5/site-packages/Py2App/py2app/build_app.py", line 570, in run_normal self.create_binaries(py_files, pkgdirs, extensions, loader_files) File "/Library/Frameworks/Python.framework/Versions/2.5/lib/ python2.5/site-packages/Py2App/py2app/build_app.py", line 672, in create_binaries platfiles = mm.run() File "/Library/Frameworks/Python.framework/Versions/2.5/lib/ python2.5/site-packages/Py2App/macholib/MachOStandalone.py", line 101, in run mm.run_file(fn) File "/Library/Frameworks/Python.framework/Versions/2.5/lib/ python2.5/site-packages/Py2App/macholib/MachOGraph.py", line 67, in run_file m = MachO(pathname) File "/Library/Frameworks/Python.framework/Versions/2.5/lib/ python2.5/site-packages/Py2App/macholib/MachO.py", line 254, in __init__ self.load() File "/Library/Frameworks/Python.framework/Versions/2.5/lib/ python2.5/site-packages/Py2App/macholib/MachO.py", line 287, in load self.archs = self.load_fat(fat, fh) File "/Library/Frameworks/Python.framework/Versions/2.5/lib/ python2.5/site-packages/Py2App/macholib/MachO.py", line 271, in load_fat archs.append(MachOArch(self.filename, archHeader.offset, endian="<")) File "/Library/Frameworks/Python.framework/Versions/2.5/lib/ python2.5/site-packages/Py2App/macholib/MachO.py", line 59, in __init__ self.load(file(filename, "rb")) File "/Library/Frameworks/Python.framework/Versions/2.5/lib/ python2.5/site-packages/Py2App/macholib/MachO.py", line 92, in load raise ValueError, "Unknown load command: %d" % (cmd_load.cmd,) ValueError: Unknown load command: 27 -- Pierre-Alain Dorange Blog Citoyen de Cognac Le Retour de l'Autruche -------------- next part -------------- An HTML attachment was scrubbed... URL: From Chris.Barker at noaa.gov Tue Jun 17 23:59:15 2008 From: Chris.Barker at noaa.gov (Christopher Barker) Date: Tue, 17 Jun 2008 14:59:15 -0700 Subject: [Pythonmac-SIG] "MacPython Addons..." In-Reply-To: <7DE74ED0-DF30-4C17-80ED-F6819AB3376F@mac.com> References: <65fadfc30712190650o3b19c79ap16a003aa14853d36@mail.gmail.com> <476947BF.5070300@noaa.gov> <65fadfc30712191042sc5ff9d9m374066e12f7d3245@mail.gmail.com> <47699959.9040302@noaa.gov> <5CD83E48-A39B-481C-85CD-92B095EA5637@cwi.nl> <08Jan2.123335pst.58696@synergy1.parc.xerox.com> <7DE74ED0-DF30-4C17-80ED-F6819AB3376F@mac.com> Message-ID: <485833B3.2070801@noaa.gov> An old thread... Ronald Oussoren wrote: > I think we should start a small project for "MacPython Addons", this > project will install: > > * Hotfix for distutils to ensure that distutils builds univeral binaries > (32-bit only at first) > * (possibly) hotfix to ensure that you can install '-fat-' eggs on 10.5 > * /Applications/Python-2.5/IDLE.app Did this ever get anywhere? In particular, the "-fat-" eggs issue keeps coming, up, lately in matplotlib and enthought tools... -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 Jun 18 00:06:11 2008 From: Chris.Barker at noaa.gov (Christopher Barker) Date: Tue, 17 Jun 2008 15:06:11 -0700 Subject: [Pythonmac-SIG] [py2app] [pygame] can't build my app In-Reply-To: <208E1221-B4F2-4652-99DD-2C548C9724FE@mac.com> References: <208E1221-B4F2-4652-99DD-2C548C9724FE@mac.com> Message-ID: <48583553.3040100@noaa.gov> Pierre-Alain Dorange wrote: > I've also installed py2app. how? which version? > "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/Py2App/macholib/MachO.py", > line 92, in load > raise ValueError, "Unknown load command: %d" % (cmd_load.cmd,) > ValueError: Unknown load command: 27 I've seen similar errors, which were fixed by updated macholib (used by py2app): easy_install macholib==dev Ronald, is this still recommended? -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 Jun 18 18:16:31 2008 From: Chris.Barker at noaa.gov (Christopher Barker) Date: Wed, 18 Jun 2008 09:16:31 -0700 Subject: [Pythonmac-SIG] [py2app] [pygame] can't build my app In-Reply-To: <3BEA5548-51DE-4122-ABAB-D41D22E02C7D@mac.com> References: <208E1221-B4F2-4652-99DD-2C548C9724FE@mac.com> <48583553.3040100@noaa.gov> <3BEA5548-51DE-4122-ABAB-D41D22E02C7D@mac.com> Message-ID: <485934DF.4080608@noaa.gov> Pierre-Alain Dorange wrote: >>> I've also installed py2app. >> how? which version? > > py2app 0.2.5 for python 2.5 That is quite old -- I wouldn't expect it to work. Also, which Python2.5? I think you're best off with the python.org version (not the one Apple has delivered with OS-X 10.5) > Looking again on the web, i found many version for py2app... > > 0.4.2 at http://svn.pythonmac.org/py2app/py2app/trunk/ > 0.3.6 at http://pypi.python.org/pypi/py2app/ I'm running 0.3.6, which it looks like what you'd get with easy_install py2app. However, it might be worth giving the SVN version a try. >> easy_install macholib==dev > > don't know you to do that, sorry. make sure you have easy_install: http://peak.telecommunity.com/DevCenter/EasyInstall then type: easy_install macholib==dev in the terminal. (note: this may not be required with a recent version of py2app) -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 janssen at parc.com Thu Jun 19 04:04:11 2008 From: janssen at parc.com (Bill Janssen) Date: Wed, 18 Jun 2008 19:04:11 PDT Subject: [Pythonmac-SIG] appscript and Firefox Message-ID: <08Jun18.190416pdt."58698"@synergy1.parc.xerox.com> I'm finally trying to learn appscript, and I thought I'd write a little system monitor that goes around to my various open applications and logs what files/URLs I'm looking at. For Safari, this is easy: print app('Safari').windows.first.current_tab.URL() but I can't figure out how to get the current URL for Firefox. There's a bug report at https://bugzilla.mozilla.org/show_bug.cgi?id=427448 which seems to show that you can get the URL with the applescript fragment set url to get <> of window 1 as text at least for older versions of Firefox. But how do I write "<>" in appscript? Bill From daniellord at mac.com Thu Jun 19 05:11:37 2008 From: daniellord at mac.com (Daniel Lord) Date: Wed, 18 Jun 2008 20:11:37 -0700 Subject: [Pythonmac-SIG] appscript and Firefox In-Reply-To: <08Jun18.190416pdt.58698@synergy1.parc.xerox.com> References: <08Jun18.190416pdt.58698@synergy1.parc.xerox.com> Message-ID: On Jun 18, 2008, at 19:04 PM, Bill Janssen wrote: > I'm finally trying to learn appscript, and I thought I'd write a > little system monitor that goes around to my various open applications > and logs what files/URLs I'm looking at. For Safari, this is easy: > > print app('Safari').windows.first.current_tab.URL() > > but I can't figure out how to get the current URL for Firefox. > There's a bug report at > https://bugzilla.mozilla.org/show_bug.cgi?id=427448 which seems to > show that you can get the URL with the applescript fragment > > set url to get <> of window 1 as text > > at least for older versions of Firefox. > > But how do I write "<>" in appscript? In Safari "URL" is a property of the "tab" class so you can get that property by indexing the windows and tab you want. Generally, the double angle brackets indicate the application being addressed doesn't recognize based on its dictionary so those symbols are inserted in the script (from what I know--maybe someone smarter than me can chime in).. I just looked at the Firefox 3 Dictionary (with Script Debugger 4) and I don't see a URL class nor even tab and windows elements to use to select which URL you wanted from the browser. There is a slip of a dictionary there, but not enough to do much as far as I can tell. Maybe it is planned for the future but not implemented. I even looked at the menus to see if one could use System Events but nothing looked easy. It looks impossible from my perspective and knowledge, maybe someone smarter has it figured out. I am using this version: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9) Gecko/ 2008051202 Firefox/3.0 Daniel > > > Bill > _______________________________________________ > Pythonmac-SIG maillist - Pythonmac-SIG at python.org > http://mail.python.org/mailman/listinfo/pythonmac-sig From janssen at parc.com Thu Jun 19 05:18:02 2008 From: janssen at parc.com (Bill Janssen) Date: Wed, 18 Jun 2008 20:18:02 PDT Subject: [Pythonmac-SIG] appscript and Firefox In-Reply-To: References: <08Jun18.190416pdt.58698@synergy1.parc.xerox.com> Message-ID: <08Jun18.201806pdt."58698"@synergy1.parc.xerox.com> Thanks, Daniel. > It looks impossible from my perspective and knowledge, maybe someone > smarter has it figured out. Apparently someone has, from the scrap of Applescript I pointed to before (OK, here it is again: https://bugzilla.mozilla.org/show_bug.cgi?id=427448). > Generally, the double angle brackets indicate the application being > addressed doesn't recognize based on its dictionary so those symbols > are inserted in the script (from what I know--maybe someone smarter > than me can chime in).. Fine -- how do I write that in appscript? Bill From daniellord at mac.com Thu Jun 19 05:41:43 2008 From: daniellord at mac.com (Daniel Lord) Date: Wed, 18 Jun 2008 20:41:43 -0700 Subject: [Pythonmac-SIG] appscript and Firefox In-Reply-To: <08Jun18.201806pdt.58698@synergy1.parc.xerox.com> References: <08Jun18.190416pdt.58698@synergy1.parc.xerox.com> <08Jun18.201806pdt.58698@synergy1.parc.xerox.com> Message-ID: <82D5A230-D247-4A12-8102-E8FB701E06A7@mac.com> On Jun 18, 2008, at 20:18 PM, Bill Janssen wrote: > Thanks, Daniel. > >> It looks impossible from my perspective and knowledge, maybe someone >> smarter has it figured out. > > Apparently someone has, from the scrap of Applescript I pointed to > before (OK, here it is again: > https://bugzilla.mozilla.org/show_bug.cgi?id=427448).You cannot I'll repeat: the angle brackets mean Applescript cannot find that class in the dictionary of the application you are addressing. that means you are asking the application for something it doesn't know about at least as far as Applescript can tell it directly. It's like trying to get the value of an undefined variable--it cannot be done because it does not exists. But you can enter raw apple events which is what you want to do. See here for and explanation of the brackets and how to enter them: http://developer.apple.com/documentation/AppleScript/Conceptual/AppleScriptLangGuide/conceptual/ASLR_raw_data.html How you'll find out which apple events to call without a dictionary is a task you'll have to figure out--they aren't defined in a dictionary like they should be. THey might be compiled into the resources in the bundle, but I don't have the time nor inclination to go down that road. Maybe you might ask the Adium developers how they found them. And as for why the Firefox developers would support raw events but not write a dictionary is not only a mystery, but also very, very bad form. But it's a question for them not me as to why they chose that path. Daniel From hengist.podd at virgin.net Thu Jun 19 14:26:53 2008 From: hengist.podd at virgin.net (Hengist Podd) Date: Thu, 19 Jun 2008 12:26:53 +0000 (GMT) Subject: [Pythonmac-SIG] appscript and Firefox Message-ID: <2104195981.1540371213878413544.JavaMail.mail@webmail01> An HTML attachment was scrubbed... URL: From janssen at parc.com Thu Jun 19 16:46:09 2008 From: janssen at parc.com (Bill Janssen) Date: Thu, 19 Jun 2008 07:46:09 PDT Subject: [Pythonmac-SIG] appscript and Firefox In-Reply-To: <82D5A230-D247-4A12-8102-E8FB701E06A7@mac.com> References: <08Jun18.190416pdt.58698@synergy1.parc.xerox.com> <08Jun18.201806pdt.58698@synergy1.parc.xerox.com> <82D5A230-D247-4A12-8102-E8FB701E06A7@mac.com> Message-ID: <08Jun19.074616pdt."58698"@synergy1.parc.xerox.com> > But you can enter raw apple events which is what you want to do. > See here for and explanation of the brackets and how to enter them: > http://developer.apple.com/documentation/AppleScript/Conceptual/AppleScriptLangGuide/conceptual/ASLR_raw_data.html Right, thanks, that's helpful. But how do I deal with them in appscript? > THey might be compiled into the resources in the bundle, but I don't > have the time nor inclination to go down that road. Well, I can take a look. > And as for why the Firefox developers would support raw events but not > write a dictionary is not only a mystery, but also very, very bad form. Yes, everyone seems to think so. And apparently, the answer is that they *don't* support them. Bill From janssen at parc.com Thu Jun 19 18:03:39 2008 From: janssen at parc.com (Bill Janssen) Date: Thu, 19 Jun 2008 09:03:39 PDT Subject: [Pythonmac-SIG] appscript and Firefox In-Reply-To: <2104195981.1540371213878413544.JavaMail.mail@webmail01> References: <2104195981.1540371213878413544.JavaMail.mail@webmail01> Message-ID: <08Jun19.090342pdt."58698"@synergy1.parc.xerox.com> Thanks, this is what I needed to know -- I'm hoping to avoid diving into the source. I'll download FF 2 and try it out. > appscript.terminology.dump() Not sure what you mean here. appscript.terminology doesn't have a "dump" function... Bill From Chris.Barker at noaa.gov Thu Jun 19 18:40:52 2008 From: Chris.Barker at noaa.gov (Christopher Barker) Date: Thu, 19 Jun 2008 09:40:52 -0700 Subject: [Pythonmac-SIG] [py2app] [pygame] can't build my app In-Reply-To: <34F82E2D-235D-4739-981F-7AE6148E79AA@mac.com> References: <208E1221-B4F2-4652-99DD-2C548C9724FE@mac.com> <48583553.3040100@noaa.gov> <3BEA5548-51DE-4122-ABAB-D41D22E02C7D@mac.com> <485934DF.4080608@noaa.gov> <34F82E2D-235D-4739-981F-7AE6148E79AA@mac.com> Message-ID: <485A8C14.4010806@noaa.gov> (do try to keep this on the pythonmac list....) Pierre-Alain Dorange wrote: > Ok i follow the step from py2app documentation : > - uninstall py2app > - get package with easy_install (it find 0.3.6 and install fine) > > At that step running my setup.py fail with the same error but at a > different step, in the loading section (see log-1). > > I then test easy_install macholib==dev but it also fail... (see log-2) darn. Maybe Ronald will chime in -- it's worth a try. > Searching for macholib==dev > Reading http://pypi.python.org/simple/macholib/ > Reading http://undefined.org/python/#macholib > Best match: macholib dev > Downloading > http://svn.pythonmac.org/macholib/macholib/trunk#egg=macholib-dev > Doing subversion checkout from > http://svn.pythonmac.org/macholib/macholib/trunk to > /tmp/easy_install-l3o8mp/trunk > sh: line 1: svn: command not found > Processing trunk > error: Couldn't find a setup script in /tmp/easy_install-l3o8mp/trunk This looks like it failed to properly install the dev version of macholib -- try getting SVN installed (see below) then try again. > I'll do some test with the SVN Trunk version, but i don't know how to > begin, do i have to download each file one by one > from http://svn.pythonmac.org/py2app/py2app/trunk/ ? no, you can download the whole thing with an SVN client. I think the command line client comes with Apple's developer tools (I'm not sure how I installed it, it's been a while, but if you don't have it, you can try: http://www.collab.net/downloads/community/). Once you have an svn client, you should be able to do: $ svn checkout http://svn.pythonmac.org/py2app/py2app/trunk/ pyappSVN You could also use a GUI client, like syncrosvn: http://www.syncrosvnclient.com/ svnX: http://www.lachoseinteractive.net/en/community/subversion/svnx SCPlugin: http://scplugin.tigris.org/ ZigVersion: http://zigzig.com/ RapidSVN: http://rapidsvn.tigris.org/ SmartSVN: http://www.syntevo.com/smartsvn/index.html Versions: http://www.versionsapp.com/ I use the command line, so I have no opinion about any of these. > Thanks > > log-1 > -------------------------------------------------- > copying > /Library/Frameworks/Python.framework/Versions/2.5/lib/libncurses.5.dylib > -> > /Volumes/Documents/PAD/Dev/PyGame/MicroWar/Source/dist/MicroWar.app/Contents/Frameworks > Traceback (most recent call last): > File > "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/py2app-0.3.6-py2.5.egg/py2app/build_app.py", > line 548, in _run > self.run_normal() > File > "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/py2app-0.3.6-py2.5.egg/py2app/build_app.py", > line 619, in run_normal > self.create_binaries(py_files, pkgdirs, extensions, loader_files) > File > "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/py2app-0.3.6-py2.5.egg/py2app/build_app.py", > line 732, in create_binaries > platfiles = mm.run() > File "build/bdist.macosx-10.3-i386/egg/macholib/MachOStandalone.py", > line 102, in run > mm.run_file(fn) > File "build/bdist.macosx-10.3-i386/egg/macholib/MachOGraph.py", line > 66, in run_file > m = self.createNode(MachO, pathname) > File "build/bdist.macosx-10.3-i386/egg/macholib/MachOStandalone.py", > line 23, in createNode > res = super(FilteredMachOGraph, self).createNode(cls, name) > File "build/bdist.macosx-10.3-i386/egg/altgraph/ObjectGraph.py", line > 148, in createNode > m = cls(name, *args, **kw) > File "build/bdist.macosx-10.3-i386/egg/macholib/MachO.py", line 61, in > __init__ > self.load(file(filename, 'rb')) > File "build/bdist.macosx-10.3-i386/egg/macholib/MachO.py", line 71, in > load > self.load_fat(fh) > File "build/bdist.macosx-10.3-i386/egg/macholib/MachO.py", line 82, in > load_fat > self.load_header(fh, arch.offset, arch.size) > File "build/bdist.macosx-10.3-i386/egg/macholib/MachO.py", line 106, > in load_header > hdr = MachOHeader(self, fh, offset, size, magic, hdr, endian) > File "build/bdist.macosx-10.3-i386/egg/macholib/MachO.py", line 146, > in __init__ > self.load(fh) > File "build/bdist.macosx-10.3-i386/egg/macholib/MachO.py", line 178, > in load > raise ValueError("Unknown load command: %d" % (cmd_load.cmd,)) > ValueError: Unknown load command: 27 >> /Volumes/Documents/PAD/Dev/PyGame/MicroWar/Source/build/bdist.macosx-10.3-i386/egg/macholib/MachO.py(178)load() > > > log-2 > -------------------------------------------------- > Searching for macholib==dev > Reading http://pypi.python.org/simple/macholib/ > Reading http://undefined.org/python/#macholib > Best match: macholib dev > Downloading > http://svn.pythonmac.org/macholib/macholib/trunk#egg=macholib-dev > Doing subversion checkout from > http://svn.pythonmac.org/macholib/macholib/trunk to > /tmp/easy_install-l3o8mp/trunk > sh: line 1: svn: command not found > Processing trunk > error: Couldn't find a setup script in /tmp/easy_install-l3o8mp/trunk > > -- > Pierre-Alain Dorange > > Blog Citoyen de Cognac > Le Retour de l'Autruche > -- 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 janssen at parc.com Thu Jun 19 19:16:45 2008 From: janssen at parc.com (Bill Janssen) Date: Thu, 19 Jun 2008 10:16:45 PDT Subject: [Pythonmac-SIG] appscript can't talk to 'System Events'? Message-ID: <08Jun19.101648pdt."58698"@synergy1.parc.xerox.com> So, here's another appscript problem: /Users/wjanssen 2 % python Python 2.5.1 (r251:54863, Jan 17 2008, 19:35:16) [GCC 4.0.1 (Apple Inc. build 5465)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> from appscript import * >>> app('System Events').processes() app('System Events').processes() Traceback (most recent call last): File "", line 1, in File "/Library/Python/2.5/site-packages/appscript-0.18.1-py2.5-macosx-10.5-ppc.egg/appscript/reference.py", line 509, in __getattr__ File "/Library/Python/2.5/site-packages/appscript-0.18.1-py2.5-macosx-10.5-ppc.egg/appscript/reference.py", line 231, in File "/Library/Python/2.5/site-packages/appscript-0.18.1-py2.5-macosx-10.5-ppc.egg/appscript/reference.py", line 216, in connect File "/Library/Python/2.5/site-packages/appscript-0.18.1-py2.5-macosx-10.5-ppc.egg/aem/send/__init__.py", line 50, in __init__ File "/Library/Python/2.5/site-packages/appscript-0.18.1-py2.5-macosx-10.5-ppc.egg/aem/send/connect.py", line 159, in localapp File "/Library/Python/2.5/site-packages/appscript-0.18.1-py2.5-macosx-10.5-ppc.egg/aem/send/connect.py", line 60, in _launchApplication aem.send.connect.CantLaunchApplicationError: CantLaunchApplicationError -10810: An unknown error has occurred. >>> import appscript >>> appscript.__version__ '0.18.1' >>> This is OS X 10.5.3, Apple's Python, PPC G4, appscript installed with easy_install as per the documentation. This is kind of a blocker for me :-). Bill From janssen at parc.com Thu Jun 19 20:15:46 2008 From: janssen at parc.com (Bill Janssen) Date: Thu, 19 Jun 2008 11:15:46 PDT Subject: [Pythonmac-SIG] converting Mac 'path' to file path in appscript? Message-ID: <08Jun19.111548pdt."58698"@synergy1.parc.xerox.com> Can someone tell me how to convert the old Classic-style paths returned from many of the appscript properties to real OS X file paths? Is there some appscript constructor which takes a path as an argument and returns a Unix path? Here's an example: >>> app('Microsoft Word').active_document.path() u'wolfe:downloads' >>> That should be "/downloads". By the way, I'll update the appscript Wiki page with the answers I get. Bill From hraban at fiee.net Thu Jun 19 22:01:28 2008 From: hraban at fiee.net (Henning Hraban Ramm) Date: Thu, 19 Jun 2008 22:01:28 +0200 Subject: [Pythonmac-SIG] converting Mac 'path' to file path in appscript? In-Reply-To: <08Jun19.111548pdt."58698"@synergy1.parc.xerox.com> References: <08Jun19.111548pdt."58698"@synergy1.parc.xerox.com> Message-ID: Am 2008-06-19 um 20:15 schrieb Bill Janssen: > Can someone tell me how to convert the old Classic-style paths > returned from many of the appscript properties to real OS X file > paths? Is there some appscript constructor which takes a path > as an argument and returns a Unix path? > > Here's an example: > >>>> app('Microsoft Word').active_document.path() > u'wolfe:downloads' >>>> > > That should be "/downloads". > > By the way, I'll update the appscript Wiki page with the answers I > get. Have a look at mactypes.File and mactypes.Alias: http://appscript.sourceforge.net/py-appscript/doc/mactypes/index.html Greetlings from Lake Constance! Hraban --- http://www.fiee.net https://www.cacert.org (I'm an assurer) From hraban at fiee.net Thu Jun 19 22:13:03 2008 From: hraban at fiee.net (Henning Hraban Ramm) Date: Thu, 19 Jun 2008 22:13:03 +0200 Subject: [Pythonmac-SIG] appscript can't talk to 'System Events'? In-Reply-To: <08Jun19.101648pdt."58698"@synergy1.parc.xerox.com> References: <08Jun19.101648pdt."58698"@synergy1.parc.xerox.com> Message-ID: <0C1AFC77-26BD-4464-B214-333F2F152D1A@fiee.net> Am 2008-06-19 um 19:16 schrieb Bill Janssen: > So, here's another appscript problem: > > > /Users/wjanssen 2 % python > Python 2.5.1 (r251:54863, Jan 17 2008, 19:35:16) > [GCC 4.0.1 (Apple Inc. build 5465)] on darwin > Type "help", "copyright", "credits" or "license" for more information. >>>> from appscript import * >>>> app('System Events').processes() > app('System Events').processes() It works for me (OSX 10.5 intel): Python 2.5.2 (r252:60911, Feb 22 2008, 07:57:53) [GCC 4.0.1 (Apple Computer, Inc. build 5363)] on darwin from appscript import k, app se = app('System Events') se app(u'/System/Library/CoreServices/System Events.app') se.processes() [app(u'/System/Library/CoreServices/System Events.app').application_processes[u'loginwindow'], app(u'/System/ Library/CoreServices/System Events.app').application_processes[u'Folder ... I first thought System Events might be a scripting addition (osax): http://appscript.sourceforge.net/py-appscript/doc/osax/index.html http://developer.apple.com/documentation/AppleScript/Conceptual/AppleScriptX/Concepts/as_related_apps.html#/ /apple_ref/doc/uid/TP40001570-1149074-BAJEIHJA Greetlings from Lake Constance! Hraban --- http://www.fiee.net https://www.cacert.org (I'm an assurer) From janssen at parc.com Thu Jun 19 23:01:41 2008 From: janssen at parc.com (Bill Janssen) Date: Thu, 19 Jun 2008 14:01:41 PDT Subject: [Pythonmac-SIG] appscript can't talk to 'System Events'? In-Reply-To: <0C1AFC77-26BD-4464-B214-333F2F152D1A@fiee.net> References: <08Jun19.101648pdt."58698"@synergy1.parc.xerox.com> <0C1AFC77-26BD-4464-B214-333F2F152D1A@fiee.net> Message-ID: <08Jun19.140144pdt."58698"@synergy1.parc.xerox.com> Greetings from San Francisco Bay! Thanks for looking at this; it turned out that the problem was that I was running Leopard's X11. My system.log had lots of this: Jun 18 09:52:43 mymachine System Events[32983]: Unable to find class: X11Application, exiting Jun 18 09:52:43 mymachine com.apple.launchd[108] ([0x0-0x3a33a3].com.apple.systemevents[32983]): Exited with exit code: 1 Once I quit X11, things started working again. That's a bug somewhere -- running a buggy app shouldn't be able to keep System Events from running -- but I can't figure out where well enough to report it. Bill > Am 2008-06-19 um 19:16 schrieb Bill Janssen: > > > So, here's another appscript problem: > > > > > > /Users/wjanssen 2 % python > > Python 2.5.1 (r251:54863, Jan 17 2008, 19:35:16) > > [GCC 4.0.1 (Apple Inc. build 5465)] on darwin > > Type "help", "copyright", "credits" or "license" for more information. > >>>> from appscript import * > >>>> app('System Events').processes() > > app('System Events').processes() > > > It works for me (OSX 10.5 intel): > > Python 2.5.2 (r252:60911, Feb 22 2008, 07:57:53) > [GCC 4.0.1 (Apple Computer, Inc. build 5363)] on darwin > from appscript import k, app > se = app('System Events') > se > app(u'/System/Library/CoreServices/System Events.app') > se.processes() > [app(u'/System/Library/CoreServices/System > Events.app').application_processes[u'loginwindow'], app(u'/System/ > Library/CoreServices/System > Events.app').application_processes[u'Folder ... > > > > I first thought System Events might be a scripting addition (osax): > http://appscript.sourceforge.net/py-appscript/doc/osax/index.html > > http://developer.apple.com/documentation/AppleScript/Conceptual/AppleScriptX/Concepts/as_related_apps.html#/ > /apple_ref/doc/uid/TP40001570-1149074-BAJEIHJA > > > > Greetlings from Lake Constance! > Hraban > --- > http://www.fiee.net > https://www.cacert.org (I'm an assurer) > > > > _______________________________________________ > Pythonmac-SIG maillist - Pythonmac-SIG at python.org > http://mail.python.org/mailman/listinfo/pythonmac-sig From janssen at parc.com Thu Jun 19 23:05:51 2008 From: janssen at parc.com (Bill Janssen) Date: Thu, 19 Jun 2008 14:05:51 PDT Subject: [Pythonmac-SIG] converting Mac 'path' to file path in appscript? In-Reply-To: References: <08Jun19.111548pdt."58698"@synergy1.parc.xerox.com> Message-ID: <08Jun19.140559pdt."58698"@synergy1.parc.xerox.com> > > Here's an example: > > > >>>> app('Microsoft Word').active_document.path() > > u'wolfe:downloads' > >>>> > > > > That should be "/downloads". > > > > By the way, I'll update the appscript Wiki page with the answers I > > get. > > Have a look at mactypes.File and mactypes.Alias: > http://appscript.sourceforge.net/py-appscript/doc/mactypes/index.html Thanks. I think you're suggesting that I could take the "path" and turn it into a File, and use the "path" property of the File to get the POSIX path. Would it be too much to ask for a one-liner showing how to do that? Using TextEdit if you don't have Word? Bill From pdorange at mac.com Thu Jun 19 23:54:55 2008 From: pdorange at mac.com (Pierre-Alain Dorange) Date: Thu, 19 Jun 2008 23:54:55 +0200 Subject: [Pythonmac-SIG] [py2app] [pygame] can't build my app In-Reply-To: <485A8C14.4010806@noaa.gov> References: <208E1221-B4F2-4652-99DD-2C548C9724FE@mac.com> <48583553.3040100@noaa.gov> <3BEA5548-51DE-4122-ABAB-D41D22E02C7D@mac.com> <485934DF.4080608@noaa.gov> <34F82E2D-235D-4739-981F-7AE6148E79AA@mac.com> <485A8C14.4010806@noaa.gov> Message-ID: Le 19 juin 08 ? 18:40, Christopher Barker a ?crit : > no, you can download the whole thing with an SVN client. I think > the command line client comes with Apple's developer tools (I'm not > sure how I installed it, it's been a while, but if you don't have > it, you can try: http://www.collab.net/downloads/community/). Once > you have an svn client, you should be able to do: > > $ svn checkout http://svn.pythonmac.org/py2app/py2app/trunk/ pyappSVN Many thanks, it helped a lot ! i just got some trouble to install svn correctly (adding to $PATH, that was my first time). then a also have to "svn" modulegraph (because the py2app 0.4.2 trunk can't find the version it needs). After this easy_install macholib works And finally py2app build my app without errors ! Thanks. -- Pierre-Alain Dorange Blog Citoyen de Cognac Le Retour de l'Autruche -------------- next part -------------- An HTML attachment was scrubbed... URL: From velman at cox.net Fri Jun 20 01:15:02 2008 From: velman at cox.net (John Velman) Date: Thu, 19 Jun 2008 16:15:02 -0700 Subject: [Pythonmac-SIG] A simple app: Develop on Leopard, use on Tiger Message-ID: <20080619231502.GA419@cox.net> I'm a bit out of my depth here, new to Mac, comfortable with Python, comfortable with SQL, but lots left to learn. Problem: My daughter is starting a small business renting a certain kind of prop to the movie industry. She needs to a) keep track of her stock, b) keep track of rentals, c) issue invoices, and other stuff not yet fully defined. She has a powerbook with Tiger. I have an iMac with Leopard (10.5.3 as of this afternoon). We looked into Quickbooks (which was recommended by lots of people), but it is clearly not adapted to her needs. It looks to me like a database, sql, form, view, and report problem. For starters (time was short), I set up some spreadsheets on NeoOffice, installed NeoOffice in her machine, and did the paperwork she needed by manual sorts, filters, and so on. OK, but for the long term... My current thinking is (but I've a lot to learn) something like this: Python as the application platform. SQLite as an embedded database. Would be nice to use QT for user interface. Outputs needed in PDF format, and possible PDF with fillable forms. I can probably get my daughter to upgrade to Leopard, but if an app could be developed on Leopard and run on Tiger, it would be preferable. Am I out of my mind? Thanks, John Velman From tom.weir at safe.com Fri Jun 20 02:13:31 2008 From: tom.weir at safe.com (Tom Weir) Date: Thu, 19 Jun 2008 17:13:31 -0700 Subject: [Pythonmac-SIG] A simple app: Develop on Leopard, use on Tiger In-Reply-To: <20080619231502.GA419@cox.net> References: <20080619231502.GA419@cox.net> Message-ID: <703195ad0806191713g728c594j884d3716db47d456@mail.gmail.com> On Thu, Jun 19, 2008 at 4:15 PM, John Velman wrote: > I'm a bit out of my depth here, new to Mac, comfortable with Python, > comfortable with SQL, but lots left to learn. > > Problem: > > > Am I out of my mind? > I think it really depends on how fast you need a solution, how much time you have, and the fun-factor involved. Qt is a very nice GUI framework, but it does have a bit of a learning curve. If you choose to go down this path, I'd suggest picking up the PyQt book. Another alternative would be to take a look at either Bento, or its big brother, FileMaker. The cost is obviously higher, but Filemaker in particular is designed for this sort of application. Tom -------------- next part -------------- An HTML attachment was scrubbed... URL: From velman at cox.net Fri Jun 20 02:47:03 2008 From: velman at cox.net (John Velman) Date: Thu, 19 Jun 2008 17:47:03 -0700 Subject: [Pythonmac-SIG] A simple app: Develop on Leopard, use on Tiger In-Reply-To: <5AE9A023-A935-45FA-91D5-F4FDBF2692C5@gmx.de> References: <20080619231502.GA419@cox.net> <5AE9A023-A935-45FA-91D5-F4FDBF2692C5@gmx.de> Message-ID: <20080620004703.GB419@cox.net> On Fri, Jun 20, 2008 at 01:49:35AM +0200, Georg Seifert wrote: > I think it is much easier to do this with cocoa. You can use use xCode to > start with a cocoa python app, use interface builder to set up the > interface. So you can code in a known language but can benefit from the > rich macosx framework. > > you will find tons of tutorials if you search for "pybjc tutorial". > Thanks, I'll check this out. Sounds promising. > I did this with a small project earlier this year and got i running on > Tiger, don't know if I really needed xcode 2.5 or not > > Georg > Am 20.06.2008 um 01:15 schrieb John Velman: > >> I'm a bit out of my depth here, new to Mac, comfortable with Python, >> comfortable with SQL, but lots left to learn. >> >> Problem: >> >> My daughter is starting a small business renting a certain kind of prop to >> the movie industry. She needs to a) keep track of her stock, b) keep >> track of rentals, c) issue invoices, and other stuff not yet fully >> defined. >> >> She has a powerbook with Tiger. I have an iMac with Leopard (10.5.3 as of >> this afternoon). >> >> We looked into Quickbooks (which was recommended by lots of people), but >> it >> is clearly not adapted to her needs. >> >> It looks to me like a database, sql, form, view, and report problem. For >> starters (time was short), I set up some spreadsheets on NeoOffice, >> installed NeoOffice in her machine, and did the paperwork she needed by >> manual sorts, filters, and so on. OK, but for the long term... >> >> My current thinking is (but I've a lot to learn) something like this: >> >> Python as the application platform. SQLite as an embedded database. >> Would >> be nice to use QT for user interface. >> >> Outputs needed in PDF format, and possible PDF with fillable forms. >> >> I can probably get my daughter to upgrade to Leopard, but if an app could >> be developed on Leopard and run on Tiger, it would be preferable. >> >> Am I out of my mind? >> >> >> Thanks, >> >> John Velman >> _______________________________________________ >> Pythonmac-SIG maillist - Pythonmac-SIG at python.org >> http://mail.python.org/mailman/listinfo/pythonmac-sig From velman at cox.net Fri Jun 20 02:51:35 2008 From: velman at cox.net (John Velman) Date: Thu, 19 Jun 2008 17:51:35 -0700 Subject: [Pythonmac-SIG] A simple app: Develop on Leopard, use on Tiger In-Reply-To: <703195ad0806191713g728c594j884d3716db47d456@mail.gmail.com> References: <20080619231502.GA419@cox.net> <703195ad0806191713g728c594j884d3716db47d456@mail.gmail.com> Message-ID: <20080620005135.GC419@cox.net> On Thu, Jun 19, 2008 at 05:13:31PM -0700, Tom Weir wrote: > On Thu, Jun 19, 2008 at 4:15 PM, John Velman wrote: > > > I'm a bit out of my depth here, new to Mac, comfortable with Python, > > comfortable with SQL, but lots left to learn. > > > > Problem: > > > > > > > > > Am I out of my mind? > > > > I think it really depends on how fast you need a solution, how much time you > have, and the fun-factor involved. Qt is a very nice GUI framework, but it > does have a bit of a learning curve. If you choose to go down this path, I'd > suggest picking up the PyQt book. I ordered it from Amazon yesterday! I have other plans (or at least intentions) for PyQt, even if I don't decide to go this way on this project. Thanks, John V. > > Another alternative would be to take a look at either Bento, or its big > brother, FileMaker. The cost is obviously higher, but Filemaker in > particular is designed for this sort of application. > > Tom > _______________________________________________ > Pythonmac-SIG maillist - Pythonmac-SIG at python.org > http://mail.python.org/mailman/listinfo/pythonmac-sig From nad at acm.org Fri Jun 20 06:33:52 2008 From: nad at acm.org (Ned Deily) Date: Thu, 19 Jun 2008 21:33:52 -0700 Subject: [Pythonmac-SIG] converting Mac 'path' to file path in appscript? References: <08Jun19.111548pdt."58698"@synergy1.parc.xerox.com> <08Jun19.140559pdt."58698"@synergy1.parc.xerox.com> Message-ID: In article <08Jun19.140559pdt."58698"@synergy1.parc.xerox.com>, Bill Janssen wrote: > Thanks. I think you're suggesting that I could take the "path" and > turn it into a File, and use the "path" property of the File to get > the POSIX path. Would it be too much to ask for a one-liner showing > how to do that? Using TextEdit if you don't have Word? One way: mactypes.File.makewithhfspath(u'wolfe:downloads').path -- Ned Deily, nad at acm.org From daniellord at mac.com Fri Jun 20 15:48:25 2008 From: daniellord at mac.com (Daniel Lord) Date: Fri, 20 Jun 2008 06:48:25 -0700 Subject: [Pythonmac-SIG] converting Mac 'path' to file path in appscript? In-Reply-To: References: <08Jun19.111548pdt.58698@synergy1.parc.xerox.com> <08Jun19.140559pdt.58698@synergy1.parc.xerox.com> Message-ID: <76AE4731-DB01-4F80-9226-6E781FA95027@mac.com> On Jun 19, 2008, at 21:33 PM, Ned Deily wrote: > One way: > mactypes.File.makewithhfspath(u'wolfe:downloads').path > > index.html> mactypes is a very useful module, it is how I get the selection in the Finder via appscript whether using Python or PyObjC def getFinderSelection(): """List of aliases of selected items in the Finder""" return [alias.path for alias in app("Finder").selection.get(resulttype=k.alias)] Daniel From hraban at fiee.net Fri Jun 20 17:42:08 2008 From: hraban at fiee.net (Henning Hraban Ramm) Date: Fri, 20 Jun 2008 17:42:08 +0200 Subject: [Pythonmac-SIG] A simple app: Develop on Leopard, use on Tiger In-Reply-To: <20080619231502.GA419@cox.net> References: <20080619231502.GA419@cox.net> Message-ID: <78343F58-50D9-4344-8EAF-1456988B9794@fiee.net> Am 2008-06-20 um 01:15 schrieb John Velman: > Python as the application platform. SQLite as an embedded > database. Would > be nice to use QT for user interface. > > Outputs needed in PDF format, and possible PDF with fillable forms. > > I can probably get my daughter to upgrade to Leopard, but if an app > could > be developed on Leopard and run on Tiger, it would be preferable. I strongly suggest dabo, it's a three-layer framework that wraps wxPython for GUI, database access and ReportLab - like made for your task. See dabodev.com and the mailing list - the docs are a bit weak... Don't know if ReportLab can create PDF forms, I'd use ConTeXt* for such. If you don't need to create an proper application, you can just install all the needed modules on your daughters Mac, then you can develop platform independent. * an alternative to LaTeX, see wiki.contextgarden.net Greetlings from Lake Constance! Hraban --- http://www.fiee.net https://www.cacert.org (I'm an assurer) From janssen at parc.com Fri Jun 20 17:46:55 2008 From: janssen at parc.com (Bill Janssen) Date: Fri, 20 Jun 2008 08:46:55 PDT Subject: [Pythonmac-SIG] converting Mac 'path' to file path in appscript? In-Reply-To: <76AE4731-DB01-4F80-9226-6E781FA95027@mac.com> References: <08Jun19.111548pdt.58698@synergy1.parc.xerox.com> <08Jun19.140559pdt.58698@synergy1.parc.xerox.com> <76AE4731-DB01-4F80-9226-6E781FA95027@mac.com> Message-ID: <08Jun20.084701pdt."58698"@synergy1.parc.xerox.com> Cool. Thanks, Ned and Daniel. Bill From Chris.Barker at noaa.gov Fri Jun 20 18:02:10 2008 From: Chris.Barker at noaa.gov (Christopher Barker) Date: Fri, 20 Jun 2008 09:02:10 -0700 Subject: [Pythonmac-SIG] A simple app: Develop on Leopard, use on Tiger In-Reply-To: <78343F58-50D9-4344-8EAF-1456988B9794@fiee.net> References: <20080619231502.GA419@cox.net> <78343F58-50D9-4344-8EAF-1456988B9794@fiee.net> Message-ID: <485BD482.20204@noaa.gov> Henning Hraban Ramm wrote: > If you don't need to create an proper application, you can just install > all the needed modules on your daughters Mac, then you can develop > platform independent. And if you do, you can use py2app with the python.org build of python2.5, and you'll get a self-contained application that should run on 10.3.9 and above, PPC and Intel. -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 goodmansond at gmail.com Fri Jun 20 18:05:17 2008 From: goodmansond at gmail.com (DeanG) Date: Fri, 20 Jun 2008 11:05:17 -0500 Subject: [Pythonmac-SIG] A simple app: Develop on Leopard, use on Tiger In-Reply-To: <20080619231502.GA419@cox.net> References: <20080619231502.GA419@cox.net> Message-ID: Would Dabo work well here? http://dabodev.com/ On Thu, Jun 19, 2008 at 6:15 PM, John Velman wrote: > I'm a bit out of my depth here, new to Mac, comfortable with Python, > comfortable with SQL, but lots left to learn. > > Problem: > > My daughter is starting a small business renting a certain kind of prop to > the movie industry. She needs to a) keep track of her stock, b) keep > track of rentals, c) issue invoices, and other stuff not yet fully defined. > > She has a powerbook with Tiger. I have an iMac with Leopard (10.5.3 as of > this afternoon). > > We looked into Quickbooks (which was recommended by lots of people), but it > is clearly not adapted to her needs. > > It looks to me like a database, sql, form, view, and report problem. For > starters (time was short), I set up some spreadsheets on NeoOffice, > installed NeoOffice in her machine, and did the paperwork she needed by > manual sorts, filters, and so on. OK, but for the long term... > > My current thinking is (but I've a lot to learn) something like this: > > Python as the application platform. SQLite as an embedded database. Would > be nice to use QT for user interface. > > Outputs needed in PDF format, and possible PDF with fillable forms. > > I can probably get my daughter to upgrade to Leopard, but if an app could > be developed on Leopard and run on Tiger, it would be preferable. > > Am I out of my mind? > > > Thanks, > > John Velman > _______________________________________________ > Pythonmac-SIG maillist - Pythonmac-SIG at python.org > http://mail.python.org/mailman/listinfo/pythonmac-sig > From ed at leafe.com Fri Jun 20 18:40:38 2008 From: ed at leafe.com (Ed Leafe) Date: Fri, 20 Jun 2008 12:40:38 -0400 Subject: [Pythonmac-SIG] A simple app: Develop on Leopard, use on Tiger In-Reply-To: <20080619231502.GA419@cox.net> References: <20080619231502.GA419@cox.net> Message-ID: On Jun 19, 2008, at 7:15 PM, John Velman wrote: > My current thinking is (but I've a lot to learn) something like this: > > Python as the application platform. SQLite as an embedded > database. Would > be nice to use QT for user interface. > > Outputs needed in PDF format, and possible PDF with fillable forms. > > I can probably get my daughter to upgrade to Leopard, but if an app > could > be developed on Leopard and run on Tiger, it would be preferable. > > Am I out of my mind? No, you're not. As others have mentioned, Dabo sounds like a perfect fit for you. I am one of the authors, and would be happy to help you with any questions you may have. It would probably be more appropriate to ask them on the dabo-users list; you can sign up for that at http://leafe.com/mailman/listinfo/dabo-users . Not only will Dabo apps run unmodified on Tiger and Leopard, they will also run on Windows and Linux, too! -- Ed Leafe From velman at cox.net Fri Jun 20 22:40:05 2008 From: velman at cox.net (John Velman) Date: Fri, 20 Jun 2008 13:40:05 -0700 Subject: [Pythonmac-SIG] A simple app: Develop on Leopard, use on Tiger In-Reply-To: <20080619231502.GA419@cox.net> References: <20080619231502.GA419@cox.net> Message-ID: <20080620204005.GB385@cox.net> On Thu, Jun 19, 2008 at 04:15:02PM -0700, John Velman wrote: > I'm a bit out of my depth here, new to Mac, comfortable with Python, > comfortable with SQL, but lots left to learn. > > Problem: > > My daughter is starting a small business renting a certain kind of prop to [snip] Many thanks to all who responded!. Now I've got a few more things to learn and (hopefully) use some day. At this writing, it does look like Dabo is pretty much on target for my needs, so I'll be following up on this. I still have intentions for PyQt, and knowing about PyObjc is a great benefit. I also appreciate the advice about Bento and FileMakerPro -- will file these for future reference if they are ever needed. Right now, I prefer to develop a tailor-made application. Thanks again! John V. From elescargot at hotmail.com Sat Jun 21 13:18:20 2008 From: elescargot at hotmail.com (El Duvelle) Date: Sat, 21 Jun 2008 11:18:20 +0000 Subject: [Pythonmac-SIG] [py2app] how to make a .app running on mac intel 10.5 In-Reply-To: <4857F006.3040403@noaa.gov> References: <4857F006.3040403@noaa.gov> Message-ID: > Date: Tue, 17 Jun 2008 10:10:30 -0700 > From: Chris.Barker at noaa.gov > Subject: Re: [Pythonmac-SIG] [py2app] how to make a .app running on mac intel 10.5 > To: elescargot at hotmail.com; pythonmac-sig at python.org > > El Duvelle wrote: > > So my question is : are there options in py2app which would enable to > > make the .app running for another processor than the one on which py2app > > is installed, and more precisely an Intel with mac os 10.5 ? > > If you run py2app with the version of Python you get from python.org > (Universal Framework Build), you will get a Universal build, and it > should run on any Mac running OS-X 10.4 and above, and maybe even 10.3.9. > Thanks for your answer, It does works, but the problem is that the launching of my .app on the mac with Intel is veeery slow compared to launching on the mac with a ppc. And I guess it is so because the computer has to convert the .app or something like that... But I guess that if there are no options to select the type of computer we want the .app to run on, I'll just have to go on with what I've got. Thanks again. Leos _________________________________________________________________ Faites vous de nouveaux amis gr?ce ? l'annuaire des profils Messenger ! http://home.services.spaces.live.com/search/?page=searchresults&ss=true&FormId=AdvPeopleSearch&form=SPXFRM&tp=3&sc=2&pg=0&Search.DisplayName=Nom+public&search.gender=&search.age=&Search.FirstName=Pr%C3%A9nom&Search.LastName=Nom&search.location=Lieu&search.occupation=Profession&search.interests=amis&submit=Rechercher -------------- next part -------------- An HTML attachment was scrubbed... URL: From rsfinn at gmail.com Sat Jun 21 22:21:23 2008 From: rsfinn at gmail.com (Russell Finn) Date: Sat, 21 Jun 2008 16:21:23 -0400 Subject: [Pythonmac-SIG] A simple app: Develop on Leopard, use on Tiger In-Reply-To: <20080620204005.GB385@cox.net> References: <20080619231502.GA419@cox.net> <20080620204005.GB385@cox.net> Message-ID: On Fri, Jun 20, 2008 at 4:40 PM, John Velman wrote: > I also appreciate the advice about Bento and FileMakerPro -- will file > these for future reference if they are ever needed. Note that Bento is Leopard-only. -- RSF From georg.seifert at gmx.de Mon Jun 23 11:05:58 2008 From: georg.seifert at gmx.de (Georg Seifert) Date: Mon, 23 Jun 2008 11:05:58 +0200 Subject: [Pythonmac-SIG] python Plugin conform to protocol Message-ID: Hello, I have a Cocoa app with loads plugins. I want to use some python plugins but I have problems getting them to work. The Plugin implementation contains: myExport = objc.protocolNamed('myExportProtocol') class GSExporter(NSObject, myExport): def __init__(self): ... But if I do: currPrincipalClass = [currBundle principalClass]; if(currPrincipalClass && [currPrincipalClass conformsToProtocol:@protocol(myExportProtocol)]) it works for the cocoa plugins but not for the python one. If I just ask for: if(currPrincipalClass) the python plugin loads and works as expected but I would like to be sure that the plugin conforms. Do I miss something something? Georg From hendricks52 at gmail.com Mon Jun 23 16:59:08 2008 From: hendricks52 at gmail.com (Derrick Hendricks) Date: Mon, 23 Jun 2008 10:59:08 -0400 Subject: [Pythonmac-SIG] py2app version mismatch while including a library built with Pyrex Message-ID: Hello, I haven't tried packaging an app on a Mac before, so I'm not sure what's going on. I've got this program that I'm trying to package using my 10.5 Leopard machine. It uses an external library that's created using Pyrex. Here's the current setup of my machine. I'm using the python 2.4 that I got from python.org and py2app. In the Makefile I use to compile the library, I use python 2.4. Now, when I run py2app to create the bundle, py2app completes successfully. And, I am creating what is supposed to be a "standalone" version of the app. When going back and running the app, the app runs just fine until it tries to access the library. At that point, I get: Fatal Python error: Interpreter not initialized (version mismatch?) I have a .py program that I've run to check the library. When run under python 2.4, it executes correctly and I have no problems. So, I'm fairly confident that the library it's being created using python 2.4. I've run the same program specifying the 2.5 that comes with Leopard and I get the exact same error as I do when running from the app. So, what it looks like to me is that when the package tries to include the library, it's using the system python instead somehow. This doesn't make sense. I've put some debug code into the app, and when it starts up, it's using python 2.4 (presumably the one bundled in the app). Any ideas what's happening and how I can solve this one? Thanks -------------- next part -------------- An HTML attachment was scrubbed... URL: From oscar.lists at mac.com Tue Jun 24 11:19:33 2008 From: oscar.lists at mac.com (Oscar Sanchez Casamitjana) Date: Tue, 24 Jun 2008 11:19:33 +0200 Subject: [Pythonmac-SIG] easy_install problems in some 10.5.3? Message-ID: <792FFE0E-39BC-4165-AC42-943DF7283556@mac.com> hi, I've recently installed 10.5.3 in a new machine (iMac), and I'm finding problems with some eggs. some will install and some will not. easy_install works perfectly in my previous machine (MBP), wich was upgraded 10.5.0/1/2/3, so i thought it might be related to this, somehow. shell output follows (sorry, with 3 examples it got a bit long): +++ # Mercurial (fail!) ## iMac sudo easy_install mercurial Searching for mercurial Reading http://pypi.python.org/simple/mercurial/ Couldn't retrieve index page for 'mercurial' Scanning index of all packages (this may take a while) Reading http://pypi.python.org/simple/ Reading http://pypi.python.org/simple/Mercurial/ Reading http://www.selenic.com/mercurial Best match: mercurial 1.0.1 Downloading http://www.selenic.com/mercurial/release/mercurial-1.0.1.tar.gz Processing mercurial-1.0.1.tar.gz Running mercurial-1.0.1/setup.py -q bdist_egg --dist-dir /tmp/ easy_install-2jC-l2/mercurial-1.0.1/egg-dist-tmp-roHrOT zip_safe flag not set; analyzing archive contents... mercurial.lsprof: module references __file__ mercurial.templater: module references __file__ mercurial.version: module references __file__ No eggs found in /tmp/easy_install-2jC-l2/mercurial-1.0.1/egg-dist-tmp- roHrOT (setup script problem?) ## MBP sudo easy_install -U mercurial Searching for mercurial Reading http://pypi.python.org/simple/mercurial/ Couldn't retrieve index page for 'mercurial' Scanning index of all packages (this may take a while) Reading http://pypi.python.org/simple/ Reading http://pypi.python.org/simple/Mercurial/ Reading http://www.selenic.com/mercurial Best match: mercurial 1.0.1 Downloading http://www.selenic.com/mercurial/release/mercurial-1.0.1.tar.gz Processing mercurial-1.0.1.tar.gz Running mercurial-1.0.1/setup.py -q bdist_egg --dist-dir /tmp/ easy_install-j0zQwd/mercurial-1.0.1/egg-dist-tmp-LPRpFY zip_safe flag not set; analyzing archive contents... mercurial.lsprof: module references __file__ mercurial.templater: module references __file__ mercurial.version: module references __file__ Removing mercurial 1.0 from easy-install.pth file Adding mercurial 1.0.1 to easy-install.pth file Installing hg script to /usr/local/bin Installed /Library/Python/2.5/site-packages/mercurial-1.0.1-py2.5- macosx-10.5-i386.egg Processing dependencies for mercurial Finished processing dependencies for mercurial # simplejson (fail!) ## iMac sudo easy_install simplejson Searching for simplejson Reading http://pypi.python.org/simple/simplejson/ Reading http://undefined.org/python/#simplejson Best match: simplejson 1.9.1 Downloading http://pypi.python.org/packages/source/s/simplejson/simplejson-1.9.1.tar.gz#md5 =d2ee608bdf6397b82a7cd53c8602b29e Processing simplejson-1.9.1.tar.gz Running simplejson-1.9.1/setup.py -q bdist_egg --dist-dir /tmp/ easy_install-u3TGVn/simplejson-1.9.1/egg-dist-tmp-OeLe4c No eggs found in /tmp/easy_install-u3TGVn/simplejson-1.9.1/egg-dist- tmp-OeLe4c (setup script problem?) ## MBP sudo easy_install simplejson Searching for simplejson Reading http://pypi.python.org/simple/simplejson/ Reading http://undefined.org/python/#simplejson Best match: simplejson 1.9.1 Downloading http://pypi.python.org/packages/source/s/simplejson/simplejson-1.9.1.tar.gz#md5 =d2ee608bdf6397b82a7cd53c8602b29e Processing simplejson-1.9.1.tar.gz Running simplejson-1.9.1/setup.py -q bdist_egg --dist-dir /tmp/ easy_install-Rudv0U/simplejson-1.9.1/egg-dist-tmp-9XAUrS Adding simplejson 1.9.1 to easy-install.pth file Installed /Library/Python/2.5/site-packages/simplejson-1.9.1-py2.5- macosx-10.5-i386.egg Processing dependencies for simplejson Finished processing dependencies for simplejson # SQLObject (success!) ## iMac Wintermute:~ oscar$ sudo easy_install SQLObject Searching for SQLObject Best match: SQLObject 0.10.2 Processing SQLObject-0.10.2-py2.5.egg SQLObject 0.10.2 is already the active version in easy-install.pth Installing sqlobject-admin script to /usr/local/bin Using /Library/Python/2.5/site-packages/SQLObject-0.10.2-py2.5.egg Processing dependencies for SQLObject Searching for FormEncode>=0.2.2 Reading http://pypi.python.org/simple/FormEncode/ Reading http://formencode.org Reading http://formencode.sf.net Best match: FormEncode 1.0.1 Downloading http://pypi.python.org/packages/2.5/F/FormEncode/FormEncode-1.0.1-py2.5.egg#md5 =f9bee5c918efc078b8b5ad38f92b1138 Processing FormEncode-1.0.1-py2.5.egg creating /Library/Python/2.5/site-packages/FormEncode-1.0.1-py2.5.egg Extracting FormEncode-1.0.1-py2.5.egg to /Library/Python/2.5/site- packages Adding FormEncode 1.0.1 to easy-install.pth file Installed /Library/Python/2.5/site-packages/FormEncode-1.0.1-py2.5.egg Finished processing dependencies for SQLObject ## MBP sudo easy_install SQLObject Searching for SQLObject Best match: SQLObject 0.10.2 Processing SQLObject-0.10.2-py2.5.egg SQLObject 0.10.2 is already the active version in easy-install.pth Installing sqlobject-admin script to /usr/local/bin Using /Library/Python/2.5/site-packages/SQLObject-0.10.2-py2.5.egg Processing dependencies for SQLObject Searching for FormEncode>=0.2.2 Reading http://pypi.python.org/simple/FormEncode/ Reading http://formencode.org Reading http://formencode.sf.net Best match: FormEncode 1.0.1 Downloading http://pypi.python.org/packages/2.5/F/FormEncode/FormEncode-1.0.1-py2.5.egg#md5 =f9bee5c918efc078b8b5ad38f92b1138 Processing FormEncode-1.0.1-py2.5.egg creating /Library/Python/2.5/site-packages/FormEncode-1.0.1-py2.5.egg Extracting FormEncode-1.0.1-py2.5.egg to /Library/Python/2.5/site- packages Adding FormEncode 1.0.1 to easy-install.pth file Installed /Library/Python/2.5/site-packages/FormEncode-1.0.1-py2.5.egg Finished processing dependencies for SQLObject +++ Python version is 2.5.1 (factory) on both machines, and .bash_profile is mirrored. should I ask on the failing egg lists? any help appreciated. regards, oscar. From rob at rawb.net Thu Jun 26 00:15:43 2008 From: rob at rawb.net (Rob Gabaree) Date: Wed, 25 Jun 2008 18:15:43 -0400 Subject: [Pythonmac-SIG] MacPython & Leopard: Which 'site-packages' folder to use? Message-ID: Hello, With Leopard's built-in Python, user-installed modules are placed in /Library/Python/2.5/site-packages/. If I'm using MacPython, should I avoid putting anything into this directory and use /Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages instead? I'd just like to double check. I noticed the former path wasn't in sys.path when I looked, but I wasn't sure if it was accidentally left out by mistake. Thanks for the help, Rob From rowen at cesmail.net Thu Jun 26 21:10:55 2008 From: rowen at cesmail.net (Russell E. Owen) Date: Thu, 26 Jun 2008 12:10:55 -0700 Subject: [Pythonmac-SIG] MacPython & Leopard: Which 'site-packages' folder to use? References: Message-ID: In article , "Rob Gabaree" wrote: > Hello, > > With Leopard's built-in Python, user-installed modules are placed in > /Library/Python/2.5/site-packages/. > > If I'm using MacPython, should I avoid putting anything into this > directory and use > /Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages > instead? > > I'd just like to double check. I noticed the former path wasn't in > sys.path when I looked, but I wasn't sure if it was accidentally left > out by mistake. > > Thanks for the help, If you are using MacPython then use /Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-pack ages. The two pythons do not share installed packages. This is probably good; you avoid endangering the system python and you can upgrade to python 2.6 or 3.0 when you are ready without installing packages that are incompatible with the system python. -- Russell From larry.meyn at nasa.gov Thu Jun 26 22:19:52 2008 From: larry.meyn at nasa.gov (Larry Meyn) Date: Thu, 26 Jun 2008 13:19:52 -0700 Subject: [Pythonmac-SIG] MacPython & Leopard: Which 'site-packages' folder to use? In-Reply-To: Message-ID: On 6/26/08 12:10 PM, "Russell E. Owen" wrote: > In article > , > "Rob Gabaree" wrote: > >> Hello, >> >> With Leopard's built-in Python, user-installed modules are placed in >> /Library/Python/2.5/site-packages/. >> >> If I'm using MacPython, should I avoid putting anything into this >> directory and use >> /Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages >> instead? >> >> I'd just like to double check. I noticed the former path wasn't in >> sys.path when I looked, but I wasn't sure if it was accidentally left >> out by mistake. >> >> Thanks for the help, > > If you are using MacPython then use > /Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-pack > ages. > > The two pythons do not share installed packages. This is probably good; > you avoid endangering the system python and you can upgrade to python > 2.6 or 3.0 when you are ready without installing packages that are > incompatible with the system python. > > -- Russell > Additional Info: While you can use the system python and install modules in /Library/Python/2.5/site-packages/, you cannot install new versions of the pre-installed modules that are stored in /System/Library/Frameworks/Python.framework/Versions/2.5/Extras/lib/python/ (You can install new versions, but the system python checks its own folder first.) Several modules such as numpy and wxPython are in the system python's extras library. Since I like to update these from time to time, I've abandoned the system python and use a framework install instead. One drawback to a user-installed python is that you lose access to some system-python only modules like CoreGraphics. --Larry From pythonnutter at gmail.com Fri Jun 27 05:53:40 2008 From: pythonnutter at gmail.com (Python Nutter) Date: Fri, 27 Jun 2008 13:53:40 +1000 Subject: [Pythonmac-SIG] MacPython & Leopard: Which 'site-packages' folder to use? In-Reply-To: References: Message-ID: I take my system to the next level. I work with the Framework/Reference Python from python.org so I use /Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages However before I had my site-packages folder inundated with installed modules I installed only Peak Setup Tools and VirtualEnv and because I like iPython I installed that. Then using Doug Hellmens wrapper (needed slight modification to the installation instructions to make it work when moving from a Linux system to installing it on a Mac OS X system) I have a system where I can created unlimited "sandoxed" python sessions (projects) each with their own ability to easy_install or setup.py install any number of python modules and have them not step on any other virtual python session (project). now a simple $mkvirtualenv WhateverProjectName will create the folders, partial symlinks into system python, and automatically install setuptools into my new project's folder and then switch me into that virtualenv right away (WhateverProjectname)$_ where I can then easy_install the specific python modules I need just for that project. If I want to switch over and work on that new pyglet game I have been developing a simple (WhateverProjectname)$workon MyPygletGameProject (MyPygletGameProject)$_ gets me out of my sandboxed Project and into my sanboxed PygletGameProject. Very slick, only way to go. Mac OS X modifications: Just edit.bash_profile (OS X) instead of .bashrc (Linux, etc.) Make a directory in your home folder called .virtualenvs to hold all your projects you created $mkdir .virtualenvs Then store your virtualenvwrapper_bashrc in some directory, I use Scripts folder with a bash folder in it, all inside my home folder. Then edit your .bash_profile and add: # Setting VirtualEnv and VirtualEnvWrapper for Python export WORK_HOME=$HOME/.virtualenvs source $HOME/Scripts/bash/virtualenvwrapper_bashrc And you too can join in on the fun =) Cheers, Python Nutter On 27/06/2008, Larry Meyn wrote: > > > > On 6/26/08 12:10 PM, "Russell E. Owen" wrote: > >> In article >> , >> "Rob Gabaree" wrote: >> >>> Hello, >>> >>> With Leopard's built-in Python, user-installed modules are placed in >>> /Library/Python/2.5/site-packages/. >>> >>> If I'm using MacPython, should I avoid putting anything into this >>> directory and use >>> /Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages >>> instead? >>> >>> I'd just like to double check. I noticed the former path wasn't in >>> sys.path when I looked, but I wasn't sure if it was accidentally left >>> out by mistake. >>> >>> Thanks for the help, >> >> If you are using MacPython then use >> /Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-pack >> ages. >> >> The two pythons do not share installed packages. This is probably good; >> you avoid endangering the system python and you can upgrade to python >> 2.6 or 3.0 when you are ready without installing packages that are >> incompatible with the system python. >> >> -- Russell >> > > Additional Info: > While you can use the system python and install modules in > /Library/Python/2.5/site-packages/, you cannot install new versions of the > pre-installed modules that are stored in > /System/Library/Frameworks/Python.framework/Versions/2.5/Extras/lib/python/ > (You can install new versions, but the system python checks its own folder > first.) Several modules such as numpy and wxPython are in the system > python's extras library. Since I like to update these from time to time, > I've abandoned the system python and use a framework install instead. One > drawback to a user-installed python is that you lose access to some > system-python only modules like CoreGraphics. > > --Larry > > _______________________________________________ > Pythonmac-SIG maillist - Pythonmac-SIG at python.org > http://mail.python.org/mailman/listinfo/pythonmac-sig > From hengist.podd at virgin.net Fri Jun 27 18:09:34 2008 From: hengist.podd at virgin.net (Hengist Podd) Date: Fri, 27 Jun 2008 16:09:34 +0000 (GMT) Subject: [Pythonmac-SIG] semi_standalone option broken in py2app + Leopard Python? Message-ID: <1924073730.84691214582975005.JavaMail.mail@webmail11> An HTML attachment was scrubbed... URL: From zachary.pincus at yale.edu Sat Jun 28 19:25:14 2008 From: zachary.pincus at yale.edu (Zachary Pincus) Date: Sat, 28 Jun 2008 13:25:14 -0400 Subject: [Pythonmac-SIG] Distribute command-line tools with py2app or similar? Message-ID: Hi all, I've built some scientific command-line tools in Python that I'd like to be able to distribute to colleagues. This is dead-simple on Windows -- I use py2exe to make a console application exe (or several), put it/ them on the PATH, and things are good-to-go. However, from googling, it doesn't appear so easy on OS X (which is what I've been developing on). Py2app seems optimized for creating OS X GUI "app" bundles, not command-line programs. (See this email and replies: http://mail.python.org/pipermail/pythonmac-sig/2006-January/015673.html .) Ideally, I'd want this to work regardless of what the user has on their computer -- so I don't just want to make an mpkg that blindly installs a python and other module dependencies (e.g. numpy), because I wouldn't want to clobber previous installs. And I don't want to burden the users with some lengthy set of instructions about what to download depending on what version of what else they have... (e.g. what if they have and depend on numpy 1.0.6 and I require 1.1?) I'd just love a self-contained directory that contains the python "runtime" and all dependencies in a that I could distribute in a portable fashion. Is this possible to get on OS X in any fashion? Can I somehow grab the parts I need from a py2app bundle and just distribute that? Thanks, Zach Pincus Molecular, Cellular and Developmental Biology Yale University From zachary.pincus at yale.edu Sun Jun 29 18:06:17 2008 From: zachary.pincus at yale.edu (Zachary Pincus) Date: Sun, 29 Jun 2008 12:06:17 -0400 Subject: [Pythonmac-SIG] A few more py2appissues/questions Message-ID: <465C7DB9-65A5-456E-A398-0AC114944448@yale.edu> Hi all, I've been wrestling with py2app for the last day and am getting pretty confused/discouraged. If anyone has any suggestions regarding the following issues I've run across, I would be extremely grateful! I've tested these with both the SVN version of py2app (and dependencies like modulegraph/macholib) as well as the current distributed version. (1) It appears that modules included via the py2app 'includes' option do not have their full dependencies added. I included a handful of modules from my main package via the setup.py script: setup_kws['options'] = {'py2app':{'includes':['mypackage.util', 'mypackage.other']}} These modules do get included, but *none* of their dependencies do, even though there are clear 'import' statements in each. I checked out the dependency graph as output by the --graph option, and sure enough, no dependencies other than 'os' (which is not imported by the modules) are shown. Is this by design? I tried tracing through the modulegraph code to check, but it doesn't seem that this is the desired outcome. (2) It appears that any packages that I include via the py2app 'packages' option are copied verbatim from the *source*, not *build* directory. E.g. my top-level package is called 'mypackage', and I want to force all of it to be included in the py2app bundle, so I do the following in the top-level setup.py file: setup_kws['options'] = {'py2app':{'includes':['mypackage.util', 'mypackage.other']}} Now, there are a lot of C extensions to mypackage, and some (distutils- supported) folder-structure transformations (thanks to some 3rd party code that I've included). But at the end of the day, the right structure gets put into build/lib.macosx[whatever]. However, for some reason what gets copied over into the app bundle is the mypackage tree from the source dir, not from the build/lib dir. Which includes hundreds of C source files, etc., and has the wrong structure. Anyone have any thoughts about these matters? Thanks, Zach Pincus From zachary.pincus at yale.edu Sun Jun 29 18:25:25 2008 From: zachary.pincus at yale.edu (Zachary Pincus) Date: Sun, 29 Jun 2008 12:25:25 -0400 Subject: [Pythonmac-SIG] A few more py2appissues/questions In-Reply-To: <465C7DB9-65A5-456E-A398-0AC114944448@yale.edu> References: <465C7DB9-65A5-456E-A398-0AC114944448@yale.edu> Message-ID: <4D6F40DB-9D5A-491F-938E-6FC68A910328@yale.edu> Hi all, A couple of addenda: > (1) It appears that modules included via the py2app 'includes' > option do not have their full dependencies added. I included a > handful of modules from my main package via the setup.py script: > > setup_kws['options'] = {'py2app':{'includes':['mypackage.util', > 'mypackage.other']}} > > These modules do get included, but *none* of their dependencies do, > even though there are clear 'import' statements in each. I checked > out the dependency graph as output by the --graph option, and sure > enough, no dependencies other than 'os' (which is not imported by > the modules) are shown. Is this by design? I tried tracing through > the modulegraph code to check, but it doesn't seem that this is the > desired outcome. I tried *directly* importing these modules from the main script that I pass to the 'app' setup option, and still nothing! Sometimes there's not a single entry in the dependency graph for a module that is explicitly imported from the app script. This is confusing! What circumstances could cause modulegraph to fail so utterly? > (2) It appears that any packages that I include via the py2app > 'packages' option are copied verbatim from the *source*, not *build* > directory. E.g. my top-level package is called 'mypackage', and I > want to force all of it to be included in the py2app bundle, so I do > the following in the top-level setup.py file: > setup_kws['options'] = {'py2app':{'includes':['mypackage.util', > 'mypackage.other']}} Sorry, copy-paste error. I meant: setup_kws['options'] = {'py2app':{'packages':['mypackage']}} > Now, there are a lot of C extensions to mypackage, and some > (distutils-supported) folder-structure transformations (thanks to > some 3rd party code that I've included). But at the end of the day, > the right structure gets put into build/lib.macosx[whatever]. > However, for some reason what gets copied over into the app bundle > is the mypackage tree from the source dir, not from the build/lib > dir. Which includes hundreds of C source files, etc., and has the > wrong structure. > > Anyone have any thoughts about these matters? > > Thanks, > > Zach Pincus > _______________________________________________ > Pythonmac-SIG maillist - Pythonmac-SIG at python.org > http://mail.python.org/mailman/listinfo/pythonmac-sig From ed at leafe.com Sun Jun 29 23:24:55 2008 From: ed at leafe.com (Ed Leafe) Date: Sun, 29 Jun 2008 16:24:55 -0500 Subject: [Pythonmac-SIG] Py2app - problem building with a localized package Message-ID: <20C302AD-C5CA-4419-BC4B-E9100163B857@leafe.com> I'm trying to use py2app to build an application, and am running into the following problem. The app uses the Dabo framework, located in my site-packages directory. The 'dabo' folder contains several directories that are sub-modules of the framework, as well as a directory named 'locale' containing the .po and .mo localization files for each available translation. When I build, the app builds successfully, but when I run it, the error: "No translation file found for domain: 'dabo'" is displayed. If I look into the contents of the app, as well as the build directory, I see the dabo directory with all the sub-modules, but no locale. What do I need to do to tell py2app to include these files? Or, in the alternative, can I manually copy them to the build directory and then just run the final part of the process that creates the app? -- Ed Leafe From promex at gmail.com Mon Jun 30 00:30:05 2008 From: promex at gmail.com (PromeX) Date: Sun, 29 Jun 2008 18:30:05 -0400 Subject: [Pythonmac-SIG] [py2app] Program Creation fails. AttributeError: 'module' object has no attribute 'ImpWrapper' Message-ID: I'm trying to use py2app to create a standalone app. It uses WxWidgets. I had an older version that I had used before but uninstalled it. I've tried using both the svn and easy_install on py2app, modulegraph, macholib, and nothing worked. I'm running 10.5.3. I've attached the output. running py2app creating /private/var/folders/ld/ld4P9LEsG6mY8GtV87UGp++++TI/-Tmp-/ tmpSPXQ-F/build creating /private/var/folders/ld/ld4P9LEsG6mY8GtV87UGp++++TI/-Tmp-/ tmpSPXQ-F/build/bdist.macosx-10.3-i386 creating /private/var/folders/ld/ld4P9LEsG6mY8GtV87UGp++++TI/-Tmp-/ tmpSPXQ-F/build/bdist.macosx-10.3-i386/python2.5-standalone creating /private/var/folders/ld/ld4P9LEsG6mY8GtV87UGp++++TI/-Tmp-/ tmpSPXQ-F/build/bdist.macosx-10.3-i386/python2.5-standalone/app creating /private/var/folders/ld/ld4P9LEsG6mY8GtV87UGp++++TI/-Tmp-/ tmpSPXQ-F/build/bdist.macosx-10.3-i386/python2.5-standalone/app/collect creating /private/var/folders/ld/ld4P9LEsG6mY8GtV87UGp++++TI/-Tmp-/ tmpSPXQ-F/build/bdist.macosx-10.3-i386/python2.5-standalone/app/temp creating /private/var/folders/ld/ld4P9LEsG6mY8GtV87UGp++++TI/-Tmp-/ tmpSPXQ-F/dist creating build/bdist.macosx-10.3-i386/python2.5-standalone/app/lib- dynload creating build/bdist.macosx-10.3-i386/python2.5-standalone/app/ Frameworks Traceback (most recent call last): File "/Library/Frameworks/Python.framework/Versions/2.5/lib/ python2.5/site-packages/py2app-0.4.2-py2.5.egg/py2app/build_app.py", line 579, in _run self.run_normal() File "/Library/Frameworks/Python.framework/Versions/2.5/lib/ python2.5/site-packages/py2app-0.4.2-py2.5.egg/py2app/build_app.py", line 631, in run_normal mf = self.get_modulefinder() File "/Library/Frameworks/Python.framework/Versions/2.5/lib/ python2.5/site-packages/py2app-0.4.2-py2.5.egg/py2app/build_app.py", line 539, in get_modulefinder debug=debug, File "build/bdist.macosx-10.3-i386/egg/modulegraph/ find_modules.py", line 255, in find_modules find_needed_modules(mf, scripts, includes, packages) File "build/bdist.macosx-10.3-i386/egg/modulegraph/ find_modules.py", line 176, in find_needed_modules mf.run_script(path) File "build/bdist.macosx-10.3-i386/egg/modulegraph/modulegraph.py", line 369, in run_script self.scan_code(co, m) File "build/bdist.macosx-10.3-i386/egg/modulegraph/modulegraph.py", line 638, in scan_code self.scan_code(c, m) File "build/bdist.macosx-10.3-i386/egg/modulegraph/modulegraph.py", line 610, in scan_code self._safe_import_hook(name, m, fromlist) File "build/bdist.macosx-10.3-i386/egg/modulegraph/modulegraph.py", line 540, in _safe_import_hook mods = self.import_hook(name, caller) File "build/bdist.macosx-10.3-i386/egg/modulegraph/modulegraph.py", line 380, in import_hook q, tail = self.find_head_package(parent, name) File "build/bdist.macosx-10.3-i386/egg/modulegraph/modulegraph.py", line 419, in find_head_package q = self.import_module(head, qname, parent) File "build/bdist.macosx-10.3-i386/egg/modulegraph/modulegraph.py", line 493, in import_module parent and parent.packagepath, parent) File "build/bdist.macosx-10.3-i386/egg/modulegraph/modulegraph.py", line 680, in find_module fp, buf, stuff = find_module(name, path) File "build/bdist.macosx-10.3-i386/egg/modulegraph/modulegraph.py", line 114, in find_module if isinstance(importer, pkg_resources.ImpWrapper): AttributeError: 'module' object has no attribute 'ImpWrapper' > /private/var/folders/ld/ld4P9LEsG6mY8GtV87UGp++++TI/-Tmp-/tmpSPXQ-F/ build/bdist.macosx-10.3-i386/egg/modulegraph/ modulegraph.py(114)find_module() (Pdb) q Traceback (most recent call last): File "/Library/Frameworks/Python.framework/Versions/Current/bin/ py2applet", line 8, in load_entry_point('py2app==0.4.2', 'console_scripts', 'py2applet')() File "/Library/Frameworks/Python.framework/Versions/2.5/lib/ python2.5/site-packages/py2app-0.4.2-py2.5.egg/py2app/ script_py2applet.py", line 134, in main build(args, scripts, data_files, options) File "/Library/Frameworks/Python.framework/Versions/2.5/lib/ python2.5/site-packages/py2app-0.4.2-py2.5.egg/py2app/ script_py2applet.py", line 187, in build target.appdir, AttributeError: 'Target' object has no attribute 'appdir' From Chris.Barker at noaa.gov Mon Jun 30 19:03:41 2008 From: Chris.Barker at noaa.gov (Christopher Barker) Date: Mon, 30 Jun 2008 10:03:41 -0700 Subject: [Pythonmac-SIG] [py2app] how to make a .app running on mac intel 10.5 In-Reply-To: References: <4857F006.3040403@noaa.gov> Message-ID: <486911ED.8070408@noaa.gov> Wow! lot's of py2app questions lately! I'll do my best, but I'm not expert. Unfortunately, the real expert is Bob Ippolito, whom I have not seen on this list in a good while, and Ronald Oussoren has been very helpful, but I haven't seen him for a bit either (not as long, though). Anyway, here's my little bit of help: El Duvelle wrote: > It does works, but the problem is that the launching of my .app on the > mac with Intel is veeery slow compared to launching on the mac with a > ppc. And I guess it is so because the computer has to convert the .app > or something like that... nope -- py2app should have built a true Universal package -- it should launch the same way on Intel and PPC systems. Is there any other difference that might mater between the two? (disk speed, networked drives, ...) It's possible that you got a PPC build, and it's running under Rosetta (or whatever they call the PPC emulation) on your Intel box -- does it run slow too, or just launch slow? You might try running "file" on the executable in the bundle. It's inside the .app bundle, in the MacOS dir. This is what I get in one example of mine: ... Converter.app/Contents/MacOS cbarker$ file Converter Converter: Mach-O universal binary with 2 architectures Converter (for architecture i386): Mach-O executable i386 Converter (for architecture ppc): Mach-O executable ppc Are you building on the PPC machine? -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 Mon Jun 30 19:07:11 2008 From: Chris.Barker at noaa.gov (Christopher Barker) Date: Mon, 30 Jun 2008 10:07:11 -0700 Subject: [Pythonmac-SIG] py2app version mismatch while including a library built with Pyrex In-Reply-To: References: Message-ID: <486912BF.1080502@noaa.gov> Derrick Hendricks wrote: > Here's the current setup of my machine. I'm using the python 2.4 that I > got from python.org and py2app. In the Makefile I > use to compile the library, I use python 2.4. This is probably the source of your problem -- you really want to use distutils to compile your extensions -- it will get all this right, and probably avoid your problem. > I have a .py program that I've run to check the library. When run under > python 2.4, it executes correctly and I have no problems. So, I'm > fairly confident that the library it's being created using python 2.4. Well, somewhere in there you probably are somehow running py2app with a different python that you're building your extension against. How many version of python do you have installed? you might try cleaning out any extras (build-from-tarball, macports, fink, etc...) -Chris -- Christopher Barker, Ph.D. Oceanographer Emergency Response Division NOAA/NOS/OR&R (206) 526-6959 voice 7600 Sand Point Way NE (206) 526-6329 fax Seattle, WA 98115 (206) 526-6317 main reception Chris.Barker at noaa.gov From Chris.Barker at noaa.gov Mon Jun 30 19:09:51 2008 From: Chris.Barker at noaa.gov (Christopher Barker) Date: Mon, 30 Jun 2008 10:09:51 -0700 Subject: [Pythonmac-SIG] semi_standalone option broken in py2app + Leopard Python? In-Reply-To: <1924073730.84691214582975005.JavaMail.mail@webmail11> References: <1924073730.84691214582975005.JavaMail.mail@webmail11> Message-ID: <4869135F.8080909@noaa.gov> Hengist Podd wrote: > I'm trying to build semi-standalone applications against Leopard's stock > Python 2.5 with an appscript 0.19.0 .egg installed, well, py2aqpp is known to have problems with eggs. is that a zipped egg? If so, it may work better with an unzipped one: $ easy_install -Z TheNameOfTheEgg -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 Mon Jun 30 20:21:57 2008 From: Chris.Barker at noaa.gov (Christopher Barker) Date: Mon, 30 Jun 2008 11:21:57 -0700 Subject: [Pythonmac-SIG] A few more py2appissues/questions In-Reply-To: <465C7DB9-65A5-456E-A398-0AC114944448@yale.edu> References: <465C7DB9-65A5-456E-A398-0AC114944448@yale.edu> Message-ID: <48692445.1090802@noaa.gov> Zachary Pincus wrote: > (1) It appears that modules included via the py2app 'includes' option do > not have their full dependencies added. That "may" be by intent. "includes" is for modules that are not found by the normal dependency tracking. It should not be required unless you are doing non-standard importing. I don't think py2app tries to do dependency tracking for these. "packages" should bring in entire packages, however. I find it easier to just add an import statement somewhere, if I know I"ll need the module (I've needed to do this when code is unpicking, and the objects pickled where defined in modules not otherwise used) > (2) It appears that any packages that I include via the py2app > 'packages' option are copied verbatim from the *source*, not *build* > directory. Take a look at the archive of this list, this sounds like a familiar question. One idea is to make sure you're running py2app from a "clean" location -- one where there is just your apps source code, and not source from installed packages. -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 Mon Jun 30 20:28:20 2008 From: Chris.Barker at noaa.gov (Christopher Barker) Date: Mon, 30 Jun 2008 11:28:20 -0700 Subject: [Pythonmac-SIG] Py2app - problem building with a localized package In-Reply-To: <20C302AD-C5CA-4419-BC4B-E9100163B857@leafe.com> References: <20C302AD-C5CA-4419-BC4B-E9100163B857@leafe.com> Message-ID: <486925C4.9070008@noaa.gov> Ed Leafe wrote: > I'm trying to use py2app to build an application, and am running > into the following problem. The app uses the Dabo framework, located in > my site-packages directory. The 'dabo' folder contains several > directories that are sub-modules of the framework, as well as a > directory named 'locale' containing the .po and .mo localization files > for each available translation. as a rule, py2app only installs python and compiled extension modules -- it doesn't know about .po and .mo files. The solution is to force include these. It looks like a dabo recipe is in order. Take a look at the matplotlib recipe -- it needs to include a bunch of data files also. /Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/py2app-0.4.2-py2.5.egg/py2app/recipes Actually, looking there, it looks like it's as simple as explicitly include the dabo package. -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 Mon Jun 30 20:42:16 2008 From: Chris.Barker at noaa.gov (Christopher Barker) Date: Mon, 30 Jun 2008 11:42:16 -0700 Subject: [Pythonmac-SIG] Distribute command-line tools with py2app or similar? In-Reply-To: References: Message-ID: <48692908.7050007@noaa.gov> Zachary Pincus wrote: > Py2app seems optimized for creating OS X GUI > "app" bundles, not command-line programs. That's correct, command-line programs really aren't what the Mac is about! (even though I use them all the time...) > Ideally, I'd want this to work regardless of what the user has on their > computer -- so I don't just want to make an mpkg that blindly installs a > python and other module dependencies (e.g. numpy), because I wouldn't > want to clobber previous installs. And I don't want to burden the users > with some lengthy set of instructions about what to download depending > on what version of what else they have... (e.g. what if they have and > depend on numpy 1.0.6 and I require 1.1?) > I'd just love a self-contained directory that contains the python > "runtime" and all dependencies in a that I could distribute in a > portable fashion. I haven't tried this, but can you build python from source, specifying an alternate install directory? This could give you a custom build that you could make a mpkg out of. you might try: ./configure --enable-framework=/Library/Frameworks/MyPython --enable-universalsdk Then make sure that your scripts have your python in their #!lines. You could probably just built it as a regular old *nix build, too, rather than a Framework, if all you want to do is run command line tools. note that you'll probably need to build all the third party packages you need too. I've just tried this, and it seems to work, but I haven't tried moving it to another machine or anything. It does try to overwrite the stuff in Applications/MacPython 2.5 You can't just copy the standard installed version, as the paths to all dependent libs are built in. There are tools to change that, which is what py2app does, but that brings us to: > Can I > somehow grab the parts I need from a py2app bundle and just distribute > that? Probably. You can run the executable that py2app builds be calling it directly from the command line, so if you put a symlink in to that somewhere, it might act just like a command line app. If you have a number of command line tools that rely on the same packages, you could probably just copy the executable from one app bundle to another. I haven't tried any of this, though. -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