From noah.gift at gmail.com Thu Nov 1 14:30:20 2007 From: noah.gift at gmail.com (Noah Gift) Date: Thu, 1 Nov 2007 09:30:20 -0400 Subject: [Pythonmac-SIG] [Pyobjc-dev] pyobjc 2.0 has landed in the repository In-Reply-To: <75FEE7A1-EDE6-4AA5-A2FE-EF89A9EBCBA8@mac.com> References: <75FEE7A1-EDE6-4AA5-A2FE-EF89A9EBCBA8@mac.com> Message-ID: Very exciting Ronald! Thanks for the hard work. It appears that I need to go to WWDC next year....that is where all the cool stuff happens. Any recommendations on something cool to do a 10 minute demo on for our local Python User's group? I just now started playing with some of the examples from svn....like dragitemaround On 11/1/07, Ronald Oussoren wrote: > > Folks, > > I have commited the version of pyobjc that's included in Leopard into > the public repository. This version is mostly useful on Leopard right > now, as it doesn't include complete metadata files but relies on the > metadata files on the system. Those are present in Leopard, but not on > Tiger (because we made those up during the development of Leopard). > > There is also a copy of PyOpenGL there that builds cleanly on OSX > (both Leopard and Tiger). > > There are currently three URLs for this version: > > * http://svn.red-bean.com/pyobjc/branches/pyobjc2 > This is the trunk for PyObjC 2.x development > > * http://svn.red-bean.com/pyobjc/branches/pyobjc-20x-branch > This is a branch for pyobjc 2.0.x, pure bugfix releases > > * http://svn.red-bean.com/pyobjc/tags/r200-leopard > The tag for pyobjc 2.0 > > I have some plans for future development, but will probably focus on > development with rather than on PyObjC for a while. > > Ronald > ------------------------------------------------------------------------- > This SF.net email is sponsored by: Splunk Inc. > Still grepping through log files to find problems? Stop. > Now Search log events and configuration files using AJAX and a browser. > Download your FREE copy of Splunk now >> http://get.splunk.com/ > _______________________________________________ > Pyobjc-dev mailing list > Pyobjc-dev at lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/pyobjc-dev > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/pythonmac-sig/attachments/20071101/7b57f532/attachment.htm From ronaldoussoren at mac.com Thu Nov 1 14:10:47 2007 From: ronaldoussoren at mac.com (Ronald Oussoren) Date: Thu, 1 Nov 2007 14:10:47 +0100 Subject: [Pythonmac-SIG] pyobjc 2.0 has landed in the repository Message-ID: <75FEE7A1-EDE6-4AA5-A2FE-EF89A9EBCBA8@mac.com> Folks, I have commited the version of pyobjc that's included in Leopard into the public repository. This version is mostly useful on Leopard right now, as it doesn't include complete metadata files but relies on the metadata files on the system. Those are present in Leopard, but not on Tiger (because we made those up during the development of Leopard). There is also a copy of PyOpenGL there that builds cleanly on OSX (both Leopard and Tiger). There are currently three URLs for this version: * http://svn.red-bean.com/pyobjc/branches/pyobjc2 This is the trunk for PyObjC 2.x development * http://svn.red-bean.com/pyobjc/branches/pyobjc-20x-branch This is a branch for pyobjc 2.0.x, pure bugfix releases * http://svn.red-bean.com/pyobjc/tags/r200-leopard The tag for pyobjc 2.0 I have some plans for future development, but will probably focus on development with rather than on PyObjC for a while. Ronald -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 2224 bytes Desc: not available Url : http://mail.python.org/pipermail/pythonmac-sig/attachments/20071101/6dd8aac5/attachment.bin From woklist at kyngchaos.com Thu Nov 1 17:32:58 2007 From: woklist at kyngchaos.com (William Kyngesburye) Date: Thu, 1 Nov 2007 11:32:58 -0500 Subject: [Pythonmac-SIG] Leopard python architectures in setup.py Message-ID: <9E16F0E2-5416-4044-BC3C-B417DF7AC237@kyngchaos.com> (Is it OK to ask about Apple's Leopard Python 2.5?) I'm a little confused about the 64bit-ness of Apple's Python 2.5. I see that the framework is, but the python executable is only universal 32bit. The modules (lib/python2.5/lib-dynload) and extras are a mix of 64bit and non-64bit, I presume because some depend on Carbon, which is not 64bit). When I build a package with setup.py, it always seems to build universal non-64bit, even though I've checked that the extras that it depends on (numpy) are 64bit-capable. Is there a way to get setup.py to build 64bit? I'm just building a package from source, and don't really know much about developing python extensions. ----- William Kyngesburye http://www.kyngchaos.com/ "I ache, therefore I am. Or in my case - I am, therefore I ache." - Marvin From delza at livingcode.org Thu Nov 1 18:41:58 2007 From: delza at livingcode.org (Dethe Elza) Date: Thu, 1 Nov 2007 10:41:58 -0700 Subject: [Pythonmac-SIG] [Pyobjc-dev] pyobjc 2.0 has landed in the repository In-Reply-To: <75FEE7A1-EDE6-4AA5-A2FE-EF89A9EBCBA8@mac.com> References: <75FEE7A1-EDE6-4AA5-A2FE-EF89A9EBCBA8@mac.com> Message-ID: <24d517dd0711011041g36bfccb4ud8e7bef15ac5aec@mail.gmail.com> Thanks for all the work you've put into this Ronald! My copy of Leopard is due to arrive today and I'm eager to play with the new frameworks. --Dethe From bwaters at nrao.edu Thu Nov 1 20:04:54 2007 From: bwaters at nrao.edu (Boyd Waters) Date: Thu, 1 Nov 2007 13:04:54 -0600 Subject: [Pythonmac-SIG] Leopard python architectures in setup.py In-Reply-To: <9E16F0E2-5416-4044-BC3C-B417DF7AC237@kyngchaos.com> References: <9E16F0E2-5416-4044-BC3C-B417DF7AC237@kyngchaos.com> Message-ID: I haven't tested this extensively, but I believe you could add a compiler options to the setup.py command line: python setup.py -Xcompiler -m64 -arch x86_64 Or something like that. I have a 64-bit Leopard machine in the other room. I'll try it and see. On Nov 1, 2007, at 10:32 AM, William Kyngesburye wrote: > Is there a way to get setup.py to build 64bit? I'm just building a > package from source, and don't really know much about developing > python extensions. From ellisonbg.net at gmail.com Thu Nov 1 20:45:18 2007 From: ellisonbg.net at gmail.com (Brian Granger) Date: Thu, 1 Nov 2007 13:45:18 -0600 Subject: [Pythonmac-SIG] sys.path on Leopard Message-ID: <6ce0ac130711011245h7163c02i89b1c9d569c0f41d@mail.gmail.com> Hi, I have been playing around with python on Leopard today. Overall, I am very pleased, but I just ran into a problem that will affect a large number of users. In Leopard, Apple includes a number of python packages in: ls /System/Library/Frameworks/Python.framework/Versions/2.5/Extras/lib/python CoreGraphics easy_install.pyc setuptools-0.6c7-py2.5.egg-info OpenSSL fetchmailconf.py site.py PyObjC fetchmailconf.pyc site.pyc PyObjC.pth fetchmailconf.pyo site.pyo PyRSS2Gen-1.0.0-py2.5.egg-info libsvn svn PyRSS2Gen.py macholib twisted PyRSS2Gen.pyc macholib-1.2.1.dev-py2.5.egg-info wx Twisted-2.4.0-py2.5.egg-info modulegraph wx-2.8-mac-unicode Twisted_Words-0.4.0-py2.5.egg-info modulegraph-0.7.2.dev-py2.5.egg-info wxPython Twisted_Xish-0.4.0-py2.5.egg-info numpy wxPython_common-2.8.4.0-py2.5.egg-info altgraph numpy-1.0.1-py2.5.egg-info wxaddons altgraph-0.6.8.dev-py2.5.egg-info pkg_resources.py wxaddons-2.8.4.0-py2.5.egg-info bdist_mpkg pkg_resources.pyc wxversion.py bdist_mpkg-0.4.3.dev-py2.5.egg-info py2app wxversion.pyc bonjour py2app-0.4.1.dev-py2.5.egg-info xattr bonjour_py-0.2-py2.5.egg-info pyOpenSSL-0.6-py2.5.egg-info xattr-0.5-py2.5.egg-info dateutil python_dateutil-1.2-py2.5.egg-info zope easy_install.py setuptools zope.interface-3.3.0-py2.5.egg-info At first I was very excited to see that Apple is including things like setuptools, numpy, twisted...... But then I saw that some of the versions are quite old. Naturally, I grabbed the latest numpy version from svn and did a python setup.py install. Everything built just fine, but when I did an import numpy, I got Apples version: >>> import numpy >>> print numpy.__file__ /System/Library/Frameworks/Python.framework/Versions/2.5/Extras/lib/python/numpy/__init__.pyc After looking at sys.path, it became clear what the problem is: Running python setup.py install on Leopard causes packages to be installed in the usual: /Library/Python/2.5/site-packages But, Apple put this directory _after_ /System/Library/Frameworks/Python.framework/Versions/2.5/Extras/lib/python in sys.path. This, even if a user installs a newer version of one of these packages, the builtin python will always use Apple's older version. Obviously, I can set PYTHONPATH to get /Library/Python/2.5/site-packages earlier in the sys.path list, but this is going to bite many people. Is this a bug that I should report to Apple, or is there a better work around? Also, this information needs to be posted somewhere so we don't see this question a billion times on various lists over the lifetime of Leopard. Cheers, Brian From Jack.Jansen at cwi.nl Thu Nov 1 21:14:38 2007 From: Jack.Jansen at cwi.nl (Jack Jansen) Date: Thu, 1 Nov 2007 21:14:38 +0100 Subject: [Pythonmac-SIG] sys.path on Leopard In-Reply-To: <6ce0ac130711011245h7163c02i89b1c9d569c0f41d@mail.gmail.com> References: <6ce0ac130711011245h7163c02i89b1c9d569c0f41d@mail.gmail.com> Message-ID: <74A27434-9C03-4D7F-93F3-42AFCA93AE81@cwi.nl> On 1-Nov-2007, at 20:45 , Brian Granger wrote: > Running python setup.py install on Leopard causes packages to be > installed in the usual: > > /Library/Python/2.5/site-packages > > But, Apple put this directory _after_ > > /System/Library/Frameworks/Python.framework/Versions/2.5/Extras/lib/ > python > > in sys.path. This, even if a user installs a newer version of one of > these packages, the builtin python will always use Apple's older > version. Bah. The order is very strange: - First most of the Python-supplied and Apple-supplied directories, - Then /Library/Python/2.5/site-packages - Then PyObjC, which is also Apple-supplied - Then $HOME/Library/Python/2.5/site-packages, if it exists. By all means, report a bug. There is a workaround that packages can use to fix this, by the way, through using Python code inside a .pth file. I used that in the distant past to allow packman to fix bugs in system packages. I put the following line (without indentation) into ~/Library/Python/ 2.5/site-packages/HackPath.pth import sys ; sys.path.insert(0, '/Users/jack/MyPythonPrependedPath') And, indeed, '/Users/jack/MyPythonPrependedPath' ends up as the first entry in sys.path. -- 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 Chris.Barker at noaa.gov Fri Nov 2 00:12:02 2007 From: Chris.Barker at noaa.gov (Christopher Barker) Date: Thu, 01 Nov 2007 16:12:02 -0700 Subject: [Pythonmac-SIG] [Numpy-discussion] Problem with numpy on Leopard In-Reply-To: <472A3146.8000303@gmail.com> References: <6ce0ac130711011250o73d50c1du944fb62a3263c6ad@mail.gmail.com> <472A3146.8000303@gmail.com> Message-ID: <472A5D42.5070500@noaa.gov> Robert Kern wrote: >> The problem will arise for every package, not only numpy, so Apple >> fixing this is the best solution IMHO. > > It's unlikely they are going to. If they put that stuff there, it's because they > are using it for something, not as an (in)convenience to you. I don't recommend > using the Python.framework in /System for anything except for distributing > lightweight .apps. AARRGG! This has come up before, when IBM was putting python in systems for some reason. Also, anyone remember RedHat, when upgrading python all their stuff would break. The problem there was that they refused, for some unknown reason, to specify a python version in their #! lines, nor did they specify a path (i.e., they used /usr/bin/env python) -- so you couldn't change the default python without all of RedHat's utilities breaking. The issue here is that if Apple had put site-packages on the path before their Extras dir, then when someone did something like install an upgrade to numpy (what a good idea) there is a chance that some Apple-supplied utility that relies on numpy would break. Hence Roberts solution: treat the Apple Python as a system only tool, only to be added to by Apple themselves. I guess that's OK, but it's really silly that it has to be that way. The solution: support versioning of packages in python! This came up some years ago, when wxPython developed a versioning system -- it would have made much more sense for their to be a standard way to do it, but the core folks on python-dev didn't see the point. oh well. The way I see it, python is a very good, robust, general purpose tool. It's a great thing for OS suppliers to provide python for system and users use -- I'd love to see it treated as other system libraries and utilities are, but to do that, there must be a versioning system for packages -- so Apple can use the version they installed, and a user can install and upgrade along side it, and not break anything. It's analygous to shared libraries -- it's insane to use shared libs without versions - we'd have to statically link everything. Having to install all of Python, and all those packages because you want to upgrade numpy just seems crazy. Sorry about 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 noah.gift at gmail.com Fri Nov 2 00:15:15 2007 From: noah.gift at gmail.com (Noah Gift) Date: Thu, 1 Nov 2007 19:15:15 -0400 Subject: [Pythonmac-SIG] Pythonmac-SIG Digest, Vol 55, Issue 2 In-Reply-To: References: Message-ID: > > > > ---------- Forwarded message ---------- > From: Christopher Barker > To: Discussion of Numerical Python , > Pythonmac-Sig > Date: Thu, 01 Nov 2007 16:12:02 -0700 > Subject: Re: [Pythonmac-SIG] [Numpy-discussion] Problem with numpy on > Leopard > Robert Kern wrote: > > The way I see it, python is a very good, robust, general purpose tool. > It's a great thing for OS suppliers to provide python for system and > users use -- I'd love to see it treated as other system libraries and > utilities are, but to do that, there must be a versioning system for > packages -- so Apple can use the version they installed, and a user can > install and upgrade along side it, and not break anything. I was just thinking the same thing. It is awesome that Apple is getting really big into Python, but it presents a small worry about how the system version of Python and the fancy bridge, and the inevitable rapid development of these third party modules, and Python itself. For example, try upgrading upgrading, say, mod_python on Cent OS 4.4. Good luck with that... -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/pythonmac-sig/attachments/20071101/55d18780/attachment.htm From njriley at uiuc.edu Fri Nov 2 00:16:20 2007 From: njriley at uiuc.edu (Nicholas Riley) Date: Thu, 1 Nov 2007 18:16:20 -0500 Subject: [Pythonmac-SIG] Leopard python architectures in setup.py In-Reply-To: <9E16F0E2-5416-4044-BC3C-B417DF7AC237@kyngchaos.com> References: <9E16F0E2-5416-4044-BC3C-B417DF7AC237@kyngchaos.com> Message-ID: <20071101231620.GA73577@uiuc.edu> On Thu, Nov 01, 2007 at 11:32:58AM -0500, William Kyngesburye wrote: > (Is it OK to ask about Apple's Leopard Python 2.5?) > > I'm a little confused about the 64bit-ness of Apple's Python 2.5. I > see that the framework is, but the python executable is only universal > 32bit. The modules (lib/python2.5/lib-dynload) and extras are a mix > of 64bit and non-64bit, I presume because some depend on Carbon, which > is not 64bit). > > When I build a package with setup.py, it always seems to build > universal non-64bit, even though I've checked that the extras that it > depends on (numpy) are 64bit-capable. > > Is there a way to get setup.py to build 64bit? I'm just building a > package from source, and don't really know much about developing > python extensions. Apple documents this in their release notes: -- Nicholas Riley | From woklist at kyngchaos.com Fri Nov 2 00:29:04 2007 From: woklist at kyngchaos.com (William Kyngesburye) Date: Thu, 1 Nov 2007 18:29:04 -0500 Subject: [Pythonmac-SIG] Leopard python architectures in setup.py In-Reply-To: <20071101231620.GA73577@uiuc.edu> References: <9E16F0E2-5416-4044-BC3C-B417DF7AC237@kyngchaos.com> <20071101231620.GA73577@uiuc.edu> Message-ID: Cool. Thanks, that's what I need. On Nov 1, 2007, at 6:16 PM, Nicholas Riley wrote: > On Thu, Nov 01, 2007 at 11:32:58AM -0500, William Kyngesburye wrote: >> (Is it OK to ask about Apple's Leopard Python 2.5?) >> >> I'm a little confused about the 64bit-ness of Apple's Python 2.5. I >> see that the framework is, but the python executable is only >> universal >> 32bit. The modules (lib/python2.5/lib-dynload) and extras are a mix >> of 64bit and non-64bit, I presume because some depend on Carbon, >> which >> is not 64bit). >> >> When I build a package with setup.py, it always seems to build >> universal non-64bit, even though I've checked that the extras that it >> depends on (numpy) are 64bit-capable. >> >> Is there a way to get setup.py to build 64bit? I'm just building a >> package from source, and don't really know much about developing >> python extensions. > > Apple documents this in their release notes: > > > > > -- > Nicholas Riley | > > _______________________________________________ > Pythonmac-SIG maillist - Pythonmac-SIG at python.org > http://mail.python.org/mailman/listinfo/pythonmac-sig ----- William Kyngesburye http://www.kyngchaos.com/ [Trillian] What are you supposed to do WITH a maniacally depressed robot? [Marvin] You think you have problems? What are you supposed to do if you ARE a maniacally depressed robot? No, don't try and answer, I'm 50,000 times more intelligent than you and even I don't know the answer... - HitchHiker's Guide to the Galaxy From bwaters at nrao.edu Fri Nov 2 00:33:54 2007 From: bwaters at nrao.edu (Boyd Waters) Date: Thu, 1 Nov 2007 17:33:54 -0600 Subject: [Pythonmac-SIG] sys.path on Leopard In-Reply-To: <74A27434-9C03-4D7F-93F3-42AFCA93AE81@cwi.nl> References: <6ce0ac130711011245h7163c02i89b1c9d569c0f41d@mail.gmail.com> <74A27434-9C03-4D7F-93F3-42AFCA93AE81@cwi.nl> Message-ID: <5F5AD5E2-05FD-4F99-8229-61E861350557@nrao.edu> Sorry I don't know the answer to this, but... Are you saying that there are two passes in the sys.path resolution? first pass: go through the sys.path elements and parse (execute) the .pth files second pass: load things Actually I suppose there is no "second pass" -- it's just that .pth files are executed *before* modules are loaded. Is that right? SO that modifying the order of sys.path elements works as expected? On Nov 1, 2007, at 2:14 PM, Jack Jansen wrote: > I put the following line (without indentation) into ~/Library/Python/ > 2.5/site-packages/HackPath.pth > import sys ; sys.path.insert(0, '/Users/jack/MyPythonPrependedPath') > And, indeed, '/Users/jack/MyPythonPrependedPath' ends up as the first > entry in sys.path. From nad at acm.org Fri Nov 2 00:46:01 2007 From: nad at acm.org (Ned Deily) Date: Thu, 01 Nov 2007 16:46:01 -0700 Subject: [Pythonmac-SIG] Problem with numpy on Leopard References: <6ce0ac130711011250o73d50c1du944fb62a3263c6ad@mail.gmail.com> <472A3146.8000303@gmail.com> <472A5D42.5070500@noaa.gov> Message-ID: In article <472A5D42.5070500 at noaa.gov>, Christopher Barker wrote: > [...] AARRGG! > [...] > Hence Roberts solution: treat the Apple Python as a system only tool, > only to be added to by Apple themselves. I guess that's OK, but it's > really silly that it has to be that way. > > The solution: support versioning of packages in python! This came up > some years ago, when wxPython developed a versioning system -- it would > have made much more sense for their to be a standard way to do it, but > the core folks on python-dev didn't see the point. oh well. Ah, but there is a de-facto standard multi-platform Python versioning system out there in ever increasing use: setuptools (a.k.a easy_install). It's just *not* *quite* there yet, as in not yet being in the standard library. Still, it is designed to be easily bootstrapped into vanilla systems, it has the best chance of making it there of anything else out there, and the fact that it is plug-compatible with distutils for most applications is a huge plus. > The way I see it, python is a very good, robust, general purpose tool. > It's a great thing for OS suppliers to provide python for system and > users use -- I'd love to see it treated as other system libraries and > utilities are, but to do that, there must be a versioning system for > packages -- so Apple can use the version they installed, and a user can > install and upgrade along side it, and not break anything. > > It's analygous to shared libraries -- it's insane to use shared libs > without versions - we'd have to statically link everything. Having to > install all of Python, and all those packages because you want to > upgrade numpy just seems crazy. There's another way to look at the issue in the OSX world, though. Apple strongly encourages the use of application packages and the tools provided for Python on OSX, i.e. py2app, make it easy for developers to provide robust, stand-alone applications without dependencies on shared libraries. Yes, that may lead to some wasted disk space, with multiple copies of otherwise potentially sharable libraries hidden under the covers of the application, but delivering a stand-alone application via a single drag-and-drop disk image rather than with an installer that has to manage library dependencies makes the extra disk space a small price to pay. Or, at least, that's what we're encouraged to believe. I do after seeing problems like the one you're wrestling with now. -- Ned Deily, nad at acm.org From delza at livingcode.org Fri Nov 2 00:47:07 2007 From: delza at livingcode.org (Dethe Elza) Date: Thu, 1 Nov 2007 16:47:07 -0700 Subject: [Pythonmac-SIG] [Numpy-discussion] Problem with numpy on Leopard In-Reply-To: <472A5D42.5070500@noaa.gov> References: <6ce0ac130711011250o73d50c1du944fb62a3263c6ad@mail.gmail.com> <472A3146.8000303@gmail.com> <472A5D42.5070500@noaa.gov> Message-ID: <24d517dd0711011647u1a05d42ckbae5355a6f0ef74f@mail.gmail.com> On 11/1/07, Christopher Barker wrote: > Robert Kern wrote: > > It's unlikely they are going to. If they put that stuff there, it's because they > > are using it for something, not as an (in)convenience to you. I don't recommend > > using the Python.framework in /System for anything except for distributing > > lightweight .apps. > Hence Roberts solution: treat the Apple Python as a system only tool, > only to be added to by Apple themselves. I guess that's OK, but it's > really silly that it has to be that way. It's not entirely silly. This has been the advice given to app developers on this list and the PyObjC list for years now. It's nice to have a better system Python for quick scripts, but it's still the System Python. It's Apples, for their stuff that uses Python. And it is specific to OS 10.5. If you use it to build your app, your app is pretty much guaranteed not to work when someone tries to run it on 10.6, etc. Maybe they have changed how py2app works in 10.5, but the old behavior was to embed Python into your app, UNLESS it was the system python. Unless there is evidence to the contrary (I don't have Leopard yet), I assume that is still true. The old advice still holds: For building apps, install your own framework build of Python, put it first in your path, and add any libraries you require to it. Then you have control over what goes into your app, not Apple. --Dethe From woklist at kyngchaos.com Fri Nov 2 02:11:39 2007 From: woklist at kyngchaos.com (William Kyngesburye) Date: Thu, 1 Nov 2007 20:11:39 -0500 Subject: [Pythonmac-SIG] Leopard python architectures in setup.py In-Reply-To: <20071101231620.GA73577@uiuc.edu> References: <9E16F0E2-5416-4044-BC3C-B417DF7AC237@kyngchaos.com> <20071101231620.GA73577@uiuc.edu> Message-ID: <181FBE7A-C752-46CB-848E-E92DA7781E4F@kyngchaos.com> I just realized - if the python executables are only 32bit universal, what's the point of having anything else in python (including the python framework) 64bit? Is there some alternate way of using python that would operate in 64bits? Maybe I should wait for a non-Apple 64bit build, considering the other discussion about Apple's Python. ----- William Kyngesburye http://www.kyngchaos.com/ "Time is an illusion - lunchtime doubly so." - Ford Prefect From m.vanland at gmail.com Fri Nov 2 02:44:20 2007 From: m.vanland at gmail.com (Michael VanLandingham) Date: Thu, 1 Nov 2007 18:44:20 -0700 Subject: [Pythonmac-SIG] more tab completion issues. Message-ID: Following along the whole rlcompleter/readline/editline thread, I noticed today that when I do tab completion on a class, I get everything listed twice.Happens in python and ipython. Example: >>> i = int(5) >>> i 5 >>> i.__ Display all 121 possibilities? (y or n) i.__abs__ i.__abs__ i.__add__ i.__add__ i.__and__ i.__and__ i.__class__ i.__class__ ...etc. I don't see duplicates if I do 'dir(i)' Is anyone else seeing this behavior? Any ideas why? Something in the rlcompleter or readline... Seems to occur with any class. -Michael -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/pythonmac-sig/attachments/20071101/e1acc8ce/attachment-0001.htm From bwaters at nrao.edu Fri Nov 2 03:59:57 2007 From: bwaters at nrao.edu (Boyd Waters) Date: Thu, 1 Nov 2007 20:59:57 -0600 Subject: [Pythonmac-SIG] more tab completion issues. In-Reply-To: References: Message-ID: <1AF1D9DA-4AE1-49A2-98DA-73048AE2AC22@nrao.edu> I get even more duplicates than that... >>> i.__ Display all 121 possibilities? (y or n) i.__abs__ i.__abs__ i.__add__ i.__add__ i.__and__ i.__and__ i.__class__ i.__class__ i.__class__ i.__class__ i.__cmp__ i.__cmp__ i.__coerce__ i.__coerce__ i.__delattr__ i.__delattr__ i.__delattr__ i.__div__ ... Funny. On Nov 1, 2007, at 7:44 PM, Michael VanLandingham wrote: > Following along the whole rlcompleter/readline/editline thread, I > noticed today that when I do tab completion on a class, I get > everything listed twice. > Happens in python and ipython. > Example: > >>> i = int(5) > >>> i > 5 > >>> i.__ > Display all 121 possibilities? (y or n) > i.__abs__ i.__abs__ i.__add__ i.__add__ > i.__and__ i.__and__ i.__class__ > i.__class__ > ...etc. > > > I don't see duplicates if I do 'dir(i)' > > Is anyone else seeing this behavior? Any ideas why? Something in > the rlcompleter or readline... Seems to occur with any class. > > > -Michael > > _______________________________________________ > Pythonmac-SIG maillist - Pythonmac-SIG at python.org > http://mail.python.org/mailman/listinfo/pythonmac-sig From m.vanland at gmail.com Fri Nov 2 04:25:52 2007 From: m.vanland at gmail.com (Michael VanLandingham) Date: Thu, 1 Nov 2007 20:25:52 -0700 Subject: [Pythonmac-SIG] more tab completion issues. In-Reply-To: <1AF1D9DA-4AE1-49A2-98DA-73048AE2AC22@nrao.edu> References: <1AF1D9DA-4AE1-49A2-98DA-73048AE2AC22@nrao.edu> Message-ID: Yeah after looking at it again, I noticed certain things, like __class__, had 4, and not 1, entries in the listing. It's a bit annoying, since with something like numpy's 'array', it'll fill up your window with 320+ items. I thought about debugging it, but I don't know how to intercept the 'tab' keystroke in the tab completion. -mvl On Nov 1, 2007, at 7:59 PM, Boyd Waters wrote: > I get even more duplicates than that... > >>> i.__ > Display all 121 possibilities? (y or n) > i.__abs__ i.__abs__ i.__add__ > i.__add__ i.__and__ i.__and__ > i.__class__ i.__class__ i.__class__ > i.__class__ i.__cmp__ i.__cmp__ > i.__coerce__ i.__coerce__ i.__delattr__ > i.__delattr__ i.__delattr__ i.__div__ > ... > > Funny. > > > > On Nov 1, 2007, at 7:44 PM, Michael VanLandingham wrote: > >> Following along the whole rlcompleter/readline/editline thread, I >> noticed today that when I do tab completion on a class, I get >> everything listed twice. >> Happens in python and ipython. >> Example: >> >>> i = int(5) >> >>> i >> 5 >> >>> i.__ >> Display all 121 possibilities? (y or n) >> i.__abs__ i.__abs__ i.__add__ i.__add__ >> i.__and__ i.__and__ i.__class__ >> i.__class__ >> ...etc. >> >> >> I don't see duplicates if I do 'dir(i)' >> >> Is anyone else seeing this behavior? Any ideas why? Something in >> the rlcompleter or readline... Seems to occur with any class. >> >> >> -Michael >> >> _______________________________________________ >> Pythonmac-SIG maillist - Pythonmac-SIG at python.org >> http://mail.python.org/mailman/listinfo/pythonmac-sig > From dav at alum.mit.edu Fri Nov 2 05:09:38 2007 From: dav at alum.mit.edu (Dav Clark) Date: Thu, 1 Nov 2007 21:09:38 -0700 Subject: [Pythonmac-SIG] System python woes In-Reply-To: References: Message-ID: I've seen a couple of posts now about difficulty using the system python in Leopard. I wonder if anyone else has used the solution offered by Phillip Eby here: http://peak.telecommunity.com/DevCenter/EasyInstall#creating-a-virtual-python Basically, this wraps your system (or any) python and allows you to install libraries into that wrapped python - including ones that would override the system defaults. I suppose this strategy could even be "wrapped up" in a distributed application bundle of some sort. I've used this solution for my own development purposes, and it's worked fine. I'd be curious to hear other's experiences or ideas. Dav From ellisonbg.net at gmail.com Fri Nov 2 05:11:36 2007 From: ellisonbg.net at gmail.com (Brian Granger) Date: Thu, 1 Nov 2007 22:11:36 -0600 Subject: [Pythonmac-SIG] [Numpy-discussion] Problem with numpy on Leopard In-Reply-To: <24d517dd0711011647u1a05d42ckbae5355a6f0ef74f@mail.gmail.com> References: <6ce0ac130711011250o73d50c1du944fb62a3263c6ad@mail.gmail.com> <472A3146.8000303@gmail.com> <472A5D42.5070500@noaa.gov> <24d517dd0711011647u1a05d42ckbae5355a6f0ef74f@mail.gmail.com> Message-ID: <6ce0ac130711012111hde8356ew47a17c506698b449@mail.gmail.com> > It's not entirely silly. This has been the advice given to app > developers on this list and the PyObjC list for years now. It's nice > to have a better system Python for quick scripts, but it's still the > System Python. It's Apples, for their stuff that uses Python. And it > is specific to OS 10.5. If you use it to build your app, your app is > pretty much guaranteed not to work when someone tries to run it on > 10.6, etc. At some level I agree - I haven't used the system python on Tiger for a long time now. But, that is not how Apple "sells" the python on their system. > Maybe they have changed how py2app works in 10.5, but the old behavior > was to embed Python into your app, UNLESS it was the system python. > Unless there is evidence to the contrary (I don't have Leopard yet), I > assume that is still true. > > The old advice still holds: For building apps, install your own > framework build of Python, put it first in your path, and add any > libraries you require to it. Then you have control over what goes > into your app, not Apple. > > --Dethe > _______________________________________________ > Pythonmac-SIG maillist - Pythonmac-SIG at python.org > http://mail.python.org/mailman/listinfo/pythonmac-sig > From janssen at parc.com Fri Nov 2 05:55:36 2007 From: janssen at parc.com (Bill Janssen) Date: Thu, 1 Nov 2007 21:55:36 PDT Subject: [Pythonmac-SIG] [Numpy-discussion] Problem with numpy on Leopard In-Reply-To: <6ce0ac130711012111hde8356ew47a17c506698b449@mail.gmail.com> References: <6ce0ac130711011250o73d50c1du944fb62a3263c6ad@mail.gmail.com> <472A3146.8000303@gmail.com> <472A5D42.5070500@noaa.gov> <24d517dd0711011647u1a05d42ckbae5355a6f0ef74f@mail.gmail.com> <6ce0ac130711012111hde8356ew47a17c506698b449@mail.gmail.com> Message-ID: <07Nov1.205537pst."57996"@synergy1.parc.xerox.com> > > It's not entirely silly. This has been the advice given to app > > developers on this list and the PyObjC list for years now. It's nice > > to have a better system Python for quick scripts, but it's still the > > System Python. It's Apples, for their stuff that uses Python. And it > > is specific to OS 10.5. If you use it to build your app, your app is > > pretty much guaranteed not to work when someone tries to run it on > > 10.6, etc. > > At some level I agree - I haven't used the system python on Tiger for > a long time now. But, that is not how Apple "sells" the python on > their system. This is really interesting. For my apps, I use the system Python on Tiger, and expect to do it again with Leopard. If I have to have a specific version of an extension that's needed, I make sure the directory where I keep it is on the sys.path of my application before the standard directories. That seems to be about all that's required. I'm not sure what all the FUD about the system Python is... Bill From Chris.Barker at noaa.gov Fri Nov 2 06:17:56 2007 From: Chris.Barker at noaa.gov (Christopher Barker) Date: Thu, 01 Nov 2007 22:17:56 -0700 Subject: [Pythonmac-SIG] Problem with numpy on Leopard In-Reply-To: References: <6ce0ac130711011250o73d50c1du944fb62a3263c6ad@mail.gmail.com> <472A3146.8000303@gmail.com> <472A5D42.5070500@noaa.gov> Message-ID: <472AB304.2080301@noaa.gov> Ned Deily wrote: > Ah, but there is a de-facto standard multi-platform Python versioning > system out there in ever increasing use: setuptools (a.k.a > easy_install). OK I've heard eggs support versioning, but I've never actually seen it used --how do you specify which version of a package you want to use with setuptools? > Apple strongly encourages the use of application packages and the tools > provided for Python on OSX, i.e. py2app, make it easy for developers to > provide robust, stand-alone applications without dependencies on shared > libraries. py2app is fabulous, and I do use it. It makes lots of sense when delivering a substantial application, but not so much sense when you have a bunch of small utilities -- it just "feels wrong" to build a 25MB package to a 200 line utility. (and a lot of folks don't appreciate getting a 25MB email enclosure!) It's also a pain in the patootie when you're developing. I suppose this may be a time to take a good look at workingenv again... -Chris -- Christopher Barker, Ph.D. Oceanographer Emergency Response Division NOAA/NOS/OR&R (206) 526-6959 voice 7600 Sand Point Way NE (206) 526-6329 fax Seattle, WA 98115 (206) 526-6317 main reception Chris.Barker at noaa.gov From nad at acm.org Fri Nov 2 06:53:55 2007 From: nad at acm.org (Ned Deily) Date: Thu, 01 Nov 2007 22:53:55 -0700 Subject: [Pythonmac-SIG] Problem with numpy on Leopard References: <6ce0ac130711011250o73d50c1du944fb62a3263c6ad@mail.gmail.com> <472A3146.8000303@gmail.com> <472A5D42.5070500@noaa.gov> <472AB304.2080301@noaa.gov> Message-ID: In article <472AB304.2080301 at noaa.gov>, Christopher Barker wrote: > Ned Deily wrote: > > Ah, but there is a de-facto standard multi-platform Python versioning > > system out there in ever increasing use: setuptools (a.k.a > > easy_install). > OK I've heard eggs support versioning, but I've never actually seen it > used --how do you specify which version of a package you want to use > with setuptools? The easiest way is to use the install_requires keyword in setup.py. See the setuptools documentation here: -- Ned Deily, nad at acm.org From nad at acm.org Fri Nov 2 07:59:11 2007 From: nad at acm.org (Ned Deily) Date: Thu, 01 Nov 2007 23:59:11 -0700 Subject: [Pythonmac-SIG] [Numpy-discussion] Problem with numpy on Leopard References: <6ce0ac130711011250o73d50c1du944fb62a3263c6ad@mail.gmail.com> <472A3146.8000303@gmail.com> <472A5D42.5070500@noaa.gov> <24d517dd0711011647u1a05d42ckbae5355a6f0ef74f@mail.gmail.com> <6ce0ac130711012111hde8356ew47a17c506698b449@mail.gmail.com> <07Nov1.205537pst."57996"@synergy1.parc.xerox.com> Message-ID: In article <07Nov1.205537pst."57996"@synergy1.parc.xerox.com>, Bill Janssen wrote: > This is really interesting. For my apps, I use the system Python on > Tiger, and expect to do it again with Leopard. If I have to have a > specific version of an extension that's needed, I make sure the > directory where I keep it is on the sys.path of my application before > the standard directories. That seems to be about all that's required. > I'm not sure what all the FUD about the system Python is... For your own apps on your own machines, sure - you can manage the whole environment and the system Python should be fine (that is, if and until you need a newer build of Python itself). I think the "FUD" you refer to concerns a different problem: developing and distributing multiple-component Python apps to multiple users on multiple machines. Controlling all those environments isn't so easy. Deploying apps and components as eggs using setuptools is one way to simplify that problem; building standalone OSX apps with embedded stripped-down Python runtimes and components using py2app is another. -- Ned Deily, nad at acm.org From ronaldoussoren at mac.com Fri Nov 2 08:03:43 2007 From: ronaldoussoren at mac.com (Ronald Oussoren) Date: Fri, 2 Nov 2007 08:03:43 +0100 Subject: [Pythonmac-SIG] Leopard python architectures in setup.py In-Reply-To: <9E16F0E2-5416-4044-BC3C-B417DF7AC237@kyngchaos.com> References: <9E16F0E2-5416-4044-BC3C-B417DF7AC237@kyngchaos.com> Message-ID: <8B4F9B03-B3DD-4B2F-AE41-3CCB3423AED1@mac.com> On 1 Nov, 2007, at 17:32, William Kyngesburye wrote: > (Is it OK to ask about Apple's Leopard Python 2.5?) > > I'm a little confused about the 64bit-ness of Apple's Python 2.5. I > see that the framework is, but the python executable is only universal > 32bit. The modules (lib/python2.5/lib-dynload) and extras are a mix > of 64bit and non-64bit, I presume because some depend on Carbon, which > is not 64bit). > > When I build a package with setup.py, it always seems to build > universal non-64bit, even though I've checked that the extras that it > depends on (numpy) are 64bit-capable. > > Is there a way to get setup.py to build 64bit? I'm just building a > package from source, and don't really know much about developing > python extensions. As you've noticed the actual framework is 64bit but the commandline tools are not. It should be easy enough to add 64-bit command-line tools as well, but even then you'll have to add extra arguments to build 64-bit extensions (as Boyd mentions). Ronald > > > ----- > William Kyngesburye > http://www.kyngchaos.com/ > > "I ache, therefore I am. Or in my case - I am, therefore I ache." > > - Marvin > > > _______________________________________________ > 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 : http://mail.python.org/pipermail/pythonmac-sig/attachments/20071102/b2b761fb/attachment-0001.bin From ronaldoussoren at mac.com Fri Nov 2 08:09:10 2007 From: ronaldoussoren at mac.com (Ronald Oussoren) Date: Fri, 2 Nov 2007 08:09:10 +0100 Subject: [Pythonmac-SIG] System python woes In-Reply-To: References: Message-ID: <82045FBD-8EF3-4F14-9943-6CC70F446494@mac.com> On 2 Nov, 2007, at 5:09, Dav Clark wrote: > I've seen a couple of posts now about difficulty using the system > python in Leopard. I wonder if anyone else has used the solution > offered by Phillip Eby here: > > http://peak.telecommunity.com/DevCenter/EasyInstall#creating-a-virtual-python > > Basically, this wraps your system (or any) python and allows you to > install libraries into that wrapped python - including ones that would > override the system defaults. I suppose this strategy could even be > "wrapped up" in a distributed application bundle of some sort. > > I've used this solution for my own development purposes, and it's > worked fine. I'd be curious to hear other's experiences or ideas. Installing your own stuff as eggs should also do the trick. Possibly after upgrading setuptools (easy_install -U setuptools). BTW. This behaviour is curtesy of setuptools, it does some nasty stuff in the .pth file it installs. Ronald > > > Dav > _______________________________________________ > 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 : http://mail.python.org/pipermail/pythonmac-sig/attachments/20071102/b29ffcf5/attachment.bin From kent37 at tds.net Fri Nov 2 12:32:37 2007 From: kent37 at tds.net (Kent Johnson) Date: Fri, 02 Nov 2007 07:32:37 -0400 Subject: [Pythonmac-SIG] Problem with numpy on Leopard In-Reply-To: <472AB304.2080301@noaa.gov> References: <6ce0ac130711011250o73d50c1du944fb62a3263c6ad@mail.gmail.com> <472A3146.8000303@gmail.com> <472A5D42.5070500@noaa.gov> <472AB304.2080301@noaa.gov> Message-ID: <472B0AD5.6080802@tds.net> Christopher Barker wrote: > I suppose this may be a time to take a good look at workingenv again... Or virtualenv which has replaced workingenv: http://pypi.python.org/pypi/virtualenv Kent From ellisonbg.net at gmail.com Fri Nov 2 16:33:11 2007 From: ellisonbg.net at gmail.com (Brian Granger) Date: Fri, 2 Nov 2007 09:33:11 -0600 Subject: [Pythonmac-SIG] [Numpy-discussion] Problem with numpy on Leopard In-Reply-To: <2964868492913213348@unknownmsgid> References: <6ce0ac130711011250o73d50c1du944fb62a3263c6ad@mail.gmail.com> <472A3146.8000303@gmail.com> <472A5D42.5070500@noaa.gov> <24d517dd0711011647u1a05d42ckbae5355a6f0ef74f@mail.gmail.com> <6ce0ac130711012111hde8356ew47a17c506698b449@mail.gmail.com> <2964868492913213348@unknownmsgid> Message-ID: <6ce0ac130711020833l34f4c881r1813941aeb38acf@mail.gmail.com> On 11/1/07, Bill Janssen wrote: > > > It's not entirely silly. This has been the advice given to app > > > developers on this list and the PyObjC list for years now. It's nice > > > to have a better system Python for quick scripts, but it's still the > > > System Python. It's Apples, for their stuff that uses Python. And it > > > is specific to OS 10.5. If you use it to build your app, your app is > > > pretty much guaranteed not to work when someone tries to run it on > > > 10.6, etc. > > > > At some level I agree - I haven't used the system python on Tiger for > > a long time now. But, that is not how Apple "sells" the python on > > their system. > > This is really interesting. For my apps, I use the system Python on > Tiger, and expect to do it again with Leopard. If I have to have a > specific version of an extension that's needed, I make sure the > directory where I keep it is on the sys.path of my application before > the standard directories. That seems to be about all that's required. > I'm not sure what all the FUD about the system Python is... There is little fear, uncertainty or doubt about this. The problem is that this represents a huge change of behavior for users making the transition to Leopard. On Tiger, a user could download any basically any python pacakge and do "python setup.py install" and things would work. Now under Leopard, this becomes "python setup.py install" + muck with PYTHONPATH or .pth files. I personally have no problem doing this, but many of the casual python users with whom I work will be tripped up by this....and they will come and ask me what to do....over and over again.... Brian From ellisonbg.net at gmail.com Fri Nov 2 16:35:54 2007 From: ellisonbg.net at gmail.com (Brian Granger) Date: Fri, 2 Nov 2007 09:35:54 -0600 Subject: [Pythonmac-SIG] Problem with numpy on Leopard In-Reply-To: <472B0AD5.6080802@tds.net> References: <6ce0ac130711011250o73d50c1du944fb62a3263c6ad@mail.gmail.com> <472A3146.8000303@gmail.com> <472A5D42.5070500@noaa.gov> <472AB304.2080301@noaa.gov> <472B0AD5.6080802@tds.net> Message-ID: <6ce0ac130711020835hf7d8b8ta682b7522268c70c@mail.gmail.com> This is definitely worth looking at for this type of thing. Thanks for the pointer. Brian On 11/2/07, Kent Johnson wrote: > Christopher Barker wrote: > > I suppose this may be a time to take a good look at workingenv again... > > Or virtualenv which has replaced workingenv: > http://pypi.python.org/pypi/virtualenv > > Kent > _______________________________________________ > Pythonmac-SIG maillist - Pythonmac-SIG at python.org > http://mail.python.org/mailman/listinfo/pythonmac-sig > From ellisonbg.net at gmail.com Fri Nov 2 17:16:36 2007 From: ellisonbg.net at gmail.com (Brian Granger) Date: Fri, 2 Nov 2007 10:16:36 -0600 Subject: [Pythonmac-SIG] Round 2 with Leopard+Python Message-ID: <6ce0ac130711020916pf348e27xc5543dbd49f5fce0@mail.gmail.com> Hi, In the process of working through the issues with sys.path on Leopard, I have found another potential Leopard bug that is particularly nasty. In Tiger, sudo preserves environment variables: $ export FOO=/tmp $ python -c "import os; print os.environ['FOO']" /tmp $ sudo python -c "import os; print os.environ['FOO']" /tmp But, in Leopard, sudo does not perserve environment variables: $ export FOO=/tmp $ python -c "import os; print os.environ['FOO']" /tmp $ sudo python -c "import os; print os.environ['FOO']" Password: Traceback (most recent call last): File "", line 1, in File "/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/UserDict.py", line 22, in __getitem__ raise KeyError(key) KeyError: 'FOO' This is a big problem. First, if you have set PYTHONPATH to point sys.path at the site-packages in /Library, this setting will be lost when you do: sudo python setup.py install On another package. I encountered this in building pytables, which requires numpy >= 1.0.3. I had installed numpy 1.0.4, and set my PYTHONPATH to point to it. But, the pytables setup.py script failts because PYTHONPATH is lost and it only sees the older (1.0.1) builtin numpy. Second, some setup.py scripts use environment variables to determine how things are built, find other dependencies, etc. Currently, this will fail on Leopard if such packages are installed into locations that require sudo. I haven't tried it yet, but I expect that this will also hold true for other python installations. The behavior also shows up with ruby on Leopard. The solution currently is to install all packages to locations that don't require sudo to write to. I will file a bug report, but until the bug is fixed, we should explore putting a note on the numpy/scipy site - and even possibly on the python.org site to describe the problem and its workaround. Brian From janssen at parc.com Fri Nov 2 17:31:43 2007 From: janssen at parc.com (Bill Janssen) Date: Fri, 2 Nov 2007 09:31:43 PDT Subject: [Pythonmac-SIG] [Numpy-discussion] Problem with numpy on Leopard In-Reply-To: References: <6ce0ac130711011250o73d50c1du944fb62a3263c6ad@mail.gmail.com> <472A3146.8000303@gmail.com> <472A5D42.5070500@noaa.gov> <24d517dd0711011647u1a05d42ckbae5355a6f0ef74f@mail.gmail.com> <6ce0ac130711012111hde8356ew47a17c506698b449@mail.gmail.com> <07Nov1.205537pst."57996"@synergy1.parc.xerox.com> Message-ID: <07Nov2.083152pst."57996"@synergy1.parc.xerox.com> > I think the "FUD" you refer > to concerns a different problem: developing and distributing > multiple-component Python apps to multiple users on multiple machines. Well, that's actually what I do, on Tiger. I'll be interested to see how hard it is to do it with the system Python on Leopard. Bill From bwaters at nrao.edu Fri Nov 2 19:21:39 2007 From: bwaters at nrao.edu (Boyd Waters) Date: Fri, 2 Nov 2007 12:21:39 -0600 Subject: [Pythonmac-SIG] [Numpy-discussion] Problem with numpy on Leopard In-Reply-To: <6ce0ac130711020833l34f4c881r1813941aeb38acf@mail.gmail.com> References: <6ce0ac130711011250o73d50c1du944fb62a3263c6ad@mail.gmail.com> <472A3146.8000303@gmail.com> <472A5D42.5070500@noaa.gov> <24d517dd0711011647u1a05d42ckbae5355a6f0ef74f@mail.gmail.com> <6ce0ac130711012111hde8356ew47a17c506698b449@mail.gmail.com> <2964868492913213348@unknownmsgid> <6ce0ac130711020833l34f4c881r1813941aeb38acf@mail.gmail.com> Message-ID: <4CCCF70E-C604-46E0-ADBC-667D53EB23C7@nrao.edu> On Nov 2, 2007, at 9:33 AM, Brian Granger wrote: > Now under Leopard, this becomes "python setup.py install" + > muck with PYTHONPATH or .pth files. I'm not sure it's that bad. We ship a fairly complex science application. You might call it a very large set of Python extensions, but the C++ code is way bigger than the Python. Parts of our build system are 15 years old, and we're not set up to build everything from a top-level "setup.py". So I've not yet learned how to make py2app work for me. Instead, I ship a Mac application bundle. On Tiger, it's an Applescript thing, that launches a bash shell script, that sets up the Python path to point to the app bundle first, and then launches the Python that's included in the app bundle. Since I don't know enough Python system engineering, I ship the entire Python distro inside the application. That's for Tiger. It's rock-solid for the end user, no matter what they have installed elsewhere. On Leopard, I'll still put all of my Python extensions inside my Application bundle, and I'll still use a launcher (perhaps written in PyObjC, since I know it will be there) that sets up the path. The user will just double-click the application icon. From Chris.Barker at noaa.gov Fri Nov 2 20:53:40 2007 From: Chris.Barker at noaa.gov (Christopher Barker) Date: Fri, 02 Nov 2007 12:53:40 -0700 Subject: [Pythonmac-SIG] Round 2 with Leopard+Python In-Reply-To: <6ce0ac130711020916pf348e27xc5543dbd49f5fce0@mail.gmail.com> References: <6ce0ac130711020916pf348e27xc5543dbd49f5fce0@mail.gmail.com> Message-ID: <472B8044.3040803@noaa.gov> Brian Granger wrote: > But, in Leopard, sudo does not preserve environment variables: > The solution currently is to install all packages to locations that > don't require sudo to write to. Or use "sudo -s", which starts a shell, then set your env vars: $ sudo -s $ export FOO=/tmp $ python -c "import os; print os.environ['FOO']" should work. But I agree, a change like this in sudo behavior is going to cause a lot of problems! -CHB -- Christopher Barker, Ph.D. Oceanographer Emergency Response Division NOAA/NOS/OR&R (206) 526-6959 voice 7600 Sand Point Way NE (206) 526-6329 fax Seattle, WA 98115 (206) 526-6317 main reception Chris.Barker at noaa.gov From Chris.Barker at noaa.gov Fri Nov 2 21:06:08 2007 From: Chris.Barker at noaa.gov (Christopher Barker) Date: Fri, 02 Nov 2007 13:06:08 -0700 Subject: [Pythonmac-SIG] Problem with numpy on Leopard In-Reply-To: References: <6ce0ac130711011250o73d50c1du944fb62a3263c6ad@mail.gmail.com> <472A3146.8000303@gmail.com> <472A5D42.5070500@noaa.gov> <472AB304.2080301@noaa.gov> Message-ID: <472B8330.3090007@noaa.gov> Ned Deily wrote: > The easiest way is to use the install_requires keyword in setup.py. See > the setuptools documentation here: > > That appears to handle dependencies: install_requires A string or list of strings specifying what other distributions need to be installed when this one is. See the section below on Declaring Dependencies for details and examples of the format of this argument. Which looks quite dangerous, as a matter of fact. For example, I do easy_install foo foo has install_requires("numpy==1.0.3") now setuptools will download and install numpy1.0.3, but it won't get used, 'cause there is an older numpy earlier on the pythonpath. Anyway, I won't looking for dependency management, I was looking for runtime version management: i.e have numpy1.0.2 and numpy1.0.3 both installed, and specify in a given script which one I want to use. If there's a way to do that, then when you develop and test, you specify which numpy to use, if you, or another user has multiple versions installed, the correct one is use. wxPython handles this with a custom system: import wxversion wxversion.select('2.4') or, if you've tested against more than one version: wxversion.select(['2.5.4', '2.5.5', '2.6']) I think PyGtk has a similar system If this was a universal python package feature, and people used it, a lot of these problems would go away. oh well, I got little support for this a few years ago, I doubt it will change now. I think virtualenv may be the answer -- and maybe it's a better one anyway -- I'll have to give it a shot. -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 robert.kern at gmail.com Fri Nov 2 21:23:46 2007 From: robert.kern at gmail.com (Robert Kern) Date: Fri, 02 Nov 2007 15:23:46 -0500 Subject: [Pythonmac-SIG] Problem with numpy on Leopard In-Reply-To: <472B8330.3090007@noaa.gov> References: <6ce0ac130711011250o73d50c1du944fb62a3263c6ad@mail.gmail.com> <472A3146.8000303@gmail.com> <472A5D42.5070500@noaa.gov> <472AB304.2080301@noaa.gov> <472B8330.3090007@noaa.gov> Message-ID: Christopher Barker wrote: > Ned Deily wrote: >> The easiest way is to use the install_requires keyword in setup.py. See >> the setuptools documentation here: >> >> > > That appears to handle dependencies: > > install_requires > A string or list of strings specifying what other distributions need to > be installed when this one is. See the section below on Declaring > Dependencies for details and examples of the format of this argument. > > Which looks quite dangerous, as a matter of fact. For example, I do > > easy_install foo > > foo has install_requires("numpy==1.0.3") > > now setuptools will download and install numpy1.0.3, but it won't get > used, 'cause there is an older numpy earlier on the pythonpath. This is incorrect. sys.path gets modified appropriately. -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad attempt to interpret it as though it had an underlying truth." -- Umberto Eco From njriley at uiuc.edu Fri Nov 2 21:30:55 2007 From: njriley at uiuc.edu (Nicholas Riley) Date: Fri, 2 Nov 2007 15:30:55 -0500 Subject: [Pythonmac-SIG] Problem with numpy on Leopard In-Reply-To: <472B8330.3090007@noaa.gov> References: <6ce0ac130711011250o73d50c1du944fb62a3263c6ad@mail.gmail.com> <472A3146.8000303@gmail.com> <472A5D42.5070500@noaa.gov> <472AB304.2080301@noaa.gov> <472B8330.3090007@noaa.gov> Message-ID: <20071102203055.GA82346@uiuc.edu> On Fri, Nov 02, 2007 at 01:06:08PM -0700, Christopher Barker wrote: > Ned Deily wrote: > > The easiest way is to use the install_requires keyword in setup.py. See > > the setuptools documentation here: > > > > > > That appears to handle dependencies: > > install_requires > A string or list of strings specifying what other distributions need to > be installed when this one is. See the section below on Declaring > Dependencies for details and examples of the format of this argument. > > Which looks quite dangerous, as a matter of fact. For example, I do > > easy_install foo > > foo has install_requires("numpy==1.0.3") > > now setuptools will download and install numpy1.0.3, but it won't get > used, 'cause there is an older numpy earlier on the pythonpath. From : > Any scripts in your project will be installed with wrappers that > verify the availability of the specified dependencies at runtime, and > ensure that the correct versions are added to sys.path (e.g. if > multiple versions have been installed). setuptools definitely supports multiple versions of packages being installed at once, and the ability to select them. It rewrites your scripts for you at installation time to resolve the depdendencies. If you want to use the versioned dependencies during development, that's what 'setup.py develop' is for. -- Nicholas Riley | From ellisonbg.net at gmail.com Fri Nov 2 21:42:11 2007 From: ellisonbg.net at gmail.com (Brian Granger) Date: Fri, 2 Nov 2007 14:42:11 -0600 Subject: [Pythonmac-SIG] sys.path on Leopard In-Reply-To: References: <6ce0ac130711011245h7163c02i89b1c9d569c0f41d@mail.gmail.com> <74A27434-9C03-4D7F-93F3-42AFCA93AE81@cwi.nl> Message-ID: <6ce0ac130711021342l4342bd6eh2bdcb41f291478aa@mail.gmail.com> I guess then that the main different is that the 2.5.1 off python.org doesn't include older versions of things like numpy, twisted, etc. that people would want to upgrdate. Brian On 11/2/07, Martina Oefelein wrote: > > Am 01.11.2007 um 21:14 schrieb Jack Jansen: > > > > > On 1-Nov-2007, at 20:45 , Brian Granger wrote: > >> Running python setup.py install on Leopard causes packages to be > >> installed in the usual: > >> > >> /Library/Python/2.5/site-packages > >> > >> But, Apple put this directory _after_ > >> > >> /System/Library/Frameworks/Python.framework/Versions/2.5/Extras/lib/ > >> python > >> > >> in sys.path. This, even if a user installs a newer version of one of > >> these packages, the builtin python will always use Apple's older > >> version. > > > > > > Bah. The order is very strange: > > - First most of the Python-supplied and Apple-supplied directories, > > - Then /Library/Python/2.5/site-packages > > - Then PyObjC, which is also Apple-supplied > > - Then $HOME/Library/Python/2.5/site-packages, if it exists. > > > > By all means, report a bug. > > > > I think that site-packages comes after the system library is just > normal python behaviour IMHO. At least, it's the same in the > "official" Python 2.5.1 build from python.org, and it's also in the > example path here: > http://docs.python.org/inst/search- > path.html#SECTION000410000000000000000 > > > ciao > Martina > > From Martina at Oefelein.de Fri Nov 2 21:38:49 2007 From: Martina at Oefelein.de (Martina Oefelein) Date: Fri, 2 Nov 2007 21:38:49 +0100 Subject: [Pythonmac-SIG] sys.path on Leopard In-Reply-To: <74A27434-9C03-4D7F-93F3-42AFCA93AE81@cwi.nl> References: <6ce0ac130711011245h7163c02i89b1c9d569c0f41d@mail.gmail.com> <74A27434-9C03-4D7F-93F3-42AFCA93AE81@cwi.nl> Message-ID: Am 01.11.2007 um 21:14 schrieb Jack Jansen: > > On 1-Nov-2007, at 20:45 , Brian Granger wrote: >> Running python setup.py install on Leopard causes packages to be >> installed in the usual: >> >> /Library/Python/2.5/site-packages >> >> But, Apple put this directory _after_ >> >> /System/Library/Frameworks/Python.framework/Versions/2.5/Extras/lib/ >> python >> >> in sys.path. This, even if a user installs a newer version of one of >> these packages, the builtin python will always use Apple's older >> version. > > > Bah. The order is very strange: > - First most of the Python-supplied and Apple-supplied directories, > - Then /Library/Python/2.5/site-packages > - Then PyObjC, which is also Apple-supplied > - Then $HOME/Library/Python/2.5/site-packages, if it exists. > > By all means, report a bug. > I think that site-packages comes after the system library is just normal python behaviour IMHO. At least, it's the same in the "official" Python 2.5.1 build from python.org, and it's also in the example path here: http://docs.python.org/inst/search- path.html#SECTION000410000000000000000 ciao Martina From Martina at Oefelein.de Fri Nov 2 21:38:27 2007 From: Martina at Oefelein.de (Martina Oefelein) Date: Fri, 2 Nov 2007 21:38:27 +0100 Subject: [Pythonmac-SIG] Leopard python architectures in setup.py In-Reply-To: <8B4F9B03-B3DD-4B2F-AE41-3CCB3423AED1@mac.com> References: <9E16F0E2-5416-4044-BC3C-B417DF7AC237@kyngchaos.com> <8B4F9B03-B3DD-4B2F-AE41-3CCB3423AED1@mac.com> Message-ID: <6CAC6EE5-D2D3-4E46-98D1-365B81747348@Oefelein.de> Am 02.11.2007 um 08:03 schrieb Ronald Oussoren: > As you've noticed the actual framework is 64bit but the commandline > tools are not. It should be easy enough to add 64-bit command-line > tools as well, but even then you'll have to add extra arguments to > build 64-bit extensions (as Boyd mentions). I think this actually makes sense: if the command line tools were 32/64 bit universal, scripts would run with the 64 bit version on 64 bit systems, and wouldn't be able to use any of the libraries that are only 32 bit. The framework, on the other hand, should be 32/64 bit universal so that both 32 and 64 bit applications can embed python. ciao Martina From bwaters at nrao.edu Fri Nov 2 21:49:38 2007 From: bwaters at nrao.edu (Boyd Waters) Date: Fri, 2 Nov 2007 14:49:38 -0600 Subject: [Pythonmac-SIG] Round 2 with Leopard+Python In-Reply-To: <6ce0ac130711020916pf348e27xc5543dbd49f5fce0@mail.gmail.com> References: <6ce0ac130711020916pf348e27xc5543dbd49f5fce0@mail.gmail.com> Message-ID: <93611872-5B47-4791-A731-C62446E7160B@nrao.edu> On Nov 2, 2007, at 10:16 AM, Brian Granger wrote: > First, if you have set PYTHONPATH to point > sys.path at the site-packages in /Library, this setting will be lost > when you do: > > sudo python setup.py install Ouch, another good one... This is almost certainly not a bug, but rather a security feature. > The administrator can add a line to the sudoers file: > > Defaults env_reset > > that will reset the environment to only contain the variables HOME, > LOGNAME, > PATH, SHELL, TERM, and USER, preventing this attack. From woklist at kyngchaos.com Fri Nov 2 21:54:31 2007 From: woklist at kyngchaos.com (William Kyngesburye) Date: Fri, 2 Nov 2007 15:54:31 -0500 Subject: [Pythonmac-SIG] Leopard python architectures in setup.py In-Reply-To: <6CAC6EE5-D2D3-4E46-98D1-365B81747348@Oefelein.de> References: <9E16F0E2-5416-4044-BC3C-B417DF7AC237@kyngchaos.com> <8B4F9B03-B3DD-4B2F-AE41-3CCB3423AED1@mac.com> <6CAC6EE5-D2D3-4E46-98D1-365B81747348@Oefelein.de> Message-ID: On Nov 2, 2007, at 3:38 PM, Martina Oefelein wrote: > > Am 02.11.2007 um 08:03 schrieb Ronald Oussoren: > >> As you've noticed the actual framework is 64bit but the commandline >> tools are not. It should be easy enough to add 64-bit command-line >> tools as well, but even then you'll have to add extra arguments to >> build 64-bit extensions (as Boyd mentions). > > I think this actually makes sense: if the command line tools were > 32/64 bit universal, scripts would run with the 64 bit version on 64 > bit systems, and wouldn't be able to use any of the libraries that > are only 32 bit. > > The framework, on the other hand, should be 32/64 bit universal so > that both 32 and 64 bit applications can embed python. > That's where I'm missing info on the other ways Python can be used. So another package links 64bit to the python framework, but it still has to run from some python interpreter executable that is embedded - where does that interpreter come from, if not the one in the framework bundle? ----- William Kyngesburye http://www.kyngchaos.com/ "This is a question about the past, is it? ... How can I tell that the past isn't a fiction designed to account for the discrepancy between my immediate physical sensations and my state of mind?" - The Ruler of the Universe From bwaters at nrao.edu Fri Nov 2 22:02:28 2007 From: bwaters at nrao.edu (Boyd Waters) Date: Fri, 2 Nov 2007 15:02:28 -0600 Subject: [Pythonmac-SIG] Leopard python architectures in setup.py In-Reply-To: <6CAC6EE5-D2D3-4E46-98D1-365B81747348@Oefelein.de> References: <9E16F0E2-5416-4044-BC3C-B417DF7AC237@kyngchaos.com> <8B4F9B03-B3DD-4B2F-AE41-3CCB3423AED1@mac.com> <6CAC6EE5-D2D3-4E46-98D1-365B81747348@Oefelein.de> Message-ID: <0A698030-1116-41F7-AF41-C5C193B3507B@nrao.edu> On Nov 2, 2007, at 2:38 PM, Martina Oefelein wrote: > I think this actually makes sense: if the command line tools were > 32/64 bit universal, scripts would run with the 64 bit version on 64 > bit systems, and wouldn't be able to use any of the libraries that > are only 32 bit. > > The framework, on the other hand, should be 32/64 bit universal so > that both 32 and 64 bit applications can embed python. This gets a bit tricky with Python GUIs. I haven't checked, but I suppose that PyObjC is still 32-bit only. I know that Tk and Qt are 32-bit only at the moment. That is, the Tk that ships from Apple with Leopard is 32-bit. Qt has to be 32-bit for the next year or two since Apple dropped 64-bit Carbon (they need to port the Mac GUI to Cocoa, and that will Take Some Work). From bwaters at nrao.edu Fri Nov 2 22:05:55 2007 From: bwaters at nrao.edu (Boyd Waters) Date: Fri, 2 Nov 2007 15:05:55 -0600 Subject: [Pythonmac-SIG] Round 2 with Leopard+Python In-Reply-To: References: <6ce0ac130711020916pf348e27xc5543dbd49f5fce0@mail.gmail.com> <93611872-5B47-4791-A731-C62446E7160B@nrao.edu> Message-ID: <1C0061DC-C15E-4AE8-8D17-451C3A9ECA62@nrao.edu> FYI: On Leopard, "sudo" filters environment variables, including PYTHONPATH. I have not tested this with MacPorts yet; I've been running MacPorts as a "normal" user without sudo. Will this matter for MacPorts? > Running "sudo -V" as root shows sudo's settings; part of that is > environment variables that it will not pass on or that it will > check for dangerous content. On Nov 2, 2007, at 2:59 PM, Boyd Waters wrote: > One work-around is to add this line to /etc/sudoers: > > Defaults env_keep += "PYTHONPATH" > > > > But that would involve editing a file in /etc as root. > Straightforward enough, but likely to get overwritten and what if > the user screws this up? > > > So Plan B - > > what if you added something in a .pth file in /Library/Python/2.5/ > site-packages that re-orders the sys.path? > > Wouldn't that always work? > > > > > On Nov 2, 2007, at 2:49 PM, Boyd Waters wrote: > >> >> On Nov 2, 2007, at 10:16 AM, Brian Granger wrote: >> >>> First, if you have set PYTHONPATH to point >>> sys.path at the site-packages in /Library, this setting will be lost >>> when you do: >>> >>> sudo python setup.py install >> >> >> Ouch, another good one... >> >> This is almost certainly not a bug, but rather a security feature. >> >>> The administrator can add a line to the sudoers file: >>> >>> Defaults env_reset >>> >>> that will reset the environment to only contain the variables >>> HOME, LOGNAME, >>> PATH, SHELL, TERM, and USER, preventing this attack. >> >> >> > From ellisonbg.net at gmail.com Fri Nov 2 22:09:37 2007 From: ellisonbg.net at gmail.com (Brian Granger) Date: Fri, 2 Nov 2007 15:09:37 -0600 Subject: [Pythonmac-SIG] Round 2 with Leopard+Python In-Reply-To: <1C0061DC-C15E-4AE8-8D17-451C3A9ECA62@nrao.edu> References: <6ce0ac130711020916pf348e27xc5543dbd49f5fce0@mail.gmail.com> <93611872-5B47-4791-A731-C62446E7160B@nrao.edu> <1C0061DC-C15E-4AE8-8D17-451C3A9ECA62@nrao.edu> Message-ID: <6ce0ac130711021409s2bbf4ad0ldda7a2e0e4719db2@mail.gmail.com> Yep, here is the beginning of my /etc/sudoers: # sudoers file. # # This file MUST be edited with the 'visudo' command as root. # # See the sudoers man page for the details on how to write a sudoers file. # # Host alias specification # User alias specification # Cmnd alias specification # Defaults specification Defaults env_reset Defaults env_keep += "BLOCKSIZE" Defaults env_keep += "COLORFGBG COLORTERM" Defaults env_keep += "__CF_USER_TEXT_ENCODING" Defaults env_keep += "CHARSET LANG LANGUAGE LC_ALL LC_COLLATE LC_CTYPE" Defaults env_keep += "LC_MESSAGES LC_MONETARY LC_NUMERIC LC_TIME" Defaults env_keep += "LINES COLUMNS" Defaults env_keep += "LSCOLORS" Defaults env_keep += "SSH_AUTH_SOCK" Defaults env_keep += "TZ" Defaults env_keep += "DISPLAY XAUTHORIZATION XAUTHORITY" Defaults env_keep += "EDITOR VISUAL" OK, this looks like true security feature then. Back to playing with .pth files then. On 11/2/07, Boyd Waters wrote: > FYI: > > On Leopard, "sudo" filters environment variables, including PYTHONPATH. > > > I have not tested this with MacPorts yet; I've been running MacPorts > as a "normal" user without sudo. Will this matter for MacPorts? > > > > Running "sudo -V" as root shows sudo's settings; part of that is > > environment variables that it will not pass on or that it will > > check for dangerous content. > > > On Nov 2, 2007, at 2:59 PM, Boyd Waters wrote: > > > One work-around is to add this line to /etc/sudoers: > > > > Defaults env_keep += "PYTHONPATH" > > > > > > > > But that would involve editing a file in /etc as root. > > Straightforward enough, but likely to get overwritten and what if > > the user screws this up? > > > > > > So Plan B - > > > > what if you added something in a .pth file in /Library/Python/2.5/ > > site-packages that re-orders the sys.path? > > > > Wouldn't that always work? > > > > > > > > > > On Nov 2, 2007, at 2:49 PM, Boyd Waters wrote: > > > >> > >> On Nov 2, 2007, at 10:16 AM, Brian Granger wrote: > >> > >>> First, if you have set PYTHONPATH to point > >>> sys.path at the site-packages in /Library, this setting will be lost > >>> when you do: > >>> > >>> sudo python setup.py install > >> > >> > >> Ouch, another good one... > >> > >> This is almost certainly not a bug, but rather a security feature. > >> > >>> The administrator can add a line to the sudoers file: > >>> > >>> Defaults env_reset > >>> > >>> that will reset the environment to only contain the variables > >>> HOME, LOGNAME, > >>> PATH, SHELL, TERM, and USER, preventing this attack. > >> > >> > >> > > > > From ellisonbg.net at gmail.com Fri Nov 2 22:30:05 2007 From: ellisonbg.net at gmail.com (Brian Granger) Date: Fri, 2 Nov 2007 15:30:05 -0600 Subject: [Pythonmac-SIG] sys.path on Leopard In-Reply-To: <74A27434-9C03-4D7F-93F3-42AFCA93AE81@cwi.nl> References: <6ce0ac130711011245h7163c02i89b1c9d569c0f41d@mail.gmail.com> <74A27434-9C03-4D7F-93F3-42AFCA93AE81@cwi.nl> Message-ID: <6ce0ac130711021430t5630fe94jf694c1000b4108e2@mail.gmail.com> I think this is currently the best approach because PYTHONPATH gets lost in sudo commands in Leopard. On 11/1/07, Jack Jansen wrote: > > On 1-Nov-2007, at 20:45 , Brian Granger wrote: > > Running python setup.py install on Leopard causes packages to be > > installed in the usual: > > > > /Library/Python/2.5/site-packages > > > > But, Apple put this directory _after_ > > > > /System/Library/Frameworks/Python.framework/Versions/2.5/Extras/lib/ > > python > > > > in sys.path. This, even if a user installs a newer version of one of > > these packages, the builtin python will always use Apple's older > > version. > > > Bah. The order is very strange: > - First most of the Python-supplied and Apple-supplied directories, > - Then /Library/Python/2.5/site-packages > - Then PyObjC, which is also Apple-supplied > - Then $HOME/Library/Python/2.5/site-packages, if it exists. > > By all means, report a bug. > > There is a workaround that packages can use to fix this, by the way, > through using Python code inside a .pth file. I used that in the > distant past to allow packman to fix bugs in system packages. > > I put the following line (without indentation) into ~/Library/Python/ > 2.5/site-packages/HackPath.pth > import sys ; sys.path.insert(0, '/Users/jack/MyPythonPrependedPath') > And, indeed, '/Users/jack/MyPythonPrependedPath' ends up as the first > entry in sys.path. > -- > 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 davelist at mac.com Fri Nov 2 23:04:48 2007 From: davelist at mac.com (davelist at mac.com) Date: Fri, 2 Nov 2007 18:04:48 -0400 Subject: [Pythonmac-SIG] Python TkAqua, Tkinter bug Message-ID: <933D27E7-7453-4FA1-93C7-C9CC78C97B79@mac.com> I am not certain where the problem is or who to report it to, but there is a bug in TkAqua, Tkinter, or possibly OS X's windowing system. I am using a simple module on top of Tkinter for teaching an intro programming course. When I click the mouse in the Tkinter window, it often reports the wrong coordinates for the click most of the time. If I use idle and first click on the Tk Console window and then in the graphical window it seems to work. If I don't click in the Tk Console window or start Python from the Terminal, it almost always reports wrong values. I am running Leopard now and tried both the built-in Python 2.5 and installing the version from python.org. Some of my students who are using Tiger report the same issue - I don't recall problems last year when using this on Tiger, but it's possible. On Windows, the coordinates are always correct. The graphics.py module built on top of Tkinter is available at: http://mcsp.wartburg.edu/zelle/python/ A simple example that shows the problem is: from graphics import * win = GraphWin('test', 800, 800) pt = win.getMouse() print pt.getX(), pt.getY() After clicking in the top left corner, it is clearly the wrong answer (it should be near 0, 0 depending on how accurate your click is). Any ideas on where the problem is, who to notify, etc.? Thanks, Dave From bwaters at nrao.edu Fri Nov 2 23:12:23 2007 From: bwaters at nrao.edu (Boyd Waters) Date: Fri, 2 Nov 2007 16:12:23 -0600 Subject: [Pythonmac-SIG] more tab completion issues. In-Reply-To: References: <1AF1D9DA-4AE1-49A2-98DA-73048AE2AC22@nrao.edu> Message-ID: I've reported this in Apple Bug 5563035. On Nov 1, 2007, at 9:25 PM, Michael VanLandingham wrote: > Yeah after looking at it again, I noticed certain things, like > __class__, had 4, and not 1, entries in the listing. It's a bit > annoying, since with something like numpy's 'array', it'll fill up > your window with 320+ items. > > I thought about debugging it, but I don't know how to intercept the > 'tab' keystroke in the tab completion. > > -mvl > > On Nov 1, 2007, at 7:59 PM, Boyd Waters wrote: > >> I get even more duplicates than that... >> >>> i.__ >> Display all 121 possibilities? (y or n) >> i.__abs__ i.__abs__ i.__add__ >> i.__add__ i.__and__ i.__and__ >> i.__class__ i.__class__ i.__class__ >> i.__class__ i.__cmp__ i.__cmp__ >> i.__coerce__ i.__coerce__ i.__delattr__ >> i.__delattr__ i.__delattr__ i.__div__ >> ... >> >> Funny. >> >> >> >> On Nov 1, 2007, at 7:44 PM, Michael VanLandingham wrote: >> >>> Following along the whole rlcompleter/readline/editline thread, I >>> noticed today that when I do tab completion on a class, I get >>> everything listed twice. >>> Happens in python and ipython. >>> Example: >>> >>> i = int(5) >>> >>> i >>> 5 >>> >>> i.__ >>> Display all 121 possibilities? (y or n) >>> i.__abs__ i.__abs__ i.__add__ >>> i.__add__ >>> i.__and__ i.__and__ i.__class__ >>> i.__class__ >>> ...etc. >>> >>> >>> I don't see duplicates if I do 'dir(i)' >>> >>> Is anyone else seeing this behavior? Any ideas why? Something >>> in the rlcompleter or readline... Seems to occur with any class. >>> >>> >>> -Michael >>> >>> _______________________________________________ >>> Pythonmac-SIG maillist - Pythonmac-SIG at python.org >>> http://mail.python.org/mailman/listinfo/pythonmac-sig >> From kw at codebykevin.com Fri Nov 2 23:32:57 2007 From: kw at codebykevin.com (Kevin Walzer) Date: Fri, 02 Nov 2007 18:32:57 -0400 Subject: [Pythonmac-SIG] Python TkAqua, Tkinter bug In-Reply-To: <933D27E7-7453-4FA1-93C7-C9CC78C97B79@mac.com> References: <933D27E7-7453-4FA1-93C7-C9CC78C97B79@mac.com> Message-ID: <472BA599.9020308@codebykevin.com> davelist at mac.com wrote: > I am not certain where the problem is or who to report it to, but > there is a bug in TkAqua, Tkinter, or possibly OS X's windowing > system. I am using a simple module on top of Tkinter for teaching an > intro programming course. When I click the mouse in the Tkinter > window, it often reports the wrong coordinates for the click most of > the time. If I use idle and first click on the Tk Console window and > then in the graphical window it seems to work. If I don't click in the > Tk Console window or start Python from the Terminal, it almost always > reports wrong values. > > I am running Leopard now and tried both the built-in Python 2.5 and > installing the version from python.org. Some of my students who are > using Tiger report the same issue - I don't recall problems last year > when using this on Tiger, but it's possible. On Windows, the > coordinates are always correct. > > The graphics.py module built on top of Tkinter is available at: > > http://mcsp.wartburg.edu/zelle/python/ > > A simple example that shows the problem is: > > from graphics import * > win = GraphWin('test', 800, 800) > pt = win.getMouse() > print pt.getX(), pt.getY() > > After clicking in the top left corner, it is clearly the wrong answer > (it should be near 0, 0 depending on how accurate your click is). > > Any ideas on where the problem is, who to notify, etc.? > > Thanks, > Dave Are you using the built-in Tk that comes with OS X? It's ancient (8.4.7 on Tiger, and not updated for Leopard). Try installing a more recent version, such as 8.4.16, from ActiveState and see if that solves the problem. -- Kevin Walzer Code by Kevin http://www.codebykevin.com From davelist at mac.com Sat Nov 3 00:40:12 2007 From: davelist at mac.com (Dave Reed) Date: Fri, 2 Nov 2007 19:40:12 -0400 Subject: [Pythonmac-SIG] Python TkAqua, Tkinter bug In-Reply-To: <472BA599.9020308@codebykevin.com> References: <933D27E7-7453-4FA1-93C7-C9CC78C97B79@mac.com> <472BA599.9020308@codebykevin.com> Message-ID: <7D699638-9196-4D18-8B40-48092557DA2F@mac.com> On Nov 2, 2007, at 6:32 PM, Kevin Walzer wrote: > davelist at mac.com wrote: >> I am not certain where the problem is or who to report it to, but >> there is a bug in TkAqua, Tkinter, or possibly OS X's windowing >> system. I am using a simple module on top of Tkinter for teaching >> an intro programming course. When I click the mouse in the >> Tkinter window, it often reports the wrong coordinates for the >> click most of the time. If I use idle and first click on the Tk >> Console window and then in the graphical window it seems to work. >> If I don't click in the Tk Console window or start Python from the >> Terminal, it almost always reports wrong values. >> I am running Leopard now and tried both the built-in Python 2.5 >> and installing the version from python.org. Some of my students >> who are using Tiger report the same issue - I don't recall >> problems last year when using this on Tiger, but it's possible. On >> Windows, the coordinates are always correct. >> The graphics.py module built on top of Tkinter is available at: >> http://mcsp.wartburg.edu/zelle/python/ >> A simple example that shows the problem is: >> from graphics import * >> win = GraphWin('test', 800, 800) >> pt = win.getMouse() >> print pt.getX(), pt.getY() >> After clicking in the top left corner, it is clearly the wrong >> answer (it should be near 0, 0 depending on how accurate your >> click is). >> Any ideas on where the problem is, who to notify, etc.? >> Thanks, >> Dave > > Are you using the built-in Tk that comes with OS X? It's ancient > (8.4.7 on Tiger, and not updated for Leopard). Try installing a more > recent version, such as 8.4.16, from ActiveState and see if that > solves the problem. I'm not certain exactly what you're saying. Are you saying to install Active State's Python? It looks like that doesn't include a new Tk Aqua. Or are you saying to install Active State's Tcl? I'm not certain how installing the latter by itself will change which Tk my Python uses. I think I figured out a work around. Instead of first clicking on the Tk window's title bar to move it, first click inside the Tk window to make it active, then use the title bar to move it, and then clicks seem to respond with the correct coordinate. Thanks, Dave From kw at codebykevin.com Sat Nov 3 00:49:06 2007 From: kw at codebykevin.com (Kevin Walzer) Date: Fri, 02 Nov 2007 19:49:06 -0400 Subject: [Pythonmac-SIG] Python TkAqua, Tkinter bug In-Reply-To: <7D699638-9196-4D18-8B40-48092557DA2F@mac.com> References: <933D27E7-7453-4FA1-93C7-C9CC78C97B79@mac.com> <472BA599.9020308@codebykevin.com> <7D699638-9196-4D18-8B40-48092557DA2F@mac.com> Message-ID: <472BB772.1040308@codebykevin.com> Dave Reed wrote: > > > I'm not certain exactly what you're saying. Are you saying to install > Active State's Python? It looks like that doesn't include a new Tk Aqua. > Or are you saying to install Active State's Tcl? I'm not certain how > installing the latter by itself will change which Tk my Python uses. > Installing ActiveTcl will put a framework build of TkAqua in /Library/Frameworks. Assuming you are using the Python from python.org, the ActiveState build will be picked up by Python before the one bundled by Apple, which is in /System/Library/Frameworks. It's highly unlikely that bugs in 8.4.7 will be fixed at this point, if they haven't been fixed already. -- Kevin Walzer Code by Kevin http://www.codebykevin.com From darran at edmstudio.com Sat Nov 3 07:12:13 2007 From: darran at edmstudio.com (Darran Edmundson) Date: Sat, 03 Nov 2007 00:12:13 -0600 Subject: [Pythonmac-SIG] Python control/integration of a Cocoa/Quicktime application? In-Reply-To: <24d517dd0710262318q6891dd2fh76330a81ac7dcd09@mail.gmail.com> References: <47228C73.3000903@edmstudio.com> <24d517dd0710262318q6891dd2fh76330a81ac7dcd09@mail.gmail.com> Message-ID: <472C113D.3030303@edmstudio.com> Dethe Elza wrote: > If you write an Objective-C framework, the python code to wrap it > using PyObjC is very short. Here is an example I use to expose Tim > Omernick's CocoaSequenceGrabber framework to capture images from the > iSight camera ... > The bare minimum you need is: > import objc > objc.loadBundle('MyBundle', globals(), > bundle_path='/my/bundle/path/MyBundle.framework') Now that we have a proof-of-concept Objective-C framework, I'm trying to port a simple test application to python. Keep in mind that I didn't write either of these. I'm a complete neophyte in terms of Mac development and ObjectiveC; all I have going for me is a lot of python experience on Windows. Issues I'm having: - In a terminal, 'python' still gives me Apple's native 2.3 rather than MacPython 2.4. Do I uninstall Apple's version or simply ensure that the MacPython version comes earlier in the system path? - The pyObjC online docs discuss XCode templates and a distutils approach. Is the latter deprecated, or still a reasonable approach? - Following Dethe's advice, I can successfully obj.loadBundle('EDMDisplayController', ...) from within IDLE. I'm not at all clear on how to proceed from here ;-) It seems there's some infrastructure required even for the simplest of applications, correct? I.e., I can't just expect to create a single python script callable from the command line ... As much as I like independent learning, I could really do with someone to walk me through this one-on-one. Anyone interested in a few hours of consulting? If so, just email me a rate and availability over the next week. I can give you SVN access to our code, and we can chat on the phone or Skype. Cheers, Darran. -- Darran Edmundson [darran at edmstudio.com] http://www.edmstudio.com From ronaldoussoren at mac.com Sat Nov 3 07:52:17 2007 From: ronaldoussoren at mac.com (Ronald Oussoren) Date: Sat, 3 Nov 2007 07:52:17 +0100 Subject: [Pythonmac-SIG] Leopard python architectures in setup.py In-Reply-To: <0A698030-1116-41F7-AF41-C5C193B3507B@nrao.edu> References: <9E16F0E2-5416-4044-BC3C-B417DF7AC237@kyngchaos.com> <8B4F9B03-B3DD-4B2F-AE41-3CCB3423AED1@mac.com> <6CAC6EE5-D2D3-4E46-98D1-365B81747348@Oefelein.de> <0A698030-1116-41F7-AF41-C5C193B3507B@nrao.edu> Message-ID: <7D00633A-3721-414D-B62D-F07AB4D5113A@mac.com> On 2 Nov, 2007, at 22:02, Boyd Waters wrote: > > On Nov 2, 2007, at 2:38 PM, Martina Oefelein wrote: > >> I think this actually makes sense: if the command line tools were >> 32/64 bit universal, scripts would run with the 64 bit version on 64 >> bit systems, and wouldn't be able to use any of the libraries that >> are only 32 bit. >> >> The framework, on the other hand, should be 32/64 bit universal so >> that both 32 and 64 bit applications can embed python. > > > This gets a bit tricky with Python GUIs. I haven't checked, but I > suppose that PyObjC is still 32-bit only. PyObjC is still 32-bit, but that won't be for long, I just ran out of time w.r.t. the Leopard deadline. Ronald -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 2224 bytes Desc: not available Url : http://mail.python.org/pipermail/pythonmac-sig/attachments/20071103/de172461/attachment-0001.bin From ronaldoussoren at mac.com Sat Nov 3 07:55:48 2007 From: ronaldoussoren at mac.com (Ronald Oussoren) Date: Sat, 3 Nov 2007 07:55:48 +0100 Subject: [Pythonmac-SIG] Leopard python architectures in setup.py In-Reply-To: <6CAC6EE5-D2D3-4E46-98D1-365B81747348@Oefelein.de> References: <9E16F0E2-5416-4044-BC3C-B417DF7AC237@kyngchaos.com> <8B4F9B03-B3DD-4B2F-AE41-3CCB3423AED1@mac.com> <6CAC6EE5-D2D3-4E46-98D1-365B81747348@Oefelein.de> Message-ID: <4662C205-9F50-421B-ABA4-187CC6F8E10C@mac.com> On 2 Nov, 2007, at 21:38, Martina Oefelein wrote: > > Am 02.11.2007 um 08:03 schrieb Ronald Oussoren: > >> As you've noticed the actual framework is 64bit but the commandline >> tools are not. It should be easy enough to add 64-bit command-line >> tools as well, but even then you'll have to add extra arguments to >> build 64-bit extensions (as Boyd mentions). > > I think this actually makes sense: if the command line tools were > 32/64 bit universal, scripts would run with the 64 bit version on 64 > bit systems, and wouldn't be able to use any of the libraries that > are only 32 bit. > > The framework, on the other hand, should be 32/64 bit universal so > that both 32 and 64 bit applications can embed python. It's to bad that they don't ship 64-bit command-line utilities as well. Oh well, I guess that's an opportunity for the community: build a small installer that will install 64-bit commandline tools (e.g. a python64 command) as well as the stuff that should be in /Application/ MacPython 2.5. This is not too hard, but slightly harder than it seems at first glance because one should also hack distutils such that python64 will build 64-bit (or even 4-way universal) binaries while the normal 32- bit binaries should keep functioning exactly as they do now. Ronald > > > ciao > Martina > -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 2224 bytes Desc: not available Url : http://mail.python.org/pipermail/pythonmac-sig/attachments/20071103/a714fcdf/attachment.bin From ronaldoussoren at mac.com Sat Nov 3 07:58:52 2007 From: ronaldoussoren at mac.com (Ronald Oussoren) Date: Sat, 3 Nov 2007 07:58:52 +0100 Subject: [Pythonmac-SIG] Problem with numpy on Leopard In-Reply-To: <472B0AD5.6080802@tds.net> References: <6ce0ac130711011250o73d50c1du944fb62a3263c6ad@mail.gmail.com> <472A3146.8000303@gmail.com> <472A5D42.5070500@noaa.gov> <472AB304.2080301@noaa.gov> <472B0AD5.6080802@tds.net> Message-ID: On 2 Nov, 2007, at 12:32, Kent Johnson wrote: > Christopher Barker wrote: >> I suppose this may be a time to take a good look at workingenv >> again... > > Or virtualenv which has replaced workingenv: > http://pypi.python.org/pypi/virtualenv Virtualenv almost but not quite works on OSX. I've donated the code that deals with framework installs, but it turns out that activating those environments only works in some situations. Either calling the activate using a relative path worksor it works using an absolute path, but not both. Yet another challenge :-) Ronald > > > Kent > _______________________________________________ > 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 : http://mail.python.org/pipermail/pythonmac-sig/attachments/20071103/3ebbbffa/attachment.bin From delza at livingcode.org Sat Nov 3 08:00:41 2007 From: delza at livingcode.org (Dethe Elza) Date: Sat, 3 Nov 2007 00:00:41 -0700 Subject: [Pythonmac-SIG] Python control/integration of a Cocoa/Quicktime application? In-Reply-To: <472C113D.3030303@edmstudio.com> References: <47228C73.3000903@edmstudio.com> <24d517dd0710262318q6891dd2fh76330a81ac7dcd09@mail.gmail.com> <472C113D.3030303@edmstudio.com> Message-ID: <24d517dd0711030000o3fcd416at274ca75e9d5edb61@mail.gmail.com> On 11/2/07, Darran Edmundson wrote: > Now that we have a proof-of-concept Objective-C framework, I'm trying to > port a simple test application to python. Keep in mind that I didn't > write either of these. I'm a complete neophyte in terms of Mac > development and ObjectiveC; all I have going for me is a lot of python > experience on Windows. Issues I'm having: > > - In a terminal, 'python' still gives me Apple's native 2.3 rather than > MacPython 2.4. Do I uninstall Apple's version or simply ensure that > the MacPython version comes earlier in the system path? Just make sure python2.5 comes earlier in your path. Never uninstall Apple's version--your computer uses it for system operations. > - The pyObjC online docs discuss XCode templates and a distutils > approach. Is the latter deprecated, or still a reasonable approach? I would use the distutils (actually, I think it is setuptools now) approach. The XCode templates have been fixed in Leopard (or so I have heard), but I don't think they were very helpful in Tiger. You can easy_install setuptools and py2app. Below is a bare-bones setup.py that you can customize by replacing variables with the word "YOUR" in them. Sorry about the over-abundance of ALL CAPS. I have this set up so I can re-use it quickly, so there are a bunch of semi-constants I use in all caps, then I added more for your customization. Let me know if it is confusing. ''' Minimal setup.py example, run with: % python setup.py py2app ''' from distutils.core import setup import py2app NAME = 'YOUR_APP_NAME' SCRIPT = 'YOUR_PYTHON_SCRIPT.py' VERSION = 'YOUR_VERSION' ICON = '' ID = 'A_UNIQUE_STRING COPYRIGHT = 'Copyright 2007 YOUR_NAME' DATA_FILES = ['English.lproj'] # This is needed if you use nib files to define your UI plist = dict( CFBundleIconFile = ICON, CFBundleName = NAME, CFBundleShortVersionString = ' '.join([NAME, VERSION]), CFBundleGetInfoString = NAME, CFBundleExecutable = NAME, CFBundleIdentifier = 'org.YOUR_DOMAIN.examples.%s' % ID, NSHumanReadableCopyright = COPYRIGHT ) app_data = dict(script=SCRIPT, plist=plist) py2app_opt = dict(frameworks=['YOUR_FRAMEWORK_HERE.framework'],) options = dict(py2app=py2app_opt,) setup( data_files = DATA_FILES, app = [app_data], options = options, ) From delza at livingcode.org Sat Nov 3 08:06:04 2007 From: delza at livingcode.org (Dethe Elza) Date: Sat, 3 Nov 2007 00:06:04 -0700 Subject: [Pythonmac-SIG] Python control/integration of a Cocoa/Quicktime application? In-Reply-To: <472C113D.3030303@edmstudio.com> References: <47228C73.3000903@edmstudio.com> <24d517dd0710262318q6891dd2fh76330a81ac7dcd09@mail.gmail.com> <472C113D.3030303@edmstudio.com> Message-ID: <24d517dd0711030006j74255a85j29390911aab3cbda@mail.gmail.com> On 11/2/07, Darran Edmundson wrote: > > The bare minimum you need is: > > import objc > > objc.loadBundle('MyBundle', globals(), > > bundle_path='/my/bundle/path/MyBundle.framework') One more thing. While the above is a bare minimum from the command line or to work with the framework locally, you'll need a skintch more to get the file paths to work when the framework is packaged into your application bundle. Below is an example I use to package Tim Omernick's CocoaSequenceGrabber framework, and it works both from the command line and in the app bundle. I have this saved as PySight/__init__.py and can then use all the framework objects and methods by simply importing PySight in my project. Again, if any of this is not clear, or you're not sure how to customize this to your project, just let me know. import objc, AppKit, Foundation, os if 'site-packages.zip' in __file__: base_path = os.path.join(os.path.dirname(os.getcwd()), 'Frameworks') else: base_path = '/Library/Frameworks' bundle_path = os.path.abspath(os.path.join(base_path, 'CocoaSequenceGrabber.fram ework')) objc.loadBundle('CocoaSequenceGrabber', globals(), bundle_path=bundle_path) del objc, AppKit, Foundation, os, base_path, bundle_path --Dethe From boydwaters at mac.com Fri Nov 2 21:59:53 2007 From: boydwaters at mac.com (Boyd Waters) Date: Fri, 2 Nov 2007 14:59:53 -0600 Subject: [Pythonmac-SIG] Round 2 with Leopard+Python In-Reply-To: <93611872-5B47-4791-A731-C62446E7160B@nrao.edu> References: <6ce0ac130711020916pf348e27xc5543dbd49f5fce0@mail.gmail.com> <93611872-5B47-4791-A731-C62446E7160B@nrao.edu> Message-ID: One work-around is to add this line to /etc/sudoers: Defaults env_keep += "PYTHONPATH" But that would involve editing a file in /etc as root. Straightforward enough, but likely to get overwritten and what if the user screws this up? So Plan B - what if you added something in a .pth file in /Library/Python/2.5/ site-packages that re-orders the sys.path? Wouldn't that always work? On Nov 2, 2007, at 2:49 PM, Boyd Waters wrote: > > On Nov 2, 2007, at 10:16 AM, Brian Granger wrote: > >> First, if you have set PYTHONPATH to point >> sys.path at the site-packages in /Library, this setting will be lost >> when you do: >> >> sudo python setup.py install > > > Ouch, another good one... > > This is almost certainly not a bug, but rather a security feature. > >> The administrator can add a line to the sudoers file: >> >> Defaults env_reset >> >> that will reset the environment to only contain the variables >> HOME, LOGNAME, >> PATH, SHELL, TERM, and USER, preventing this attack. > > > From davelist at mac.com Sun Nov 4 03:57:03 2007 From: davelist at mac.com (Dave Reed) Date: Sat, 3 Nov 2007 22:57:03 -0400 Subject: [Pythonmac-SIG] Python TkAqua, Tkinter bug In-Reply-To: <472BB772.1040308@codebykevin.com> References: <933D27E7-7453-4FA1-93C7-C9CC78C97B79@mac.com> <472BA599.9020308@codebykevin.com> <7D699638-9196-4D18-8B40-48092557DA2F@mac.com> <472BB772.1040308@codebykevin.com> Message-ID: On Nov 2, 2007, at 7:49 PM, Kevin Walzer wrote: > Dave Reed wrote: > >> I'm not certain exactly what you're saying. Are you saying to >> install Active State's Python? It looks like that doesn't include a >> new Tk Aqua. Or are you saying to install Active State's Tcl? I'm >> not certain how installing the latter by itself will change which >> Tk my Python uses. >> > > Installing ActiveTcl will put a framework build of TkAqua in / > Library/Frameworks. Assuming you are using the Python from > python.org, the ActiveState build will be picked up by Python before > the one bundled by Apple, which is in /System/Library/Frameworks. > > It's highly unlikely that bugs in 8.4.7 will be fixed at this point, > if they haven't been fixed already. After installing ActiveTcl, and running a Python program that uses Tkinter, it stops with the error: Tk_MacOSXSetupTkNotifier: first [load] of TkAqua has to occur in the main thread! Abort trap So I then deleted the Tcl and Tk frameworks it put in /Library/ Frameworks. Dave From hengist.podd at virgin.net Sun Nov 4 12:10:06 2007 From: hengist.podd at virgin.net (has) Date: Sun, 4 Nov 2007 11:10:06 +0000 Subject: [Pythonmac-SIG] 64-bit support Message-ID: <8BEA5881-9D34-49B5-9790-372463E57FA9@virgin.net> Hi folks, Currently working on the next appscript release and wondering if anyone has any thoughts on whether or not I should prioritise 64-bit support (which means reworking its various C extensions to eliminate their dependence on Python's Carbon extensions)? How important is providing 64-bit support at the moment? Thanks, has -- http://appscript.sourceforge.net http://rb-appscript.rubyforge.org From ronaldoussoren at mac.com Sun Nov 4 16:18:10 2007 From: ronaldoussoren at mac.com (Ronald Oussoren) Date: Sun, 4 Nov 2007 16:18:10 +0100 Subject: [Pythonmac-SIG] 64-bit support In-Reply-To: <8BEA5881-9D34-49B5-9790-372463E57FA9@virgin.net> References: <8BEA5881-9D34-49B5-9790-372463E57FA9@virgin.net> Message-ID: On 4 Nov, 2007, at 12:10, has wrote: > Hi folks, > > Currently working on the next appscript release and wondering if > anyone has any thoughts on whether or not I should prioritise 64-bit > support (which means reworking its various C extensions to eliminate > their dependence on Python's Carbon extensions)? How important is > providing 64-bit support at the moment? None of the GUI frameworks support 64-bit code at the moment, so I'd say "not very". That said: how much work would it be to make appscript 64-bit clean? Ronald -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 2224 bytes Desc: not available Url : http://mail.python.org/pipermail/pythonmac-sig/attachments/20071104/9be2f6cd/attachment.bin From hengist.podd at virgin.net Sun Nov 4 18:30:31 2007 From: hengist.podd at virgin.net (has) Date: Sun, 4 Nov 2007 17:30:31 +0000 Subject: [Pythonmac-SIG] 64-bit support In-Reply-To: References: <8BEA5881-9D34-49B5-9790-372463E57FA9@virgin.net> Message-ID: <07F0593F-23BE-408E-9FD0-FD9A3E479EAB@virgin.net> On 4 Nov 2007, at 15:18, Ronald Oussoren wrote: >> Currently working on the next appscript release and wondering if >> anyone has any thoughts on whether or not I should prioritise 64-bit >> support (which means reworking its various C extensions to eliminate >> their dependence on Python's Carbon extensions)? How important is >> providing 64-bit support at the moment? > > None of the GUI frameworks support 64-bit code at the moment, so I'd > say "not very". You mean Python GUI frameworks (PyObjC, wxPython, etc.), yes? > That said: how much work would it be to make appscript 64-bit clean? Depends. If I don't bother waiting for Python's Carbon extensions to go 64-bit first (which I'm guessing is no time soon), then under a week if I'm not concerned about backwards compatibility in the low- level and more obscure APIs: - remove CarbonX.OSA and osascript to a new package separate to appscript which can be worked on in its own time - drop support for Carbon.File-related convenience methods in the mactypes module's Alias and File classes - eliminate dependency on pymactoolbox in CarbonX.AE and friends (by cutting and pasting the bits it actually uses - PyErr_Mac, PyMac_BuildOSType, etc.). I'm not sure how much disruption these changes would cause for existing users, though hopefully not much: - I doubt anyone uses the OSA stuff except me; as far as I can tell, most users don't venture beyond the appscript and osax APIs - anyone who really needs to work with Carbon.File objects can always write their own code to convert between mactypes' Alias and File objects and Carbon.File equivalents - appscript/aem users are rarely exposed to CarbonX.AE.AEDescs since commonly used standard types are already bridged. Where they are exposed, users who need to manipulate them (beyond just treating them as obaque types) could adapt their code as necessary (which might be as simple as changing any references to the CarbonX namespace to the aem one). To be honest, I think the simplest solution from my POV would just be to copy the current rb-appscript setup, which is already 64-bit savvy except for the osax module [1]. Rb-appscript contains only aem, appscript, mactypes and osax modules plus a single AE extension that provides all the C bridging required by all of them. This level of reworking would make it a PITA if I ever wanted to reintegrate appscript with Python's built-in Carbon extensions - that's something I'd certainly like to do, but who knows if/when that could/will ever happen in practice [2]? Meantime, being able to do away with all the accumulated and legacy gunk does have a certain appeal: compared to the Ruby and ObjC ports, the original version's internals are looking rather scruffy these days. Any thoughts? In particular, if you or anyone else can see current or future problems or disadvantages to this approach, or would be negatively affected by them, please do let me know. has [1] The deprecation of OSAGetAppTerminology means that I'll have to write an sdef parser in order to fetch osax terminology dynamically under 64-bit. This'll happen eventually; in the meantime, any user who wants to use osaxen in 64-bit will have to create and use a static glue. A bit annoying for them, but it's not a high-priority module for me so folks'll just have to wait till I can get around to it - unless someone else would like to volunteer for the job? [2] Out of interest, does BridgeSupport provide any assistance with bridging Carbon APIs, or does it cover Cocoa/CoreFoundation only? If it did cover Carbon as well, my own instinct would be for starting over using that rather than trying to update the existing Carbon extensions. -- http://appscript.sourceforge.net http://rb-appscript.rubyforge.org From vip at avatar.com.au Mon Nov 5 03:51:25 2007 From: vip at avatar.com.au (David Worrall) Date: Mon, 5 Nov 2007 13:51:25 +1100 Subject: [Pythonmac-SIG] working around versions Message-ID: Hi All, We're doing some work around different versions of Python on OSX (and what's in their respective site-packages directory), and I was wondering: Given that we can pick up the the version number of the current instantiation using sys.version, is there a direct way of computing the locating values for x and y in '/Library/Frameworks/Python.framework/Versions/Current/lib/pythonx.y/' other than through concatenating the above string with a splice of sys.version? thanks, David _________________________________________________ experimental polymedia: www.avatar.com.au Sonic Communications Research Group, University of Canberra: creative.canberra.edu.au/scrg/ From ronaldoussoren at mac.com Mon Nov 5 15:37:50 2007 From: ronaldoussoren at mac.com (Ronald Oussoren) Date: Mon, 5 Nov 2007 15:37:50 +0100 Subject: [Pythonmac-SIG] working around versions In-Reply-To: References: Message-ID: <2E42C9A7-9C79-44A6-8CAD-DF6272437B72@mac.com> On 5 Nov, 2007, at 3:51, David Worrall wrote: > Hi All, > > We're doing some work around different versions of Python on OSX (and > what's in their respective site-packages directory), > and I was wondering: > > Given that we can pick up the the version number of the current > instantiation using sys.version, > is there a direct way of computing the locating values for x and y in > '/Library/Frameworks/Python.framework/Versions/Current/lib/pythonx.y/' > > other than through concatenating the above string with a splice of > sys.version? No. BTW. The library location is os.path.join(sys.prefix, 'lib', 'python%d. %d'%(sys.version_info[:2])). This should resolve to a path that doesn't refer to 'Versions/Current' but to 'Versions/x.y'. Do not assume that the 'Current' link will point to currently running version of Python, a user might have installed multiple versions of python. Ronald > > > thanks, > > David > _________________________________________________ > experimental polymedia: www.avatar.com.au > Sonic Communications Research Group, > University of Canberra: creative.canberra.edu.au/scrg/ > > > _______________________________________________ > 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 : http://mail.python.org/pipermail/pythonmac-sig/attachments/20071105/db67f29b/attachment.bin From Chris.Barker at noaa.gov Mon Nov 5 18:03:23 2007 From: Chris.Barker at noaa.gov (Christopher Barker) Date: Mon, 05 Nov 2007 09:03:23 -0800 Subject: [Pythonmac-SIG] Leopard python architectures in setup.py In-Reply-To: <4662C205-9F50-421B-ABA4-187CC6F8E10C@mac.com> References: <9E16F0E2-5416-4044-BC3C-B417DF7AC237@kyngchaos.com> <8B4F9B03-B3DD-4B2F-AE41-3CCB3423AED1@mac.com> <6CAC6EE5-D2D3-4E46-98D1-365B81747348@Oefelein.de> <4662C205-9F50-421B-ABA4-187CC6F8E10C@mac.com> Message-ID: <472F4CDB.7000903@noaa.gov> semi OT: Ronald Oussoren wrote: > It's to bad that they don't ship 64-bit command-line utilities as well. What does 64-bit buy you? Is the only advantage the ability to address a lot of memory? Any other performance advantages? i.e. -- how much should I care? -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 ibaird at gmail.com Mon Nov 5 18:02:45 2007 From: ibaird at gmail.com (Ian Baird) Date: Mon, 5 Nov 2007 10:02:45 -0700 Subject: [Pythonmac-SIG] Leopard python architectures in setup.py In-Reply-To: <472F4CDB.7000903@noaa.gov> References: <9E16F0E2-5416-4044-BC3C-B417DF7AC237@kyngchaos.com> <8B4F9B03-B3DD-4B2F-AE41-3CCB3423AED1@mac.com> <6CAC6EE5-D2D3-4E46-98D1-365B81747348@Oefelein.de> <4662C205-9F50-421B-ABA4-187CC6F8E10C@mac.com> <472F4CDB.7000903@noaa.gov> Message-ID: On x86-64, you get more GPRs. From my naive benchmarking with my algorithms on ObjC, I get at 15%-20% speedup. Ian On Nov 5, 2007, at 10:03 AM, Christopher Barker wrote: > > semi OT: > > Ronald Oussoren wrote: >> It's to bad that they don't ship 64-bit command-line utilities as >> well. > > What does 64-bit buy you? Is the only advantage the ability to > address a > lot of memory? Any other performance advantages? > > i.e. -- how much should I care? > > -Chris > > > > -- > Christopher Barker, Ph.D. > Oceanographer > > Emergency Response Division > NOAA/NOS/OR&R (206) 526-6959 voice > 7600 Sand Point Way NE (206) 526-6329 fax > Seattle, WA 98115 (206) 526-6317 main reception > > Chris.Barker at noaa.gov > _______________________________________________ > Pythonmac-SIG maillist - Pythonmac-SIG at python.org > http://mail.python.org/mailman/listinfo/pythonmac-sig From Chris.Barker at noaa.gov Mon Nov 5 18:08:09 2007 From: Chris.Barker at noaa.gov (Christopher Barker) Date: Mon, 05 Nov 2007 09:08:09 -0800 Subject: [Pythonmac-SIG] Problem with numpy on Leopard In-Reply-To: References: <6ce0ac130711011250o73d50c1du944fb62a3263c6ad@mail.gmail.com> <472A3146.8000303@gmail.com> <472A5D42.5070500@noaa.gov> <472AB304.2080301@noaa.gov> <472B0AD5.6080802@tds.net> Message-ID: <472F4DF9.1070801@noaa.gov> Ronald Oussoren wrote: > Virtualenv almost but not quite works on OSX. Well, darn. I think Frameworks are a great idea, but as no one but Apple uses them, I"m really starting to think that they are not worth the effort. Sometimes, "thinking different" isn't such a great idea. Oh well, -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 Nov 5 18:27:10 2007 From: Chris.Barker at noaa.gov (Christopher Barker) Date: Mon, 05 Nov 2007 09:27:10 -0800 Subject: [Pythonmac-SIG] Leopard python architectures in setup.py In-Reply-To: References: <9E16F0E2-5416-4044-BC3C-B417DF7AC237@kyngchaos.com> <8B4F9B03-B3DD-4B2F-AE41-3CCB3423AED1@mac.com> <6CAC6EE5-D2D3-4E46-98D1-365B81747348@Oefelein.de> <4662C205-9F50-421B-ABA4-187CC6F8E10C@mac.com> <472F4CDB.7000903@noaa.gov> Message-ID: <472F526E.9080806@noaa.gov> Ian Baird wrote: > On x86-64, you get more GPRs. From my naive benchmarking with my > algorithms on ObjC, I get at 15%-20% speedup. Since I had to google it -- GPR == "General Purpose Register" OK, 15-20% is nice! -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 Nov 5 18:51:37 2007 From: ronaldoussoren at mac.com (Ronald Oussoren) Date: Mon, 5 Nov 2007 18:51:37 +0100 Subject: [Pythonmac-SIG] Problem with numpy on Leopard In-Reply-To: <472F4DF9.1070801@noaa.gov> References: <6ce0ac130711011250o73d50c1du944fb62a3263c6ad@mail.gmail.com> <472A3146.8000303@gmail.com> <472A5D42.5070500@noaa.gov> <472AB304.2080301@noaa.gov> <472B0AD5.6080802@tds.net> <472F4DF9.1070801@noaa.gov> Message-ID: <210F9AC8-157E-45E3-A96A-5B91ADA31AB3@mac.com> On 5 Nov, 2007, at 18:08, Christopher Barker wrote: > Ronald Oussoren wrote: >> Virtualenv almost but not quite works on OSX. > > Well, darn. > > I think Frameworks are a great idea, but as no one but Apple uses > them, > I"m really starting to think that they are not worth the effort. > > Sometimes, "thinking different" isn't such a great idea. Frameworks are IMHO a great idea. Furthermore, I like the way a framework builds finds sys.prefix nicer than how a normal unix build does this because it will find the right sys.prefix even when you copy the interpreter executable to a different location. That makes live harder for something like virtual-env, but not too much and you only have to engeneer this once. The problems with virtualenv are probably shallow, I just haven't had time to look at them yet. Ronald > > > Oh well, > > -Chris > > > > > -- > Christopher Barker, Ph.D. > Oceanographer > > Emergency Response Division > NOAA/NOS/OR&R (206) 526-6959 voice > 7600 Sand Point Way NE (206) 526-6329 fax > Seattle, WA 98115 (206) 526-6317 main reception > > Chris.Barker at noaa.gov > _______________________________________________ > Pythonmac-SIG maillist - Pythonmac-SIG at python.org > http://mail.python.org/mailman/listinfo/pythonmac-sig -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 2224 bytes Desc: not available Url : http://mail.python.org/pipermail/pythonmac-sig/attachments/20071105/cfb15dd0/attachment.bin From Chris.Barker at noaa.gov Mon Nov 5 19:09:45 2007 From: Chris.Barker at noaa.gov (Christopher Barker) Date: Mon, 05 Nov 2007 10:09:45 -0800 Subject: [Pythonmac-SIG] Problem with numpy on Leopard In-Reply-To: <210F9AC8-157E-45E3-A96A-5B91ADA31AB3@mac.com> References: <6ce0ac130711011250o73d50c1du944fb62a3263c6ad@mail.gmail.com> <472A3146.8000303@gmail.com> <472A5D42.5070500@noaa.gov> <472AB304.2080301@noaa.gov> <472B0AD5.6080802@tds.net> <472F4DF9.1070801@noaa.gov> <210F9AC8-157E-45E3-A96A-5B91ADA31AB3@mac.com> Message-ID: <472F5C69.50901@noaa.gov> Ronald Oussoren wrote: > Frameworks are IMHO a great idea. I agree, it's just that we need to port everything else to work with them - it gets tedious. > The problems with virtualenv are probably shallow, Let's hope so. That comment was born of frustration from another project (GDAL) -- apparently libtool doesn't do Frameworks right. -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 Nov 5 19:10:03 2007 From: ronaldoussoren at mac.com (Ronald Oussoren) Date: Mon, 5 Nov 2007 19:10:03 +0100 Subject: [Pythonmac-SIG] Problem with numpy on Leopard In-Reply-To: <472F5C69.50901@noaa.gov> References: <6ce0ac130711011250o73d50c1du944fb62a3263c6ad@mail.gmail.com> <472A3146.8000303@gmail.com> <472A5D42.5070500@noaa.gov> <472AB304.2080301@noaa.gov> <472B0AD5.6080802@tds.net> <472F4DF9.1070801@noaa.gov> <210F9AC8-157E-45E3-A96A-5B91ADA31AB3@mac.com> <472F5C69.50901@noaa.gov> Message-ID: On 5 Nov, 2007, at 19:09, Christopher Barker wrote: > Ronald Oussoren wrote: > >> Frameworks are IMHO a great idea. > > I agree, it's just that we need to port everything else to work with > them - it gets tedious. That's partially because there's a large set of developers that only test on Linux and then assume code will work everywhere :-/ Ronald -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 2224 bytes Desc: not available Url : http://mail.python.org/pipermail/pythonmac-sig/attachments/20071105/4e28ec5b/attachment-0001.bin From delza at livingcode.org Mon Nov 5 19:18:57 2007 From: delza at livingcode.org (Dethe Elza) Date: Mon, 5 Nov 2007 10:18:57 -0800 Subject: [Pythonmac-SIG] Problem with numpy on Leopard In-Reply-To: References: <6ce0ac130711011250o73d50c1du944fb62a3263c6ad@mail.gmail.com> <472A5D42.5070500@noaa.gov> <472AB304.2080301@noaa.gov> <472B0AD5.6080802@tds.net> <472F4DF9.1070801@noaa.gov> <210F9AC8-157E-45E3-A96A-5B91ADA31AB3@mac.com> <472F5C69.50901@noaa.gov> Message-ID: <24d517dd0711051018t243d5a9do7113862ee339500d@mail.gmail.com> On Nov 5, 2007 10:10 AM, Ronald Oussoren wrote: > That's partially because there's a large set of developers that only > test on Linux and then assume code will work everywhere :-/ I'm guilty of that in reverse. I only test on OS X and let Linux users fend for themselves until they get a sane packaging system like frameworks and bundles. ;-) --Dethe From vivacarlie at gmail.com Mon Nov 5 19:32:14 2007 From: vivacarlie at gmail.com (Nehemiah Dacres) Date: Mon, 5 Nov 2007 12:32:14 -0600 Subject: [Pythonmac-SIG] Problem with numpy on Leopard In-Reply-To: <24d517dd0711051018t243d5a9do7113862ee339500d@mail.gmail.com> References: <6ce0ac130711011250o73d50c1du944fb62a3263c6ad@mail.gmail.com> <472AB304.2080301@noaa.gov> <472B0AD5.6080802@tds.net> <472F4DF9.1070801@noaa.gov> <210F9AC8-157E-45E3-A96A-5B91ADA31AB3@mac.com> <472F5C69.50901@noaa.gov> <24d517dd0711051018t243d5a9do7113862ee339500d@mail.gmail.com> Message-ID: <65fadfc30711051032k7779cb70t326e2965d8ed9d7f@mail.gmail.com> I am not sure how Virtualenv works or why it's not working but you make the statement >> Frameworks are IMHO a great idea. lets not be idiosyncratic here. Frameworks (if you mean *.framework packages) are only used by apple because they are cumbersome to use unless you are developing multiple applications that will share libraries and code which will reduce memory usage if the programs are used at the same time. (ei MS word) (cite http://wilshipley.com/blog/2005/11/frameworks-are-teh-suck-err.html). he also explains their downfalls and how to get around them as well. Please don't skip any sections until you are fully convinced otherwise (convinced that frameworks aren't a great idea On Nov 5, 2007 12:18 PM, Dethe Elza wrote: > On Nov 5, 2007 10:10 AM, Ronald Oussoren wrote: > > That's partially because there's a large set of developers that only > > test on Linux and then assume code will work everywhere :-/ > > I'm guilty of that in reverse. I only test on OS X and let Linux > users fend for themselves until they get a sane packaging system like > frameworks and bundles. ;-) > > --Dethe > _______________________________________________ > Pythonmac-SIG maillist - Pythonmac-SIG at python.org > http://mail.python.org/mailman/listinfo/pythonmac-sig > -- "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: http://mail.python.org/pipermail/pythonmac-sig/attachments/20071105/3387e139/attachment.htm From ibaird at gmail.com Mon Nov 5 19:38:53 2007 From: ibaird at gmail.com (Ian Baird) Date: Mon, 5 Nov 2007 11:38:53 -0700 Subject: [Pythonmac-SIG] Problem with numpy on Leopard In-Reply-To: <65fadfc30711051032k7779cb70t326e2965d8ed9d7f@mail.gmail.com> References: <6ce0ac130711011250o73d50c1du944fb62a3263c6ad@mail.gmail.com> <472AB304.2080301@noaa.gov> <472B0AD5.6080802@tds.net> <472F4DF9.1070801@noaa.gov> <210F9AC8-157E-45E3-A96A-5B91ADA31AB3@mac.com> <472F5C69.50901@noaa.gov> <24d517dd0711051018t243d5a9do7113862ee339500d@mail.gmail.com> <65fadfc30711051032k7779cb70t326e2965d8ed9d7f@mail.gmail.com> Message-ID: Shared libraries and environments (such as python) that are used system wide are good candidates for "frameworkization". Wil was saying that private frameworks should probably be avoided. Ian On Nov 5, 2007, at 11:32 AM, Nehemiah Dacres wrote: > I am not sure how Virtualenv works or why it's not working but you > make the statement > > > >> Frameworks are IMHO a great idea. > > lets not be idiosyncratic here. Frameworks (if you mean *.framework > packages) are only used by apple because they are cumbersome to use > unless you are developing multiple applications that will share > libraries and code which will reduce memory usage if the programs > are used at the same time. (ei MS word) (cite http://wilshipley.com/blog/2005/11/frameworks-are-teh-suck-err.html) > . he also explains their downfalls and how to get around them as > well. Please don't skip any sections until you are fully convinced > otherwise (convinced that frameworks aren't a great idea > > On Nov 5, 2007 12:18 PM, Dethe Elza wrote: > On Nov 5, 2007 10:10 AM, Ronald Oussoren > wrote: > > That's partially because there's a large set of developers that only > > test on Linux and then assume code will work everywhere :-/ > > I'm guilty of that in reverse. I only test on OS X and let Linux > users fend for themselves until they get a sane packaging system like > frameworks and bundles. ;-) > > --Dethe > _______________________________________________ > Pythonmac-SIG maillist - Pythonmac-SIG at python.org > http://mail.python.org/mailman/listinfo/pythonmac-sig > > > > -- > > "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 > _______________________________________________ > Pythonmac-SIG maillist - Pythonmac-SIG at python.org > http://mail.python.org/mailman/listinfo/pythonmac-sig From vip at avatar.com.au Mon Nov 5 21:42:01 2007 From: vip at avatar.com.au (David Worrall) Date: Tue, 6 Nov 2007 07:42:01 +1100 Subject: [Pythonmac-SIG] working around versions In-Reply-To: <2E42C9A7-9C79-44A6-8CAD-DF6272437B72@mac.com> References: <2E42C9A7-9C79-44A6-8CAD-DF6272437B72@mac.com> Message-ID: <4A47A49D-298F-4874-AB0F-535BC9E65C93@avatar.com.au> Thanks for your reply Ronald. I do run multiple versions, but I change the symlink of Current. Do you mean because people change versions in other ways, say through a shell alias rather than change the symlink? I can see that the sys.prefix approach is safer. thanks, David On 06/11/2007, at 1:37 AM, Ronald Oussoren wrote: > > On 5 Nov, 2007, at 3:51, David Worrall wrote: > >> Hi All, >> >> We're doing some work around different versions of Python on OSX (and >> what's in their respective site-packages directory), >> and I was wondering: >> >> Given that we can pick up the the version number of the current >> instantiation using sys.version, >> is there a direct way of computing the locating values for x and y in >> '/Library/Frameworks/Python.framework/Versions/Current/lib/ >> pythonx.y/' >> >> other than through concatenating the above string with a splice of >> sys.version? > > No. > > BTW. The library location is os.path.join(sys.prefix, 'lib', 'python > %d.%d'%(sys.version_info[:2])). This should resolve to a path that > doesn't refer to 'Versions/Current' but to 'Versions/x.y'. Do not > assume that the 'Current' link will point to currently running > version of Python, a user might have installed multiple versions of > python. > > Ronald >> >> >> thanks, >> >> David >> _________________________________________________ >> experimental polymedia: www.avatar.com.au >> Sonic Communications Research Group, >> University of Canberra: creative.canberra.edu.au/scrg/ >> >> >> _______________________________________________ >> Pythonmac-SIG maillist - Pythonmac-SIG at python.org >> http://mail.python.org/mailman/listinfo/pythonmac-sig > _________________________________________________ experimental polymedia: www.avatar.com.au Sonic Communications Research Group, University of Canberra: creative.canberra.edu.au/scrg/ From guerrini.uliano at gmail.com Tue Nov 6 14:40:10 2007 From: guerrini.uliano at gmail.com (Uliano Guerrini) Date: Tue, 6 Nov 2007 14:40:10 +0100 Subject: [Pythonmac-SIG] Leopard PyObjc & Quartz Message-ID: Hello, If I run the Examples in /Developer/Examples/Python/PyObjc/Quartz/... building them from terminal with py2app the work as expected. If I create a new project in Xcode with the any template Cocoa Python Application and add in any file a line with import Quartz then the applicatons stops working (it hangs jumping in the dock) and I can read in the console [Session started at 2007-11-06 14:35:27 +0100.] _RegisterApplication(), FAILED TO establish the default connection to the WindowServer, _CGSDefaultConnection() is NULL. 2007-11-06 14:35:28.430 poppo[864:10b] *** -[NSRecursiveLock unlock]: lock ( '(null)') unlocked when not locked 2007-11-06 14:35:28.431 poppo[864:10b] *** Break on _NSLockError() to debug. 2007-11-06 14:35:28.433 poppo[864:10b] *** -[NSRecursiveLock unlock]: lock ( '(null)') unlocked when not locked 2007-11-06 14:35:28.434 poppo[864:10b] *** Break on _NSLockError() to debug. 2007-11-06 14:35:28.439 poppo[864:10b] *** -[NSRecursiveLock unlock]: lock ( '(null)') unlocked when not locked 2007-11-06 14:35:28.439 poppo[864:10b] *** Break on _NSLockError() to debug. 2007-11-06 14:35:28.443 poppo[864:10b] NSInternalInconsistencyException - Error (1002) creating CGSWindow 2007-11-06 14:35:28.447 poppo[864:10b] *** -[NSRecursiveLock unlock]: lock ( '(null)') unlocked when not locked 2007-11-06 14:35:28.447 poppo[864:10b] *** Break on _NSLockError() to debug. 2007-11-06 14:35:28.449 poppo[864:10b] *** -[NSRecursiveLock unlock]: lock ( '(null)') unlocked when not locked 2007-11-06 14:35:28.449 poppo[864:10b] *** Break on _NSLockError() to debug. 2007-11-06 14:35:28.450 poppo[864:10b] *** -[NSRecursiveLock unlock]: lock ( '(null)') unlocked when not locked 2007-11-06 14:35:28.450 poppo[864:10b] *** Break on _NSLockError() to debug. 2007-11-06 14:35:28.451 poppo[864:10b] *** -[NSRecursiveLock unlock]: lock ( '(null)') unlocked when not locked 2007-11-06 14:35:28.452 poppo[864:10b] *** Break on _NSLockError() to debug. How am I supposed to use Quartz with pyobjc? (if it is possible within xcode) Uliano From luc at honk-honk.com Tue Nov 6 15:18:23 2007 From: luc at honk-honk.com (Luc Heinrich) Date: Tue, 6 Nov 2007 15:18:23 +0100 Subject: [Pythonmac-SIG] Leopard PyObjc & Quartz In-Reply-To: References: Message-ID: <28E30C4A-7180-480E-926A-50922F40406B@honk-honk.com> On 6 nov. 07, at 14:40, Uliano Guerrini wrote: > then the applicatons stops working (it hangs jumping in the dock) and > I can read in the console > > [Session started at 2007-11-06 14:35:27 +0100.] > _RegisterApplication(), FAILED TO establish the default connection to > the WindowServer, _CGSDefaultConnection() is NULL. I have similar problems, I have started a thread on the pyobjc-dev mailing list with my current findings: the problem seems related to importing the Quartz framework before Cocoa connects to the window server, in alias builds *only*. So for example, doing an 'import Quartz' before doing 'AppHelper.runEventLoop()' or 'NSApplication.sharedApplication' will fail, but in alias builds *only*. So this definitely looks like a PyObjC/py2app bug to me so far. -- Luc Heinrich From guerrini.uliano at gmail.com Tue Nov 6 15:48:08 2007 From: guerrini.uliano at gmail.com (Uliano Guerrini) Date: Tue, 6 Nov 2007 15:48:08 +0100 Subject: [Pythonmac-SIG] Leopard PyObjc & Quartz In-Reply-To: <28E30C4A-7180-480E-926A-50922F40406B@honk-honk.com> References: <28E30C4A-7180-480E-926A-50922F40406B@honk-honk.com> Message-ID: <7B8ECEEE-5207-4495-A725-CEB0C37DEDDD@gmail.com> Il giorno 06/nov/07, alle ore 15:18, Luc Heinrich ha scritto: > but in alias builds *only* bingo! I can confirim your findings. Is there any way to make xcode work with py2app not in alias mode? uliano From ronaldoussoren at mac.com Tue Nov 6 22:13:43 2007 From: ronaldoussoren at mac.com (Ronald Oussoren) Date: Tue, 6 Nov 2007 22:13:43 +0100 Subject: [Pythonmac-SIG] working around versions In-Reply-To: <4A47A49D-298F-4874-AB0F-535BC9E65C93@avatar.com.au> References: <2E42C9A7-9C79-44A6-8CAD-DF6272437B72@mac.com> <4A47A49D-298F-4874-AB0F-535BC9E65C93@avatar.com.au> Message-ID: On 5 Nov, 2007, at 21:42, David Worrall wrote: > Thanks for your reply Ronald. > I do run multiple versions, but I change the symlink of Current. > Do you mean because people change versions in other ways, say > through a shell alias rather than change the symlink? When you install two versions of python (say python 2.4 and 2.5) the "Current" symlink will point to the one that was installed last, but both installs are perfectly useable. Ronald -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 2224 bytes Desc: not available Url : http://mail.python.org/pipermail/pythonmac-sig/attachments/20071106/90df1edb/attachment.bin From vivacarlie at gmail.com Tue Nov 6 22:35:51 2007 From: vivacarlie at gmail.com (Nehemiah Dacres) Date: Tue, 6 Nov 2007 15:35:51 -0600 Subject: [Pythonmac-SIG] Problem with numpy on Leopard In-Reply-To: References: <6ce0ac130711011250o73d50c1du944fb62a3263c6ad@mail.gmail.com> <472B0AD5.6080802@tds.net> <472F4DF9.1070801@noaa.gov> <210F9AC8-157E-45E3-A96A-5B91ADA31AB3@mac.com> <472F5C69.50901@noaa.gov> <24d517dd0711051018t243d5a9do7113862ee339500d@mail.gmail.com> <65fadfc30711051032k7779cb70t326e2965d8ed9d7f@mail.gmail.com> Message-ID: <65fadfc30711061335i45d93125sde37d9dfc1e7fd7d@mail.gmail.com> Python is implemented on OSX as a framework, go to /Library/Frameworks/Python.framework and command click and choose show package contents under the contextual menu and you will see the python framework's insides. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/pythonmac-sig/attachments/20071106/51941e8d/attachment.htm From rowen at cesmail.net Wed Nov 7 04:49:23 2007 From: rowen at cesmail.net (Russell E. Owen) Date: Tue, 06 Nov 2007 19:49:23 -0800 Subject: [Pythonmac-SIG] Python TkAqua, Tkinter bug References: <933D27E7-7453-4FA1-93C7-C9CC78C97B79@mac.com> Message-ID: In article <933D27E7-7453-4FA1-93C7-C9CC78C97B79 at mac.com>, davelist at mac.com wrote: > I am not certain where the problem is or who to report it to, but > there is a bug in TkAqua, Tkinter, or possibly OS X's windowing > system. I am using a simple module on top of Tkinter for teaching an > intro programming course. When I click the mouse in the Tkinter > window, it often reports the wrong coordinates for the click most of > the time. If I use idle and first click on the Tk Console window and > then in the graphical window it seems to work. If I don't click in the > Tk Console window or start Python from the Terminal, it almost always > reports wrong values. > > I am running Leopard now and tried both the built-in Python 2.5 and > installing the version from python.org. Some of my students who are > using Tiger report the same issue - I don't recall problems last year > when using this on Tiger, but it's possible. On Windows, the > coordinates are always correct. I have had a version of this bug in *almost* every version of Aqua Tcl/Tk. It plays hell with my application. Fortunately there it seems to be solved in Tcl/Tk 8.4.16 (I suggest the ActiveState installer, but there is a bare binary and installing from source also works). If you want to use an older version for some reason, the *only* one I know of that works is 8.4.11. Everything I've tried in between has exhibited the problem of sometimes reporting bad mouse coordinates.. -- Russell From seungchan.oh at gmail.com Thu Nov 8 08:09:12 2007 From: seungchan.oh at gmail.com (Seungchan Oh) Date: Thu, 8 Nov 2007 00:09:12 -0700 Subject: [Pythonmac-SIG] Having a problem to install PyObjC 2.0 to Leopard Message-ID: Hello, I'm trying to install PyObjC 2.0 by "python setup.py bdist_mpkg --open" I got the source code from http://svn.red-bean.com/pyobjc/tags/r200-leopard . I got an error message related with "PPC", but I'm using Macbook Pro, so I deleted some portion of setup.py related with PPC. The error message is gcc -arch ppc -arch i386 -isysroot /Developer/SDKs/MacOSX10.4u.sdk -fno-strict-aliasing -Wno-long-double -no-cpp-precomp -mno-fused-madd -fno-common -dynamic -DNDEBUG -g -O3 -I/Library/Frameworks/Python.framework/Versions/2.5/include/python2.5 -c Modules/objc/objc-runtime-compat.m -o build/temp.macosx-10.3-fat-2.5 /Modules/objc/objc-runtime-compat.o -DPyObjC_STRICT_DEBUGGING -DMACOSX -no-cpp-precomp -Wno-long-double -g -O1 -Wall -Wstrict-prototypes -Wmissing-prototypes -Wformat=2 -W -Wshadow -Wpointer-arith -Wmissing-declarations -Wnested-externs -Wno-long-long -Wno-import -I/usr/include/libxml2 -Ibuild/codegen/ -Ilibffi-src/include -Ilibffi-src/powerpc Modules/objc/objc-runtime-compat.m: In function 'PyObjC_SetupRuntimeCompat': Modules/objc/objc-runtime-compat.m:850: error: 'class_addIvar' undeclared (first use in this function) Modules/objc/objc-runtime-compat.m:850: error: (Each undeclared identifier is reported only once Modules/objc/objc-runtime-compat.m:850: error: for each function it appears in.) Modules/objc/objc-runtime-compat.m:851: error: 'class_addProtocol' undeclared (first use in this function) Modules/objc/objc-runtime-compat.m: In function 'PyObjC_SetupRuntimeCompat': Modules/objc/objc-runtime-compat.m:850: error: 'class_addIvar' undeclared (first use in this function) Modules/objc/objc-runtime-compat.m:850: error: (Each undeclared identifier is reported only once Modules/objc/objc-runtime-compat.m:850: error: for each function it appears in.) Modules/objc/objc-runtime-compat.m:851: error: 'class_addProtocol' undeclared (first use in this function) lipo: can't figure out the architecture type of: /var/folders/+w/+wei-YpVFdGoV29uK3G3x++++TI/-Tmp-//ccTkn9C3.out error: command 'gcc' failed with exit status 1 Would you give some hit for me please? TIA, SC -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/pythonmac-sig/attachments/20071108/25715576/attachment.htm From tobias.rodaebel at mac.com Thu Nov 8 16:34:23 2007 From: tobias.rodaebel at mac.com (=?ISO-8859-1?Q?Tobias_Rod=E4bel?=) Date: Thu, 8 Nov 2007 16:34:23 +0100 Subject: [Pythonmac-SIG] Having a problem to install PyObjC 2.0 to Leopard In-Reply-To: References: Message-ID: <06EC820A-A007-4AEC-9A8A-4640F85809E5@mac.com> On Nov 8, 2007, at 8:09 AM, Seungchan Oh wrote: > I'm trying to install PyObjC 2.0 by "python setup.py bdist_mpkg -- > open" > I got the source code from http://svn.red-bean.com/pyobjc/tags/r200-leopard > . As far as I know, PyObjC 2.0 is still part of the Python2.5.1 installation on Leopard. So you don't have to build and install it again ;-) Even if you still want to build PyObjC 2.0 on Leopard on your own, use a local installation of Python and adjust the interpreter paths in 02- develop-all.sh and run the script. For me everything worked just fine. Regards, Tobias From mcovill at mac.com Thu Nov 8 20:55:17 2007 From: mcovill at mac.com (Mike Covill) Date: Thu, 8 Nov 2007 14:55:17 -0500 Subject: [Pythonmac-SIG] NSDistributedNotificationCenter Message-ID: <6C81F293-46C3-4312-8831-B71E04196C5C@mac.com> I wanted to try using the NSDistributedNotificationCenter to pass messages between two separate python programs running simultaneously, so to learn about doing this I created this class: FILE: listener.py ------------------------------------------------------------------------ ------------------------- import Foundation class GetNotes(object): def __init__(self): '''register for an NSNotification''' nc = Foundation.NSDistributedNotificationCenter.defaultCenter() nc.addObserver_selector_name_object_(self, 'getMyNotes:', 'myNote', None) def getMyNotes_(self, note): print 'got a note!:', note.object ------------------------------------------------------------------------ ------------------------- then I created an instance of this class and tried sending a notification via the command line, expecting to see a print statement that the notification was received: import Foundation as F import listener gn = listener.GetNotes() nc = F.NSDistributedNotificationCenter.defaultCenter() nc.postNotificationName_object_('myNote', None) So far, no such luck. Any suggestions? Thanks, Mike From ronaldoussoren at mac.com Fri Nov 9 06:32:35 2007 From: ronaldoussoren at mac.com (Ronald Oussoren) Date: Fri, 9 Nov 2007 06:32:35 +0100 Subject: [Pythonmac-SIG] NSDistributedNotificationCenter In-Reply-To: <6C81F293-46C3-4312-8831-B71E04196C5C@mac.com> References: <6C81F293-46C3-4312-8831-B71E04196C5C@mac.com> Message-ID: <2341D30B-825F-4685-90B3-2DC489052D49@mac.com> On 8 Nov, 2007, at 20:55, Mike Covill wrote: > I wanted to try using the NSDistributedNotificationCenter to pass > messages between two separate python programs running simultaneously, > so to learn about doing this I created this class: > > FILE: listener.py > ------------------------------------------------------------------------ > ------------------------- > import Foundation > > class GetNotes(object): > > def __init__(self): > '''register for an NSNotification''' > nc = > Foundation.NSDistributedNotificationCenter.defaultCenter() > nc.addObserver_selector_name_object_(self, 'getMyNotes:', > 'myNote', None) > > def getMyNotes_(self, note): > print 'got a note!:', note.object > ------------------------------------------------------------------------ > ------------------------- > > then I created an instance of this class and tried sending a > notification via the command line, expecting to see a print statement > that the notification was received: > > import Foundation as F > import listener > gn = listener.GetNotes() > nc = F.NSDistributedNotificationCenter.defaultCenter() > nc.postNotificationName_object_('myNote', None) > > So far, no such luck. Any suggestions? The delivery of notifications uses the runloop, it is basically just another source of events. In a command-line tool you'll have to run the loop yourself, something like: loop = F.NSRunLoop.currentRunLoop() loop.run() (That last call will run the eventloop and therefore "block" your script. It will also cause the notification to be delivered). Ronald > > > Thanks, > Mike > _______________________________________________ > 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 : http://mail.python.org/pipermail/pythonmac-sig/attachments/20071109/66829461/attachment.bin From mcovill at mac.com Fri Nov 9 15:35:49 2007 From: mcovill at mac.com (Mike Covill) Date: Fri, 9 Nov 2007 09:35:49 -0500 Subject: [Pythonmac-SIG] NSDistributedNotificationCenter In-Reply-To: <2341D30B-825F-4685-90B3-2DC489052D49@mac.com> References: <6C81F293-46C3-4312-8831-B71E04196C5C@mac.com> <2341D30B-825F-4685-90B3-2DC489052D49@mac.com> Message-ID: <48B91798-FD59-4A4C-9409-C4B9E8A1536F@mac.com> On 2007-Nov-09, at 00:32, Ronald Oussoren wrote: > > On 8 Nov, 2007, at 20:55, Mike Covill wrote: > >> I wanted to try using the NSDistributedNotificationCenter to pass >> messages between two separate python programs running simultaneously, >> so to learn about doing this I created this class: >> >> FILE: listener.py >> --------------------------------------------------------------------- >> --- >> ------------------------- >> import Foundation >> >> class GetNotes(object): >> >> def __init__(self): >> '''register for an NSNotification''' >> nc = >> Foundation.NSDistributedNotificationCenter.defaultCenter() >> nc.addObserver_selector_name_object_(self, 'getMyNotes:', >> 'myNote', None) >> >> def getMyNotes_(self, note): >> print 'got a note!:', note.object >> --------------------------------------------------------------------- >> --- >> ------------------------- >> >> then I created an instance of this class and tried sending a >> notification via the command line, expecting to see a print statement >> that the notification was received: >> >> import Foundation as F >> import listener >> gn = listener.GetNotes() >> nc = F.NSDistributedNotificationCenter.defaultCenter() >> nc.postNotificationName_object_('myNote', None) >> >> So far, no such luck. Any suggestions? > > The delivery of notifications uses the runloop, it is basically > just another source of events. > > In a command-line tool you'll have to run the loop yourself, > something like: > > loop = F.NSRunLoop.currentRunLoop() > loop.run() > > (That last call will run the eventloop and therefore "block" your > script. It will also cause the notification to be delivered). > > Ronald > Works great. Thanks Ronald. Mike >> Thanks, >> Mike >> _______________________________________________ >> Pythonmac-SIG maillist - Pythonmac-SIG at python.org >> http://mail.python.org/mailman/listinfo/pythonmac-sig > From handful at gmail.com Sat Nov 10 23:49:09 2007 From: handful at gmail.com (Marcelo Oliveira) Date: Sat, 10 Nov 2007 19:49:09 -0300 Subject: [Pythonmac-SIG] Pygame on Leopard Message-ID: <2a48ef1f0711101449q7b200576j68f8239cf4e9fc93@mail.gmail.com> Hi guys, Sorry to ask what seems to be a dumb problem, but actually I tried compiling, finding a binary but was not able to do any of those for pygame on leopard. Does anyone was able to do it? Can send a tip? thanks in advance, -- Marcelo Eduardo Moraes de Oliveira ----------------------------------------------------- Just Handful of nothing http://www.marceloeduardo.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/pythonmac-sig/attachments/20071110/2727f152/attachment.htm From chmille3 at vt.edu Thu Nov 15 00:12:16 2007 From: chmille3 at vt.edu (Chreston Miller) Date: Wed, 14 Nov 2007 18:12:16 -0500 Subject: [Pythonmac-SIG] problem with py2app and OpenGL Message-ID: <473B80D0.8080709@vt.edu> Hello all, I am trying to use py2app to create a nice app from a decent sized project that uses many other libraries and some python eggs. It runs fine in alias mode (no surprise) and I am getting a strange error in non-alias mode. First we had to unpack the python egg for PyOpenGL for py2app to recognize PyOpenGL modules. Then I had to copy the python include directory (/Library/Frameworks/Python.framework/Versions/Current/include/) to my ./dist/main.app/Contents/Resources/ directory (where main.app is the name of my app). Then when running, I get the error: Error building the background: No array-type handler for type (value: (1, 1, 0.5)) registered This error is reported to the Console and my program does run, but all the OpenGL stuff does not show up. So it seems there is some dependency missing even though it claims everything works fine (program runs). Any ideas for a solution would be greatly appreciated. Chreston From David.L.Goldsmith at noaa.gov Fri Nov 16 19:16:07 2007 From: David.L.Goldsmith at noaa.gov (David.Goldsmith) Date: Fri, 16 Nov 2007 10:16:07 -0800 Subject: [Pythonmac-SIG] Anyone have a scons binary for Tiger? Message-ID: <473DDE67.5080207@noaa.gov> Thanks! DG From vivacarlie at gmail.com Fri Nov 16 20:54:08 2007 From: vivacarlie at gmail.com (Nehemiah Dacres) Date: Fri, 16 Nov 2007 13:54:08 -0600 Subject: [Pythonmac-SIG] Anyone have a scons binary for Tiger? In-Reply-To: <473DDE67.5080207@noaa.gov> References: <473DDE67.5080207@noaa.gov> Message-ID: <65fadfc30711161154o3454d13by3804324b145bc31@mail.gmail.com> macports to the rescue! on the commandline at the prompt type port install scons or, if your not interested in macports and are using pythohn4.5 or have easy_install installed, try 'easy_install scons' and see where that gets you. if fink has the binary, be our guest. On Nov 16, 2007 12:16 PM, David.Goldsmith wrote: > Thanks! > > DG > _______________________________________________ > Pythonmac-SIG maillist - Pythonmac-SIG at python.org > http://mail.python.org/mailman/listinfo/pythonmac-sig > -- "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: http://mail.python.org/pipermail/pythonmac-sig/attachments/20071116/63a42bee/attachment.htm From ken at sparklight.com Fri Nov 16 15:10:38 2007 From: ken at sparklight.com (sparklight) Date: Fri, 16 Nov 2007 06:10:38 -0800 (PST) Subject: [Pythonmac-SIG] P4Python, MySQLdb, or Python Extensions In-Reply-To: <8532cb8c0710090859v414e9b4ak8075b43c3a92f6c2@mail.gmail.com> References: <8532cb8c0710081357g1f3e31f8gb4fa4172c60e68df@mail.gmail.com> <65fadfc30710090716s4ade34c7o9dc9a8bec22347a7@mail.gmail.com> <8532cb8c0710090859v414e9b4ak8075b43c3a92f6c2@mail.gmail.com> Message-ID: <13793945.post@talk.nabble.com> Lyndsey Ferguson wrote: > > On 10/9/07, Nehemiah Dacres wrote: >> >> .so, if im not mistaken is eather a linux shared library or not a mac >> shared library (someone correct me if im wrong) try making sure the >> python >> version you chose is the one for mac. > > Thank you for the reply. I have removed older versions of Python and using > your link, installed Python 2.5 for the Macintosh. > > After which I tried to build and install with the same problem. But I have > solved it and will post it to the author and this list (in case someone > follows in my footsteps). > > In the setup.py for the Macintosh case, I had to add the > "extra_link_args=["-framework", "Carbon] to the setup call. This works and > I > was able to run it in python. > Lyndsey - I see your resolution to the -framework Carbon problem, I discovered that also. But I'm still groping for the solution to the "Inappropriate file type for dynamic loading" problem. My linker (gcc running under the Eclipse IDE) produces a .dylib by default, not a .so, and if I simply rename the file, I get the same traceback you got. Clearly .dylib is an Apple dynamic library format, and MacPython 2.4 is not prepared to recognize it. How did you resolve this? Did going to Python 2.5 suffice? Ken -- View this message in context: http://www.nabble.com/P4Python%2C-MySQLdb%2C-or-Python-Extensions-tf4590668.html#a13793945 Sent from the Python - pythonmac-sig mailing list archive at Nabble.com. From ronaldoussoren at mac.com Mon Nov 19 13:37:26 2007 From: ronaldoussoren at mac.com (Ronald Oussoren) Date: Mon, 19 Nov 2007 04:37:26 -0800 Subject: [Pythonmac-SIG] P4Python, MySQLdb, or Python Extensions In-Reply-To: <13793945.post@talk.nabble.com> References: <8532cb8c0710081357g1f3e31f8gb4fa4172c60e68df@mail.gmail.com> <65fadfc30710090716s4ade34c7o9dc9a8bec22347a7@mail.gmail.com> <8532cb8c0710090859v414e9b4ak8075b43c3a92f6c2@mail.gmail.com> <13793945.post@talk.nabble.com> Message-ID: On Monday, November 19, 2007, at 10:05AM, "sparklight" wrote: > > >Lyndsey - I see your resolution to the -framework Carbon problem, I >discovered that also. But I'm still groping for the solution to the >"Inappropriate file type for dynamic loading" problem. My linker (gcc >running under the Eclipse IDE) produces a .dylib by default, not a .so, and >if I simply rename the file, I get the same traceback you got. Clearly >.dylib is an Apple dynamic library format, and MacPython 2.4 is not prepared >to recognize it. How did you resolve this? Did going to Python 2.5 >suffice? Python extensions are bundles (created with 'cc -bundle'), not shared libraries (created with 'cc -shared'). BTW. Why not use distutils to build extensions, that will automaticly do the right thing on all platforms. Ronald From lyndsey.ferguson at gmail.com Mon Nov 19 16:03:49 2007 From: lyndsey.ferguson at gmail.com (Lyndsey Ferguson) Date: Mon, 19 Nov 2007 10:03:49 -0500 Subject: [Pythonmac-SIG] P4Python, MySQLdb, or Python Extensions In-Reply-To: <13793945.post@talk.nabble.com> References: <8532cb8c0710081357g1f3e31f8gb4fa4172c60e68df@mail.gmail.com> <65fadfc30710090716s4ade34c7o9dc9a8bec22347a7@mail.gmail.com> <8532cb8c0710090859v414e9b4ak8075b43c3a92f6c2@mail.gmail.com> <13793945.post@talk.nabble.com> Message-ID: On Nov 16, 2007, at 9:10 AM, sparklight wrote: > > > Lyndsey Ferguson wrote: >> >> On 10/9/07, Nehemiah Dacres wrote: >>> >>> .so, if im not mistaken is eather a linux shared library or not a >>> mac >>> shared library (someone correct me if im wrong) try making sure the >>> python >>> version you chose is the one for mac. >> >> Thank you for the reply. I have removed older versions of Python >> and using >> your link, installed Python 2.5 for the Macintosh. >> >> After which I tried to build and install with the same problem. But >> I have >> solved it and will post it to the author and this list (in case >> someone >> follows in my footsteps). >> >> In the setup.py for the Macintosh case, I had to add the >> "extra_link_args=["-framework", "Carbon] to the setup call. This >> works and >> I >> was able to run it in python. >> > > Lyndsey - I see your resolution to the -framework Carbon problem, I > discovered that also. But I'm still groping for the solution to the > "Inappropriate file type for dynamic loading" problem. My linker (gcc > running under the Eclipse IDE) produces a .dylib by default, not > a .so, and > if I simply rename the file, I get the same traceback you got. > Clearly > .dylib is an Apple dynamic library format, and MacPython 2.4 is not > prepared > to recognize it. How did you resolve this? Did going to Python 2.5 > suffice? Hi Ken, I used the setup.py "build" command to build the .so file directly. I also tried to build the object directly using the Xcode IDE, but as you have found out .dylib is the default type. One can rename it and it will get loaded as such, but I couldn't figure out how to build a .so file that the Python environment could recognize. Just use setup.py build and it will take care of it. Lyndsey From leknarf at pacbell.net Mon Nov 19 20:50:27 2007 From: leknarf at pacbell.net (Scott Frankel) Date: Mon, 19 Nov 2007 11:50:27 -0800 Subject: [Pythonmac-SIG] Eclipse + SWT + Python Message-ID: <8E8A17A5-FC50-477F-BB64-EE36E7418B0D@pacbell.net> Is anyone on this list using Eclipse with Python and the SWT windowing kit? I've been looking through the MacPython.org and Eclipse pages for info on combining Python and SWT. So far, I've read about the PyDev plugin that allows Eclipse to speak Python. I'd like to know if PyDev would allow me to use Python to build SWT projects. If not, can Python methods can be invoked from within an SWT Java project. Ultimately, I'm looking for a windowing toolkit that uses native widgets, one that can provide a high level of visual polish, that can be built for multiple OS's and platforms, and that plays nicely with Python. Thanks in advance! Scott From santagada at gmail.com Mon Nov 19 21:45:07 2007 From: santagada at gmail.com (Leonardo Santagada) Date: Mon, 19 Nov 2007 18:45:07 -0200 Subject: [Pythonmac-SIG] Eclipse + SWT + Python In-Reply-To: <8E8A17A5-FC50-477F-BB64-EE36E7418B0D@pacbell.net> References: <8E8A17A5-FC50-477F-BB64-EE36E7418B0D@pacbell.net> Message-ID: <7FF16EDC-F9CD-49C7-84C5-22F8171B5724@gmail.com> Em 19/11/2007, ?s 17:50, Scott Frankel escreveu: > Is anyone on this list using Eclipse with Python and the SWT > windowing kit? > > I've been looking through the MacPython.org and Eclipse pages for > info on combining Python and SWT. So far, I've read about the PyDev > plugin that allows Eclipse to speak Python. > > I'd like to know if PyDev would allow me to use Python to build SWT > projects. If not, can Python methods can be invoked from within an > SWT Java project. > > Ultimately, I'm looking for a windowing toolkit that uses native > widgets, one that can provide a high level of visual polish, that can > be built for multiple OS's and platforms, and that plays nicely with > Python. I would advise you to try WxPython or QT. -- Leonardo Santagada From kent37 at tds.net Mon Nov 19 21:59:42 2007 From: kent37 at tds.net (Kent Johnson) Date: Mon, 19 Nov 2007 15:59:42 -0500 Subject: [Pythonmac-SIG] Eclipse + SWT + Python In-Reply-To: <8E8A17A5-FC50-477F-BB64-EE36E7418B0D@pacbell.net> References: <8E8A17A5-FC50-477F-BB64-EE36E7418B0D@pacbell.net> Message-ID: <4741F93E.9040503@tds.net> Scott Frankel wrote: > Is anyone on this list using Eclipse with Python and the SWT > windowing kit? > > I've been looking through the MacPython.org and Eclipse pages for > info on combining Python and SWT. So far, I've read about the PyDev > plugin that allows Eclipse to speak Python. > > I'd like to know if PyDev would allow me to use Python to build SWT > projects. If not, can Python methods can be invoked from within an > SWT Java project. I think you will need to use Jython for this: http://www.jython.org Kent From JKelly at nemetschek.net Mon Nov 19 22:03:50 2007 From: JKelly at nemetschek.net (Jim Kelly) Date: Mon, 19 Nov 2007 16:03:50 -0500 Subject: [Pythonmac-SIG] Eclipse + SWT + Python In-Reply-To: <7FF16EDC-F9CD-49C7-84C5-22F8171B5724@gmail.com> Message-ID: I've had good experience with wxpython. In some areas the documentation can be a little spotty, but it's generally pretty easy to figure out. I've had a few quirks with PyDev though. I found it difficult to get it to recognize where my site-packages directory was, despite the fact that the binary PyDev was using to interpret python could import packages just fine. It would also occasionally crash eclipse, or sometimes the characters on the screen would get scrambled. A word of caution on that, if you see that, don't save... That isn't a display issue, that's literally what gets saved (the garbage characters). Jim On 11/19/07 3:45 PM, "Leonardo Santagada" wrote: > Em 19/11/2007, ?s 17:50, Scott Frankel escreveu: >> Is anyone on this list using Eclipse with Python and the SWT >> windowing kit? >> >> I've been looking through the MacPython.org and Eclipse pages for >> info on combining Python and SWT. So far, I've read about the PyDev >> plugin that allows Eclipse to speak Python. >> >> I'd like to know if PyDev would allow me to use Python to build SWT >> projects. If not, can Python methods can be invoked from within an >> SWT Java project. >> >> Ultimately, I'm looking for a windowing toolkit that uses native >> widgets, one that can provide a high level of visual polish, that can >> be built for multiple OS's and platforms, and that plays nicely with >> Python. > > > I would advise you to try WxPython or QT. > > -- > Leonardo Santagada > > > > _______________________________________________ > Pythonmac-SIG maillist - Pythonmac-SIG at python.org > http://mail.python.org/mailman/listinfo/pythonmac-sig -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/pythonmac-sig/attachments/20071119/cfb27a13/attachment.htm From ed at leafe.com Mon Nov 19 21:56:39 2007 From: ed at leafe.com (Ed Leafe) Date: Mon, 19 Nov 2007 15:56:39 -0500 Subject: [Pythonmac-SIG] Eclipse + SWT + Python In-Reply-To: <8E8A17A5-FC50-477F-BB64-EE36E7418B0D@pacbell.net> References: <8E8A17A5-FC50-477F-BB64-EE36E7418B0D@pacbell.net> Message-ID: <8233981B-A5E1-4699-A447-F4EF5EB4B3CE@leafe.com> On Nov 19, 2007, at 2:50 PM, Scott Frankel wrote: > Ultimately, I'm looking for a windowing toolkit that uses native > widgets, one that can provide a high level of visual polish, that can > be built for multiple OS's and platforms, and that plays nicely with > Python. Sounds like you're looking for wxPython. I use it to build apps on OS X, Windows and Linux/Gtk. You might also want to look into Dabo, which is the leading desktop application framework for Python, and which uses wxPython for the UI layer. I am one of the authors of Dabo. -- Ed Leafe -- http://leafe.com -- http://dabodev.com From leknarf at pacbell.net Mon Nov 19 22:23:02 2007 From: leknarf at pacbell.net (Scott Frankel) Date: Mon, 19 Nov 2007 13:23:02 -0800 Subject: [Pythonmac-SIG] Eclipse + SWT + Python In-Reply-To: References: Message-ID: Thanks for the suggestions (and warnings!). Would Idle be a good choice for IDE if I were to use wx? I've seen Python plugins for XCode. Would that support debugging? Thanks again! Scott On Nov 19, 2007, at 1:03 PM, James Kelly wrote: > I've had good experience with wxpython. In some areas the > documentation can > be a little spotty, but it's generally pretty easy to figure out. > > I've had a few quirks with PyDev though. I found it difficult to > get it to > recognize where my site-packages directory was, despite the fact > that the > binary PyDev was using to interpret python could import packages > just fine. > > It would also occasionally crash eclipse, or sometimes the > characters on the > screen would get scrambled. A word of caution on that, if you see > that, > don't save... That isn't a display issue, that's literally what > gets saved > (the garbage characters). > > Jim > > > On 11/19/07 3:45 PM, "Leonardo Santagada" wrote: > >> Em 19/11/2007, ?s 17:50, Scott Frankel escreveu: >>> Is anyone on this list using Eclipse with Python and the SWT >>> windowing kit? >>> >>> I've been looking through the MacPython.org and Eclipse pages for >>> info on combining Python and SWT. So far, I've read about the PyDev >>> plugin that allows Eclipse to speak Python. >>> >>> I'd like to know if PyDev would allow me to use Python to build SWT >>> projects. If not, can Python methods can be invoked from within an >>> SWT Java project. >>> >>> Ultimately, I'm looking for a windowing toolkit that uses native >>> widgets, one that can provide a high level of visual polish, that >>> can >>> be built for multiple OS's and platforms, and that plays nicely with >>> Python. >> >> >> I would advise you to try WxPython or QT. >> >> -- >> Leonardo Santagada >> >> >> >> _______________________________________________ >> Pythonmac-SIG maillist - Pythonmac-SIG at python.org >> http://mail.python.org/mailman/listinfo/pythonmac-sig > From hraban at fiee.net Mon Nov 19 22:32:01 2007 From: hraban at fiee.net (Henning Hraban Ramm) Date: Mon, 19 Nov 2007 22:32:01 +0100 Subject: [Pythonmac-SIG] Eclipse + SWT + Python In-Reply-To: <8233981B-A5E1-4699-A447-F4EF5EB4B3CE@leafe.com> References: <8E8A17A5-FC50-477F-BB64-EE36E7418B0D@pacbell.net> <8233981B-A5E1-4699-A447-F4EF5EB4B3CE@leafe.com> Message-ID: Am 2007-11-19 um 21:56 schrieb Ed Leafe: > On Nov 19, 2007, at 2:50 PM, Scott Frankel wrote: >> Ultimately, I'm looking for a windowing toolkit that uses native >> widgets, one that can provide a high level of visual polish, that can >> be built for multiple OS's and platforms, and that plays nicely with >> Python. > Sounds like you're looking for wxPython. I use it to build apps on > OS X, Windows and Linux/Gtk. > > You might also want to look into Dabo, which is the leading desktop > application framework for Python, and which uses wxPython for the UI > layer. I am one of the authors of Dabo. I'm one of the happy users (if I must provide GUIs at all). :-) dabo really makes wxPython easy, once you get into it. Greetlings from Lake Constance! Hraban --- http://www.fiee.net https://www.cacert.org (I'm an assurer) From hraban at fiee.net Mon Nov 19 22:49:00 2007 From: hraban at fiee.net (Henning Hraban Ramm) Date: Mon, 19 Nov 2007 22:49:00 +0100 Subject: [Pythonmac-SIG] Eclipse + SWT + Python In-Reply-To: References: Message-ID: Am 2007-11-19 um 22:23 schrieb Scott Frankel: > Would Idle be a good choice for IDE if I were to use wx? I've seen > Python plugins for XCode. Would that support debugging? Please look for the several IDE threads in the ML's archive. Short answer: IDLE is dead, and XCode is uncomfortable for Python. It very much depends on what you need/expect from an IDE/editor. Best for wxPython might be SPE: http://pythonide.stani.be/ Greetlings from Lake Constance! Hraban --- http://www.fiee.net https://www.cacert.org (I'm an assurer) From janssen at parc.com Mon Nov 19 22:51:51 2007 From: janssen at parc.com (Bill Janssen) Date: Mon, 19 Nov 2007 13:51:51 PST Subject: [Pythonmac-SIG] Eclipse + SWT + Python In-Reply-To: <8233981B-A5E1-4699-A447-F4EF5EB4B3CE@leafe.com> References: <8E8A17A5-FC50-477F-BB64-EE36E7418B0D@pacbell.net> <8233981B-A5E1-4699-A447-F4EF5EB4B3CE@leafe.com> Message-ID: <07Nov19.135156pst."58696"@synergy1.parc.xerox.com> > Ultimately, I'm looking for a windowing toolkit that uses native > widgets, one that can provide a high level of visual polish, that can > be built for multiple OS's and platforms, and that plays nicely with > Python. Another possibility is to use Java Swing, via JCC, Andi Vajda's system for producing Python stubs for Java classes. Of course, you'd have to have a JRE installed on your machine, along with Python. I've been impressed with the Python API this provides for Lucene, another Java toolkit. See http://svn.osafoundation.org/pylucene/trunk/jcc/jcc/README Bill From mhjorleifsson at mac.com Mon Nov 19 23:04:27 2007 From: mhjorleifsson at mac.com (Michele Hjorleifsson) Date: Mon, 19 Nov 2007 17:04:27 -0500 Subject: [Pythonmac-SIG] Most Popular Distribution In-Reply-To: References: Message-ID: >> What is the most popular python distribution for OS X ? From Chris.Barker at noaa.gov Mon Nov 19 23:25:32 2007 From: Chris.Barker at noaa.gov (Christopher Barker) Date: Mon, 19 Nov 2007 14:25:32 -0800 Subject: [Pythonmac-SIG] Eclipse + SWT + Python In-Reply-To: References: Message-ID: <47420D5C.5040002@noaa.gov> Scott Frankel wrote: > Would Idle be a good choice for IDE if I were to use wx? Just be clear - the choice of IDE should be completely independent of choice of GUI toolkit. You can use Eclipse+PyDev just fine with wx, for instance (ad fine as you can use Eclipse+PyDev for anything, anyway) A really good, clean, native Python IDE for the Mac is still missing, but there are lots of options for editors -- and a good editor is key. The latest version of wxPython comes with Editra, a wx-python based editor. It might be worth a try. Aside from the ones mentioned here there are a couple commercial options: WingIDE Komodo -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 Nov 19 23:28:04 2007 From: Chris.Barker at noaa.gov (Christopher Barker) Date: Mon, 19 Nov 2007 14:28:04 -0800 Subject: [Pythonmac-SIG] Most Popular Distribution In-Reply-To: References: Message-ID: <47420DF4.7030408@noaa.gov> Michele Hjorleifsson wrote: >>> What is the most popular python distribution for OS X ? I don't know about most popular but the best supported on this list is the "Universal Framework Build" of 2.5 -- from either: http://www.python.org/download/ or http://pythonmac.org/packages/py25-fat/index.html -Chris -- Christopher Barker, Ph.D. Oceanographer Emergency Response Division NOAA/NOS/OR&R (206) 526-6959 voice 7600 Sand Point Way NE (206) 526-6329 fax Seattle, WA 98115 (206) 526-6317 main reception Chris.Barker at noaa.gov From dwf at cs.toronto.edu Tue Nov 20 00:59:33 2007 From: dwf at cs.toronto.edu (David Warde-Farley) Date: Mon, 19 Nov 2007 18:59:33 -0500 Subject: [Pythonmac-SIG] MySQLdb on 2.5? Message-ID: Hi folks, I went looking for a Universal Binary of MySQL-python (aka MySQLdb) now that I moved over to 2.5. Saw that there wasn't on undefined, so attempted to build myself. I get some rather weird stuff, that when googled only produces one slightly relevant result at http:// tinyurl.com/2ah45v . Output: ---------------------- ~/Desktop/MySQL-python-1.2.2$ python setup.py build running build running build_py copying MySQLdb/release.py -> build/lib.macosx-10.3-fat-2.5/MySQLdb running build_ext building '_mysql' extension gcc -isysroot /Developer/SDKs/MacOSX10.4u.sdk -fno-strict-aliasing - Wno-long-double -no-cpp-precomp -mno-fused-madd -fno-common -dynamic - DNDEBUG -g -O3 -Dversion_info=(1,2,2,'final',0) -D__version__=1.2.2 - I/usr/local/mysql/include -I/Library/Frameworks/Python.framework/ Versions/2.5/include/python2.5 -c _mysql.c -o build/temp.macosx-10.3- fat-2.5/_mysql.o -Os -arch ppc64 -fno-common In file included from /Library/Frameworks/Python.framework/Versions/ 2.5/include/python2.5/Python.h:57, from pymemcompat.h:10, from _mysql.c:29: /Library/Frameworks/Python.framework/Versions/2.5/include/python2.5/ pyport.h:734:2: error: #error "LONG_BIT definition appears wrong for platform (bad gcc/glibc config?)." In file included from _mysql.c:35: /usr/local/mysql/include/my_config.h:1021:1: warning: "SIZEOF_LONG" redefined In file included from /Library/Frameworks/Python.framework/Versions/ 2.5/include/python2.5/Python.h:8, from pymemcompat.h:10, from _mysql.c:29: /Library/Frameworks/Python.framework/Versions/2.5/include/python2.5/ pyconfig.h:807:1: warning: this is the location of the previous definition error: command 'gcc' failed with exit status 1 ---------------------- If it makes a difference I'm compiling this on a G5. Has anyone got the patch kicking around that was used to build the 2.4 UB package? Thanks, David From bob at redivi.com Tue Nov 20 01:21:12 2007 From: bob at redivi.com (Bob Ippolito) Date: Mon, 19 Nov 2007 16:21:12 -0800 Subject: [Pythonmac-SIG] MySQLdb on 2.5? In-Reply-To: References: Message-ID: <6a36e7290711191621t2654aa9dhb51e7fb00fd034bd@mail.gmail.com> I'm pretty sure I didn't patch anything. I think what I had to do was take a PPC MySQL library and an x86 MySQL library and use lipo to splice them together, but other than that it compiled fine I believe. We haven't had a reason to use MySQL with Python for a few years now, so I'm not going to try again... but that's what I recall. On 11/19/07, David Warde-Farley wrote: > Hi folks, > > I went looking for a Universal Binary of MySQL-python (aka MySQLdb) > now that I moved over to 2.5. Saw that there wasn't on undefined, so > attempted to build myself. I get some rather weird stuff, that when > googled only produces one slightly relevant result at http:// > tinyurl.com/2ah45v . > > Output: > > ---------------------- > ~/Desktop/MySQL-python-1.2.2$ python setup.py build > running build > running build_py > copying MySQLdb/release.py -> build/lib.macosx-10.3-fat-2.5/MySQLdb > running build_ext > building '_mysql' extension > gcc -isysroot /Developer/SDKs/MacOSX10.4u.sdk -fno-strict-aliasing - > Wno-long-double -no-cpp-precomp -mno-fused-madd -fno-common -dynamic - > DNDEBUG -g -O3 -Dversion_info=(1,2,2,'final',0) -D__version__=1.2.2 - > I/usr/local/mysql/include -I/Library/Frameworks/Python.framework/ > Versions/2.5/include/python2.5 -c _mysql.c -o build/temp.macosx-10.3- > fat-2.5/_mysql.o -Os -arch ppc64 -fno-common > In file included from /Library/Frameworks/Python.framework/Versions/ > 2.5/include/python2.5/Python.h:57, > from pymemcompat.h:10, > from _mysql.c:29: > /Library/Frameworks/Python.framework/Versions/2.5/include/python2.5/ > pyport.h:734:2: error: #error "LONG_BIT definition appears wrong for > platform (bad gcc/glibc config?)." > In file included from _mysql.c:35: > /usr/local/mysql/include/my_config.h:1021:1: warning: "SIZEOF_LONG" > redefined > In file included from /Library/Frameworks/Python.framework/Versions/ > 2.5/include/python2.5/Python.h:8, > from pymemcompat.h:10, > from _mysql.c:29: > /Library/Frameworks/Python.framework/Versions/2.5/include/python2.5/ > pyconfig.h:807:1: warning: this is the location of the previous > definition > error: command 'gcc' failed with exit status 1 > ---------------------- > > > If it makes a difference I'm compiling this on a G5. Has anyone got > the patch kicking around that was used to build the 2.4 UB package? > > Thanks, > > David > > _______________________________________________ > Pythonmac-SIG maillist - Pythonmac-SIG at python.org > http://mail.python.org/mailman/listinfo/pythonmac-sig > From leknarf at pacbell.net Tue Nov 20 01:56:02 2007 From: leknarf at pacbell.net (Scott Frankel) Date: Mon, 19 Nov 2007 16:56:02 -0800 Subject: [Pythonmac-SIG] Eclipse + SWT + Python In-Reply-To: <47420D5C.5040002@noaa.gov> References: <47420D5C.5040002@noaa.gov> Message-ID: <155F59F8-312E-4839-963E-16062FA71B32@pacbell.net> I'll take a new look at wxPython and Editra. I'll also check out SPE. Time to adopt a more robust debugging scheme than tossing print statements through Emacs ... Thanks all! Scott On Nov 19, 2007, at 2:25 PM, Christopher Barker wrote: > Scott Frankel wrote: >> Would Idle be a good choice for IDE if I were to use wx? > > Just be clear - the choice of IDE should be completely independent > of choice of GUI toolkit. > > You can use Eclipse+PyDev just fine with wx, for instance (ad fine > as you can use Eclipse+PyDev for anything, anyway) > > A really good, clean, native Python IDE for the Mac is still > missing, but there are lots of options for editors -- and a good > editor is key. > > The latest version of wxPython comes with Editra, a wx-python based > editor. It might be worth a try. > > Aside from the ones mentioned here there are a couple commercial > options: > > WingIDE > Komodo > > -Chris > > > -- > Christopher Barker, Ph.D. > Oceanographer > > Emergency Response Division > NOAA/NOS/OR&R (206) 526-6959 voice > 7600 Sand Point Way NE (206) 526-6329 fax > Seattle, WA 98115 (206) 526-6317 main reception > > Chris.Barker at noaa.gov From dwf at cs.toronto.edu Tue Nov 20 08:01:47 2007 From: dwf at cs.toronto.edu (David Warde-Farley) Date: Tue, 20 Nov 2007 02:01:47 -0500 Subject: [Pythonmac-SIG] MySQLdb on 2.5? In-Reply-To: <6a36e7290711191621t2654aa9dhb51e7fb00fd034bd@mail.gmail.com> References: <6a36e7290711191621t2654aa9dhb51e7fb00fd034bd@mail.gmail.com> Message-ID: On 19-Nov-07, at 7:21 PM, Bob Ippolito wrote: > I'm pretty sure I didn't patch anything. I think what I had to do was > take a PPC MySQL library and an x86 MySQL library and use lipo to > splice them together, but other than that it compiled fine I believe. > > We haven't had a reason to use MySQL with Python for a few years now, > so I'm not going to try again... but that's what I recall. Silly me. I noticed a -arch ppc64 in the log I pasted, for some reason I had absentmindedly installed the 64-bit PPC MySQL package, which I really don't need. 32-bit works fine. My uninformed guess is that 32-bit Python/64 bit MySQL will never let their children marry each other. Thanks for the quick response (as always), David From Jack.Jansen at cwi.nl Tue Nov 20 12:50:00 2007 From: Jack.Jansen at cwi.nl (Jack Jansen) Date: Tue, 20 Nov 2007 12:50:00 +0100 Subject: [Pythonmac-SIG] Anyone playing with CoreAnimation yet? Message-ID: I've just realised how powerful CoreAnimation is, and I want to start playing with it, especially with the interaction of CoreAnimation CALayer with "classic" AppKit views and how to treat events, etc. Is anyone else here using it, and/or interested in sharing experience? -- 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 delza at livingcode.org Tue Nov 20 16:15:59 2007 From: delza at livingcode.org (Dethe Elza) Date: Tue, 20 Nov 2007 07:15:59 -0800 Subject: [Pythonmac-SIG] Anyone playing with CoreAnimation yet? In-Reply-To: References: Message-ID: Hi Jack, I'm very interested, but have not had time to dig into CoreAnimation yet. I would definitely like to hear your experiences with it, and will share mine when my current project is wrapped up. --Dethe On 20-Nov-07, at 3:50 AM, Jack Jansen wrote: > I've just realised how powerful CoreAnimation is, and I want to start > playing with it, especially with the interaction of CoreAnimation > CALayer with "classic" AppKit views and how to treat events, etc. > > Is anyone else here using it, and/or interested in sharing experience? > -- > Jack Jansen, , http://www.cwi.nl/~jack > If I can't dance I don't want to be part of your revolution -- Emma > Goldman > > > _______________________________________________ > Pythonmac-SIG maillist - Pythonmac-SIG at python.org > http://mail.python.org/mailman/listinfo/pythonmac-sig From david at optixx.org Tue Nov 20 18:40:41 2007 From: david at optixx.org (David Voswinkel) Date: Tue, 20 Nov 2007 18:40:41 +0100 Subject: [Pythonmac-SIG] appscript create new iphoto album Message-ID: <200711201840.41818.david@optixx.org> Hi, try to create an new iPhoto album, But cant get it working. Is this a bug? >>> app('iPhoto').make(new=k.regular_album, with_properties={ k.name : 'New Album' }) Traceback (most recent call last): File "", line 1, in File "/Library/Python/2.5/site-packages/appscript-0.17.2-py2.5-macosx-10.5-i386.egg/appscript/reference.py", line 387, in __call__ raise CommandError(self, (args, kargs), e) appscript.reference.CommandError: CommandError -2710: errOSACantCreate Failed command: app(u'/Applications/iPhoto.app').make(new=k.regular_album, with_properties={k.name: 'New Album'}) From vip at avatar.com.au Tue Nov 20 20:11:57 2007 From: vip at avatar.com.au (DaveW) Date: Wed, 21 Nov 2007 06:11:57 +1100 Subject: [Pythonmac-SIG] Eclipse + SWT + Python In-Reply-To: <155F59F8-312E-4839-963E-16062FA71B32@pacbell.net> References: <47420D5C.5040002@noaa.gov> <155F59F8-312E-4839-963E-16062FA71B32@pacbell.net> Message-ID: For rapid UI development which keeps the action code separate from the gaphics, check out wxglade. http://wxglade.sourceforge.net/ Excellent tool. I've written some comments about a few wxpython things at http://www.avatar.com.au/sonipy/uiGUI.html Did someone already mention the wxPython book: "wxPython in Action" by Noel Rappin and Robin Dunn A well-written good read. David On 20/11/2007, at 11:56 AM, Scott Frankel wrote: > > I'll take a new look at wxPython and Editra. I'll also check out > SPE. Time to adopt a more robust debugging scheme than tossing print > statements through Emacs ... > > Thanks all! > Scott > > > > > > On Nov 19, 2007, at 2:25 PM, Christopher Barker wrote: > >> Scott Frankel wrote: >>> Would Idle be a good choice for IDE if I were to use wx? >> >> Just be clear - the choice of IDE should be completely independent >> of choice of GUI toolkit. >> >> You can use Eclipse+PyDev just fine with wx, for instance (ad fine >> as you can use Eclipse+PyDev for anything, anyway) >> >> A really good, clean, native Python IDE for the Mac is still >> missing, but there are lots of options for editors -- and a good >> editor is key. >> >> The latest version of wxPython comes with Editra, a wx-python based >> editor. It might be worth a try. >> >> Aside from the ones mentioned here there are a couple commercial >> options: >> >> WingIDE >> Komodo >> >> -Chris >> >> >> -- >> Christopher Barker, Ph.D. >> Oceanographer >> >> Emergency Response Division >> NOAA/NOS/OR&R (206) 526-6959 voice >> 7600 Sand Point Way NE (206) 526-6329 fax >> Seattle, WA 98115 (206) 526-6317 main reception >> >> Chris.Barker at noaa.gov > > _______________________________________________ > Pythonmac-SIG maillist - Pythonmac-SIG at python.org > http://mail.python.org/mailman/listinfo/pythonmac-sig > _________________________________________________ experimental polymedia: www.avatar.com.au Sonic Communications Research Group, University of Canberra: creative.canberra.edu.au/scrg/ From zooko at zooko.com Tue Nov 20 20:53:29 2007 From: zooko at zooko.com (zooko) Date: Tue, 20 Nov 2007 11:53:29 -0800 Subject: [Pythonmac-SIG] does pkg_resources think that "macosx-10.3" is incompatible with 10.5? Message-ID: Folks: It appears that eggs built on Mac OS 10.4 are produced with filenames containing "macosx-10.3", like this: http://pypi.python.org/packages/2.5/s/simplejson/simplejson-1.7.3- py2.5-macosx-10.3-fat.egg but that if you try to easy_install such a package on Mac OS 10.5, it will deem that egg to be incompatible with the current platform and will instead try to install from a source tarball if it can find one. (On the other hand if you install that egg on Mac OS 10.4, it will work.) PJE reports that the platform versioning code for OS X was contributed by someone other than he to pkg_resources, and that he doesn't know how it works, except that it reads /usr/bin/sw_vers. Does anyone know if there is a good reason for Python running on 10.5 to reject binaries built on 10.4, and if not what would be required to make this version check pass? Here is a ticket on the allmydata.org tahoe project about this issue: http://allmydata.org/trac/tahoe/ticket/212 (Tahoe is a new distributed, cryptographically protected filesystem. It's super cool. Check it out.) Thanks! Regards, Zooko From njriley at uiuc.edu Wed Nov 21 16:32:02 2007 From: njriley at uiuc.edu (Nicholas Riley) Date: Wed, 21 Nov 2007 09:32:02 -0600 Subject: [Pythonmac-SIG] readline support for OS X Leopard In-Reply-To: <18204.40785.14763.936771@montanaro.dyndns.org> References: <18204.40785.14763.936771@montanaro.dyndns.org> Message-ID: <20071121153202.GA55695@uiuc.edu> On Mon, Oct 22, 2007 at 08:02:09AM -0500, skip at pobox.com wrote: > Just install GNU readline and point the build system at it. For example, I > have MacPorts (http://www.macports.org/) installed in /opt/local. GNU > readline is installed there, and my readline module is linked against that: IPython brokenness (specifically autoindent and bizarre behavior when replacing the line, e.g. with ^U) started bothering me enough that I did this: % otool -L /Library/Python/2.5/site-packages/readline.so /Library/Python/2.5/site-packages/readline.so: /opt/local/lib/libreadline.5.2.dylib (compatibility version 5.0.0, current version 5.2.0) /opt/local/lib/libncurses.5.dylib (compatibility version 5.0.0, current version 5.0.0) /usr/lib/libgcc_s.1.dylib (compatibility version 1.0.0, current version 1.0.0) /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 111.0.0) but I can't figure out how to get this version of readline to replace the bundled one. I put readline.so into ipython-0.8.1-py2.5.egg, which works for IPython, but is there a nicer way to do so in general than simply overwriting it in /System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/lib-dynload? Thanks, -- Nicholas Riley | From ronaldoussoren at mac.com Wed Nov 21 17:02:57 2007 From: ronaldoussoren at mac.com (Ronald Oussoren) Date: Wed, 21 Nov 2007 08:02:57 -0800 Subject: [Pythonmac-SIG] readline support for OS X Leopard In-Reply-To: <20071121153202.GA55695@uiuc.edu> References: <18204.40785.14763.936771@montanaro.dyndns.org> <20071121153202.GA55695@uiuc.edu> Message-ID: <78C6045F-0116-1000-9101-6B926F992F3B-Webmail-10013@mac.com> On Wednesday, November 21, 2007, at 04:48PM, "Nicholas Riley" wrote: >On Mon, Oct 22, 2007 at 08:02:09AM -0500, skip at pobox.com wrote: >> Just install GNU readline and point the build system at it. For example, I >> have MacPorts (http://www.macports.org/) installed in /opt/local. GNU >> readline is installed there, and my readline module is linked against that: > >IPython brokenness (specifically autoindent and bizarre behavior when >replacing the line, e.g. with ^U) started bothering me enough that I >did this: Do you have an ADC account? If so, could you please file a bug at bugreport.apple.com? That way there is at least a small chance that this bug gets fixed in a future release of OSX (and that someone that actually cares about this gets notified when Apple says it has fixed this issue). > >% otool -L /Library/Python/2.5/site-packages/readline.so >/Library/Python/2.5/site-packages/readline.so: > /opt/local/lib/libreadline.5.2.dylib (compatibility version 5.0.0, current version 5.2.0) > /opt/local/lib/libncurses.5.dylib (compatibility version 5.0.0, current version 5.0.0) > /usr/lib/libgcc_s.1.dylib (compatibility version 1.0.0, current version 1.0.0) > /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 111.0.0) > >but I can't figure out how to get this version of readline to replace >the bundled one. I put readline.so into ipython-0.8.1-py2.5.egg, >which works for IPython, but is there a nicer way to do so in general >than simply overwriting it in >/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/lib-dynload? If you install your version of readline as an egg (through setuptools) it will be earlier in sys.path than the system version of readline. Alternatively you can use a pth-file that inserts the directory with your copy of readline.so early in sys.path. Ronald From hengist.podd at virgin.net Wed Nov 21 17:58:15 2007 From: hengist.podd at virgin.net (has) Date: Wed, 21 Nov 2007 16:58:15 +0000 Subject: [Pythonmac-SIG] appscript create new iphoto album In-Reply-To: References: Message-ID: <5A163413-ECAB-456D-857F-BE8310CEB9F0@virgin.net> David Voswinkel wrote: > try to create an new iPhoto album, But cant get it working. Is this > a bug? > >> > app('iPhoto').make(new=k.regular_album, with_properties={ k.name : > 'New Album' }) The correct syntax would be: app('iPhoto').make( new=k.album, at=app.albums.end, # 'at' parameter should be optional here with_properties={ k.name : 'New Album', k.type : k.regular_album }) or: tell app "iPhoto" to make new (album) at end of albums ? with properties {name:"New Album", type:regular album} but that doesn't work on account of iPhoto's persistently shoddy scripting implementation which, disappointingly, is still a mess in the latest iPhoto 7.1.1. You have to use its weird, non-standard 'new album' command (which returns a broken reference, btw, so don't use that): app('iPhoto').new_album(name='New Album') http://bugreport.apple.com if you'd like to file a report or three. HTH has -- http://appscript.sourceforge.net http://rb-appscript.rubyforge.org From ronaldoussoren at mac.com Wed Nov 21 20:59:59 2007 From: ronaldoussoren at mac.com (Ronald Oussoren) Date: Wed, 21 Nov 2007 20:59:59 +0100 Subject: [Pythonmac-SIG] does pkg_resources think that "macosx-10.3" is incompatible with 10.5? In-Reply-To: References: Message-ID: <21A62B3A-7B6F-43AE-A3DD-03459DA637AB@mac.com> On 20 Nov, 2007, at 20:53, zooko wrote: > Folks: > > It appears that eggs built on Mac OS 10.4 are produced with filenames > containing "macosx-10.3", like this: > > http://pypi.python.org/packages/2.5/s/simplejson/simplejson-1.7.3- > py2.5-macosx-10.3-fat.egg > > but that if you try to easy_install such a package on Mac OS 10.5, it > will deem that egg to be incompatible with the current platform and > will instead try to install from a source tarball if it can find > one. (On the other hand if you install that egg on Mac OS 10.4, it > will work.) > > > PJE reports that the platform versioning code for OS X was > contributed by someone other than he to pkg_resources, and that he > doesn't know how it works, except that it reads /usr/bin/sw_vers. > > > Does anyone know if there is a good reason for Python running on 10.5 > to reject binaries built on 10.4, and if not what would be required > to make this version check pass? This seems to be caused by distutils.util.get_platform() returning the wrong value (macosx-10.5-i386 instead of macosx-10.5-fat). This is caused by what seems to be a rather dumb bug in that function: | if (release + '.') < '10.4.' and \ | get_config_vars().get('UNIVERSALSDK', '').strip(): | # The universal build will build fat binaries, but not on | # systems before 10.4 | machine = 'fat' The first part of the test seems wrong to me and causes machine not to be set to 'fat' on 10.5. Ronald -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 2224 bytes Desc: not available Url : http://mail.python.org/pipermail/pythonmac-sig/attachments/20071121/2a3dde48/attachment.bin From ronaldoussoren at mac.com Wed Nov 21 21:11:40 2007 From: ronaldoussoren at mac.com (Ronald Oussoren) Date: Wed, 21 Nov 2007 21:11:40 +0100 Subject: [Pythonmac-SIG] does pkg_resources think that "macosx-10.3" is incompatible with 10.5? In-Reply-To: <21A62B3A-7B6F-43AE-A3DD-03459DA637AB@mac.com> References: <21A62B3A-7B6F-43AE-A3DD-03459DA637AB@mac.com> Message-ID: On 21 Nov, 2007, at 20:59, Ronald Oussoren wrote: >> >> >> Does anyone know if there is a good reason for Python running on 10.5 >> to reject binaries built on 10.4, and if not what would be required >> to make this version check pass? > > This seems to be caused by distutils.util.get_platform() returning > the wrong value (macosx-10.5-i386 instead of macosx-10.5-fat). This > is caused by what seems to be a rather dumb bug in that function: > > | if (release + '.') < '10.4.' and \ > | get_config_vars().get('UNIVERSALSDK', > '').strip(): > | # The universal build will build fat > binaries, but not on > | # systems before 10.4 > | machine = 'fat' > > The first part of the test seems wrong to me and causes machine not > to be set to 'fat' on 10.5. BTW. The first part of the fix is changing '<' to '>=' in the first test. That doesn't fix the issue though, the config/Makefile in Apple's Python.framework isn't configured for building universal binaries. And to make matters even worse: I'm pretty sure that setuptools used to know that 'fat' builds are compatible with 'i386' and 'ppc' architectures (at least on OSX), but that code no longer seems to be there. I'll see if I can check in a fix for the bogus if-statement tomorrow morning (both in the trunk and the 2.5 branch), that way python 2.5.2 will at least behave correctly. I don't know if have time to work on a patch for setuptools though. I'll have to contact PJE about universal builds vs. setuptools anyway (through distutils-sig) to discuss how to deal with 4-way universal eggs. Ronald -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 2224 bytes Desc: not available Url : http://mail.python.org/pipermail/pythonmac-sig/attachments/20071121/673f2dbb/attachment.bin From dwf at cs.toronto.edu Fri Nov 23 04:58:56 2007 From: dwf at cs.toronto.edu (David Warde-Farley) Date: Thu, 22 Nov 2007 22:58:56 -0500 Subject: [Pythonmac-SIG] Any hints on building libpng universal? Message-ID: Hi again, I'm trying to build a universal libpng package at the moment for use with matplotlib from pythonmac.org/packages. There's an older version up on undefined.org that's referred to in some mailing list postings but there've been some major security holes fixed since then, so I've been trying to automate the process of building a gcc complains about the '-M' flag being used with multiple -arch flags, and so I've compiled twice and am stitching them together with lipo. One thing I'm not sure about is the "libpng12.la" file, which I can't seem to combine. I've never been totally clear on the difference between .a and .la archives, but there does seem to be one. Any hints? I will of course post the build script and an URL for the package once I'm sure it works. David From yl5 at bezeqint.net Thu Nov 22 13:12:59 2007 From: yl5 at bezeqint.net (boris) Date: Thu, 22 Nov 2007 14:12:59 +0200 Subject: [Pythonmac-SIG] Discovering file type Message-ID: <000701c82d01$06ceea20$0200000a@borisef02d6474> -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/pythonmac-sig/attachments/20071122/1b661a54/attachment.htm From Jack.Jansen at cwi.nl Fri Nov 23 10:12:08 2007 From: Jack.Jansen at cwi.nl (Jack Jansen) Date: Fri, 23 Nov 2007 10:12:08 +0100 Subject: [Pythonmac-SIG] Any hints on building libpng universal? In-Reply-To: References: Message-ID: On 23-nov-2007, at 4:58, David Warde-Farley wrote: > Hi again, > > I'm trying to build a universal libpng package at the moment for use > with matplotlib from pythonmac.org/packages. There's an older version > up on undefined.org that's referred to in some mailing list postings > but there've been some major security holes fixed since then, so I've > been trying to automate the process of building a > > gcc complains about the '-M' flag being used with multiple -arch > flags, [...] I don't remember what I did to build libpng universal, but problems with '-M' are usually solved by adding '--disable-dependency- tracking' to the configure command. -- 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 hraban at fiee.net Sat Nov 24 21:58:17 2007 From: hraban at fiee.net (Henning Hraban Ramm) Date: Sat, 24 Nov 2007 21:58:17 +0100 Subject: [Pythonmac-SIG] Discovering file type In-Reply-To: <000701c82d01$06ceea20$0200000a@borisef02d6474> References: <000701c82d01$06ceea20$0200000a@borisef02d6474> Message-ID: Am 2007-11-22 um 13:12 schrieb boris: (not much) http://api.plone.org/Archetypes/1.3.10/public/MimetypesRegistry/ MimetypesRegistry.mime_types.magic-module.html https://svn.plone.org/svn/archetypes/MimetypesRegistry/trunk/mime_types/ old: http://py.vaults.ca/apyllo.py/514463245.39015704.74680726 Greetlings from Lake Constance! Hraban --- http://www.fiee.net https://www.cacert.org (I'm an assurer) From Mathew.Oakes at aad.gov.au Mon Nov 26 04:44:33 2007 From: Mathew.Oakes at aad.gov.au (Mathew Oakes) Date: Mon, 26 Nov 2007 14:44:33 +1100 Subject: [Pythonmac-SIG] Unknown load command while building app bundle[Sec=Unclassified] Message-ID: <3ED75A49-5079-41D0-89A6-03E2BEB8DC60@aad.gov.au> alias build works when copying stuff into app bundle get this error, cant find any similar references, help appreciated! Using 10.5 copying /Library/Frameworks/Python.framework/Versions/2.5/Resources/ version.plist -> /Users/mathew_oak/Documents/ThumbMaker/dist/ working001.app/Contents/Frameworks/Python.framework/Versions/2.5/ Resources 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-fat/egg/macholib/MachOStandalone.py", line 102, in run mm.run_file(fn) File "build/bdist.macosx-10.3-fat/egg/macholib/MachOGraph.py", line 66, in run_file m = self.createNode(MachO, pathname) File "build/bdist.macosx-10.3-fat/egg/macholib/MachOStandalone.py", line 23, in createNode res = super(FilteredMachOGraph, self).createNode(cls, name) File "build/bdist.macosx-10.3-fat/egg/altgraph/ObjectGraph.py", line 148, in createNode m = cls(name, *args, **kw) File "build/bdist.macosx-10.3-fat/egg/macholib/MachO.py", line 61, in __init__ self.load(file(filename, 'rb')) File "build/bdist.macosx-10.3-fat/egg/macholib/MachO.py", line 71, in load self.load_fat(fh) File "build/bdist.macosx-10.3-fat/egg/macholib/MachO.py", line 82, in load_fat self.load_header(fh, arch.offset, arch.size) File "build/bdist.macosx-10.3-fat/egg/macholib/MachO.py", line 106, in load_header hdr = MachOHeader(self, fh, offset, size, magic, hdr, endian) File "build/bdist.macosx-10.3-fat/egg/macholib/MachO.py", line 146, in __init__ self.load(fh) File "build/bdist.macosx-10.3-fat/egg/macholib/MachO.py", line 178, in load raise ValueError("Unknown load command: %d" % (cmd_load.cmd,)) ValueError: Unknown load command: 27 > /Users/mathew_oak/Documents/ThumbMaker/build/bdist.macosx-10.3-fat/ egg/macholib/MachO.py(178)load() (Pdb) (Pdb) interrupted ___________________________________________________________________________ Australian Antarctic Division - Commonwealth of Australia IMPORTANT: This transmission is intended for the addressee only. If you are not the intended recipient, you are notified that use or dissemination of this communication is strictly prohibited by Commonwealth law. If you have received this transmission in error, please notify the sender immediately by e-mail or by telephoning +61 3 6232 3209 and DELETE the message. Visit our web site at http://www.antarctica.gov.au/ ___________________________________________________________________________ From lists at collab.nl Mon Nov 26 05:53:50 2007 From: lists at collab.nl (Thijs Triemstra | Collab) Date: Mon, 26 Nov 2007 05:53:50 +0100 Subject: [Pythonmac-SIG] Unknown load command while building app bundle[Sec=Unclassified] In-Reply-To: <3ED75A49-5079-41D0-89A6-03E2BEB8DC60@aad.gov.au> References: <3ED75A49-5079-41D0-89A6-03E2BEB8DC60@aad.gov.au> Message-ID: <84590D63-A727-425A-84F6-902E604B564C@collab.nl> Hi, you need the svn version of macholib. More info in: http://mail.python.org/pipermail/pythonmac-sig/2007-June/019060.html Thijs On Nov 26, 2007, at 4:44 AM, Mathew Oakes wrote: > alias build works > > when copying stuff into app bundle get this error, cant find any > similar references, help appreciated! > > Using 10.5 > > copying /Library/Frameworks/Python.framework/Versions/2.5/Resources/ > version.plist -> /Users/mathew_oak/Documents/ThumbMaker/dist/ > working001.app/Contents/Frameworks/Python.framework/Versions/2.5/ > Resources > 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-fat/egg/macholib/MachOStandalone.py", > line 102, in run > mm.run_file(fn) > File "build/bdist.macosx-10.3-fat/egg/macholib/MachOGraph.py", line > 66, in run_file > m = self.createNode(MachO, pathname) > File "build/bdist.macosx-10.3-fat/egg/macholib/MachOStandalone.py", > line 23, in createNode > res = super(FilteredMachOGraph, self).createNode(cls, name) > File "build/bdist.macosx-10.3-fat/egg/altgraph/ObjectGraph.py", line > 148, in createNode > m = cls(name, *args, **kw) > File "build/bdist.macosx-10.3-fat/egg/macholib/MachO.py", line 61, > in __init__ > self.load(file(filename, 'rb')) > File "build/bdist.macosx-10.3-fat/egg/macholib/MachO.py", line 71, > in load > self.load_fat(fh) > File "build/bdist.macosx-10.3-fat/egg/macholib/MachO.py", line 82, > in load_fat > self.load_header(fh, arch.offset, arch.size) > File "build/bdist.macosx-10.3-fat/egg/macholib/MachO.py", line 106, > in load_header > hdr = MachOHeader(self, fh, offset, size, magic, hdr, endian) > File "build/bdist.macosx-10.3-fat/egg/macholib/MachO.py", line 146, > in __init__ > self.load(fh) > File "build/bdist.macosx-10.3-fat/egg/macholib/MachO.py", line 178, > in load > raise ValueError("Unknown load command: %d" % (cmd_load.cmd,)) > ValueError: Unknown load command: 27 >> /Users/mathew_oak/Documents/ThumbMaker/build/bdist.macosx-10.3-fat/ > egg/macholib/MachO.py(178)load() > (Pdb) > (Pdb) interrupted > > ______________________________________________________________________ > _____ > > Australian Antarctic Division - Commonwealth of Australia > IMPORTANT: This transmission is intended for the addressee only. If > you are not the > intended recipient, you are notified that use or dissemination of > this communication is > strictly prohibited by Commonwealth law. If you have received this > transmission in error, > please notify the sender immediately by e-mail or by telephoning > +61 3 6232 3209 and > DELETE the message. > Visit our web site at http://www.antarctica.gov.au/ > ______________________________________________________________________ > _____ > _______________________________________________ > Pythonmac-SIG maillist - Pythonmac-SIG at python.org > http://mail.python.org/mailman/listinfo/pythonmac-sig From rowen at cesmail.net Mon Nov 26 19:56:04 2007 From: rowen at cesmail.net (Russell E. Owen) Date: Mon, 26 Nov 2007 10:56:04 -0800 Subject: [Pythonmac-SIG] Any hints on building libpng universal? References: Message-ID: In article , David Warde-Farley wrote: > Hi again, > > I'm trying to build a universal libpng package at the moment for use > with matplotlib from pythonmac.org/packages. There's an older version > up on undefined.org that's referred to in some mailing list postings > but there've been some major security holes fixed since then, so I've > been trying to automate the process of building a > > gcc complains about the '-M' flag being used with multiple -arch > flags, and so I've compiled twice and am stitching them together with > lipo. One thing I'm not sure about is the "libpng12.la" file, which I > can't seem to combine. I've never been totally clear on the difference > between .a and .la archives, but there does seem to be one. > > Any hints? I will of course post the build script and an URL for the > package once I'm sure it works. See which has explicit instructions and a reference to Apple Tech Note TN2137 -- Russell From anmo.kim at gmail.com Mon Nov 26 21:02:46 2007 From: anmo.kim at gmail.com (Anmo Kim) Date: Mon, 26 Nov 2007 15:02:46 -0500 Subject: [Pythonmac-SIG] leopard, cannot locate pyobjc modules Message-ID: Hi all, I recently upgraded my os from tiger to leopard, and got some problems in using pyobjc there. I get the following error when i try "python setup.py install" for any Cocoa application on the example folder. (i.e. from /Developer/Examples/Python/PyObjC/Cocoa/AppKit/CurrencyConverter) [hs10kim4 CurrencyConverter]$ python setup.py install Traceback (most recent call last): File "setup.py", line 8, in import py2app ImportError: No module named py2app I got into problem with other modules, such as objc and foundation. I might have screwed up something when i upgrade my os. I suppose there must be a folder for these lost modules. For example, I can locate "numpy" folder under "/Library/FrameWorks/Python.framework/Versions/2.5/lib/python2.5/site-packages", and if i get rid of it, i cannot import numpy anymore. Could somebody help me to install those lost modules? I would really appreciate all this help. Regards, Anmo From Mathew.Oakes at aad.gov.au Mon Nov 26 23:33:09 2007 From: Mathew.Oakes at aad.gov.au (Mathew Oakes) Date: Tue, 27 Nov 2007 09:33:09 +1100 Subject: [Pythonmac-SIG] svn checkout [Sec=Unclassified] In-Reply-To: <84590D63-A727-425A-84F6-902E604B564C@collab.nl> References: <3ED75A49-5079-41D0-89A6-03E2BEB8DC60@aad.gov.au> <84590D63-A727-425A-84F6-902E604B564C@collab.nl> Message-ID: <4E75E921-3845-4A30-844B-974BF452BAD8@aad.gov.au> Hi really stuck on something simple... tried lots of things but cant connect to do a read-only checkout from the svn server following direction from here and but i'm just stuck now. $ svn checkout http://svn.python.org/projects ~/svnrepo/ svn: PROPFIND request failed on '/projects' svn: PROPFIND of '/projects': could not connect to server (http://svn.python.org ) $ svn checkout http://svn.python.org/projects/macholib ~/svnrepo/ svn: PROPFIND request failed on '/projects/macholib' svn: PROPFIND of '/projects/macholib': could not connect to server (http://svn.python.org ) $svn co http://svn.python.org/projects/python/trunk python-svn svn: PROPFIND request failed on '/projects/python/trunk' svn: PROPFIND of '/projects/python/trunk': could not connect to server (http://svn.python.org) have proxy server configured via HTTP_PROXY environment variable thanks, mat On 26/11/2007, at 3:53 PM, Thijs Triemstra | Collab wrote: > Hi, > > you need the svn version of macholib. More info in: > http://mail.python.org/pipermail/pythonmac-sig/2007-June/019060.html > > Thijs > > On Nov 26, 2007, at 4:44 AM, Mathew Oakes wrote: > >> alias build works >> >> when copying stuff into app bundle get this error, cant find any >> similar references, help appreciated! >> >> Using 10.5 >> >> copying /Library/Frameworks/Python.framework/Versions/2.5/Resources/ >> version.plist -> /Users/mathew_oak/Documents/ThumbMaker/dist/ >> working001.app/Contents/Frameworks/Python.framework/Versions/2.5/ >> Resources >> 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-fat/egg/macholib/MachOStandalone.py", >> line 102, in run >> mm.run_file(fn) >> File "build/bdist.macosx-10.3-fat/egg/macholib/MachOGraph.py", line >> 66, in run_file >> m = self.createNode(MachO, pathname) >> File "build/bdist.macosx-10.3-fat/egg/macholib/MachOStandalone.py", >> line 23, in createNode >> res = super(FilteredMachOGraph, self).createNode(cls, name) >> File "build/bdist.macosx-10.3-fat/egg/altgraph/ObjectGraph.py", line >> 148, in createNode >> m = cls(name, *args, **kw) >> File "build/bdist.macosx-10.3-fat/egg/macholib/MachO.py", line 61, >> in __init__ >> self.load(file(filename, 'rb')) >> File "build/bdist.macosx-10.3-fat/egg/macholib/MachO.py", line 71, >> in load >> self.load_fat(fh) >> File "build/bdist.macosx-10.3-fat/egg/macholib/MachO.py", line 82, >> in load_fat >> self.load_header(fh, arch.offset, arch.size) >> File "build/bdist.macosx-10.3-fat/egg/macholib/MachO.py", line 106, >> in load_header >> hdr = MachOHeader(self, fh, offset, size, magic, hdr, endian) >> File "build/bdist.macosx-10.3-fat/egg/macholib/MachO.py", line 146, >> in __init__ >> self.load(fh) >> File "build/bdist.macosx-10.3-fat/egg/macholib/MachO.py", line 178, >> in load >> raise ValueError("Unknown load command: %d" % (cmd_load.cmd,)) >> ValueError: Unknown load command: 27 >>> /Users/mathew_oak/Documents/ThumbMaker/build/bdist.macosx-10.3-fat/ >> egg/macholib/MachO.py(178)load() >> (Pdb) >> (Pdb) interrupted >> >> ______________________________________________________________________ >> _____ >> >> Australian Antarctic Division - Commonwealth of Australia >> IMPORTANT: This transmission is intended for the addressee only. If >> you are not the >> intended recipient, you are notified that use or dissemination of >> this communication is >> strictly prohibited by Commonwealth law. If you have received this >> transmission in error, >> please notify the sender immediately by e-mail or by telephoning >> +61 3 6232 3209 and >> DELETE the message. >> Visit our web site at http://www.antarctica.gov.au/ >> ______________________________________________________________________ >> _____ >> _______________________________________________ >> Pythonmac-SIG maillist - Pythonmac-SIG at python.org >> http://mail.python.org/mailman/listinfo/pythonmac-sig > > _______________________________________________ > Pythonmac-SIG maillist - Pythonmac-SIG at python.org > http://mail.python.org/mailman/listinfo/pythonmac-sig ___________________________________________________________________________ Australian Antarctic Division - Commonwealth of Australia IMPORTANT: This transmission is intended for the addressee only. If you are not the intended recipient, you are notified that use or dissemination of this communication is strictly prohibited by Commonwealth law. If you have received this transmission in error, please notify the sender immediately by e-mail or by telephoning +61 3 6232 3209 and DELETE the message. Visit our web site at http://www.antarctica.gov.au/ ___________________________________________________________________________ From Chris.Barker at noaa.gov Tue Nov 27 00:08:07 2007 From: Chris.Barker at noaa.gov (Christopher Barker) Date: Mon, 26 Nov 2007 15:08:07 -0800 Subject: [Pythonmac-SIG] Any hints on building libpng universal? In-Reply-To: <93C2603F-5D2C-405A-907F-B13A7DBB8F2D@cs.toronto.edu> References: <474B4884.6080507@noaa.gov> <93C2603F-5D2C-405A-907F-B13A7DBB8F2D@cs.toronto.edu> Message-ID: <474B51D7.5040100@noaa.gov> David Warde-Farley wrote: >> are you building a new MPL for pythonmac? The one there *should* be >> build with a static universal libpng already. > > Alas, it is not. The python2.5 one looks for libpng in /usr/local/lib. aarrgg! that isn't how stuff in that archive is supposed to be built -- does anyone know who submitted that? They should have the lib for you. -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 Tue Nov 27 06:43:26 2007 From: ronaldoussoren at mac.com (Ronald Oussoren) Date: Tue, 27 Nov 2007 06:43:26 +0100 Subject: [Pythonmac-SIG] leopard, cannot locate pyobjc modules In-Reply-To: References: Message-ID: <195AA9D7-2311-4D5C-A18B-7B081835BE00@mac.com> On 26 Nov, 2007, at 21:02, Anmo Kim wrote: > Hi all, > > I recently upgraded my os from tiger to leopard, and got some problems > in using pyobjc there. > > I get the following error when i try "python setup.py install" for any > Cocoa application on the example folder. > (i.e. from /Developer/Examples/Python/PyObjC/Cocoa/AppKit/ > CurrencyConverter) > > [hs10kim4 CurrencyConverter]$ python setup.py install > Traceback (most recent call last): > File "setup.py", line 8, in > import py2app > ImportError: No module named py2app > > I got into problem with other modules, such as objc and foundation. > > I might have screwed up something when i upgrade my os. > > I suppose there must be a folder for these lost modules. > For example, I can locate "numpy" folder under > "/Library/FrameWorks/Python.framework/Versions/2.5/lib/python2.5/ > site-packages", > and if i get rid of it, i cannot import numpy anymore. > > Could somebody help me to install those lost modules? > > I would really appreciate all this help. You have a python interpreter in /Library/Frameworks as well. The developer examples rely on the version of PyObjC that's in Apple's install of python (/usr/bin/python). You can remove /Library/Frameworks/Python.framework, but you will have to reinstall all site-packages that you use. Alternatively you can change your shell profile and remove /Library/Frameworks/ Python.framework/... from the shell variable PATH. Ronald Ronald > > > Regards, > Anmo > _______________________________________________ > 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 : http://mail.python.org/pipermail/pythonmac-sig/attachments/20071127/c870fe2c/attachment.bin From ronaldoussoren at mac.com Tue Nov 27 06:49:21 2007 From: ronaldoussoren at mac.com (Ronald Oussoren) Date: Tue, 27 Nov 2007 06:49:21 +0100 Subject: [Pythonmac-SIG] svn checkout [Sec=Unclassified] In-Reply-To: <4E75E921-3845-4A30-844B-974BF452BAD8@aad.gov.au> References: <3ED75A49-5079-41D0-89A6-03E2BEB8DC60@aad.gov.au> <84590D63-A727-425A-84F6-902E604B564C@collab.nl> <4E75E921-3845-4A30-844B-974BF452BAD8@aad.gov.au> Message-ID: On 26 Nov, 2007, at 23:33, Mathew Oakes wrote: > Hi > > really stuck on something simple... tried lots of things but cant > connect to do a read-only checkout from the svn server > > following direction from here > and > > but i'm just stuck now. > > $ svn checkout http://svn.python.org/projects ~/svnrepo/ > svn: PROPFIND request failed on '/projects' > svn: PROPFIND of '/projects': could not connect to server (http://svn.python.org > ) You don't want to do that anyway, the command you give would have checked out the entire repository, all branches of all projects and that's likely not what you want. http://svn.python.org/projects/python/trunk should be the url for the trunk of Python (the bit that will be Python 2.6 in the future). > > > $ svn checkout http://svn.python.org/projects/macholib ~/svnrepo/ > svn: PROPFIND request failed on '/projects/macholib' > svn: PROPFIND of '/projects/macholib': could not connect to server (http://svn.python.org > ) macholib isn't a python.org project, this will never work. > > > $svn co http://svn.python.org/projects/python/trunk python-svn > svn: PROPFIND request failed on '/projects/python/trunk' > svn: PROPFIND of '/projects/python/trunk': could not connect to server > (http://svn.python.org) This should work. > > > > have proxy server configured via HTTP_PROXY environment variable That could be the problem, svn-over-http uses WebDAV and not all proxies support that. That might explain the PROPFIND problems. Does fetching 'http://svn.python.org/projects/python/trunk/setup.py' work for you when you use curl(1)? Ronald > > > thanks, > mat > > On 26/11/2007, at 3:53 PM, Thijs Triemstra | Collab wrote: > >> Hi, >> >> you need the svn version of macholib. More info in: >> http://mail.python.org/pipermail/pythonmac-sig/2007-June/019060.html >> >> Thijs >> >> On Nov 26, 2007, at 4:44 AM, Mathew Oakes wrote: >> >>> alias build works >>> >>> when copying stuff into app bundle get this error, cant find any >>> similar references, help appreciated! >>> >>> Using 10.5 >>> >>> copying /Library/Frameworks/Python.framework/Versions/2.5/Resources/ >>> version.plist -> /Users/mathew_oak/Documents/ThumbMaker/dist/ >>> working001.app/Contents/Frameworks/Python.framework/Versions/2.5/ >>> Resources >>> 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-fat/egg/macholib/MachOStandalone.py", >>> line 102, in run >>> mm.run_file(fn) >>> File "build/bdist.macosx-10.3-fat/egg/macholib/MachOGraph.py", line >>> 66, in run_file >>> m = self.createNode(MachO, pathname) >>> File "build/bdist.macosx-10.3-fat/egg/macholib/MachOStandalone.py", >>> line 23, in createNode >>> res = super(FilteredMachOGraph, self).createNode(cls, name) >>> File "build/bdist.macosx-10.3-fat/egg/altgraph/ObjectGraph.py", line >>> 148, in createNode >>> m = cls(name, *args, **kw) >>> File "build/bdist.macosx-10.3-fat/egg/macholib/MachO.py", line 61, >>> in __init__ >>> self.load(file(filename, 'rb')) >>> File "build/bdist.macosx-10.3-fat/egg/macholib/MachO.py", line 71, >>> in load >>> self.load_fat(fh) >>> File "build/bdist.macosx-10.3-fat/egg/macholib/MachO.py", line 82, >>> in load_fat >>> self.load_header(fh, arch.offset, arch.size) >>> File "build/bdist.macosx-10.3-fat/egg/macholib/MachO.py", line 106, >>> in load_header >>> hdr = MachOHeader(self, fh, offset, size, magic, hdr, endian) >>> File "build/bdist.macosx-10.3-fat/egg/macholib/MachO.py", line 146, >>> in __init__ >>> self.load(fh) >>> File "build/bdist.macosx-10.3-fat/egg/macholib/MachO.py", line 178, >>> in load >>> raise ValueError("Unknown load command: %d" % (cmd_load.cmd,)) >>> ValueError: Unknown load command: 27 >>>> /Users/mathew_oak/Documents/ThumbMaker/build/bdist.macosx-10.3-fat/ >>> egg/macholib/MachO.py(178)load() >>> (Pdb) >>> (Pdb) interrupted >>> >>> ______________________________________________________________________ >>> _____ >>> >>> Australian Antarctic Division - Commonwealth of Australia >>> IMPORTANT: This transmission is intended for the addressee only. If >>> you are not the >>> intended recipient, you are notified that use or dissemination of >>> this communication is >>> strictly prohibited by Commonwealth law. If you have received this >>> transmission in error, >>> please notify the sender immediately by e-mail or by telephoning >>> +61 3 6232 3209 and >>> DELETE the message. >>> Visit our web site at http://www.antarctica.gov.au/ >>> ______________________________________________________________________ >>> _____ >>> _______________________________________________ >>> Pythonmac-SIG maillist - Pythonmac-SIG at python.org >>> http://mail.python.org/mailman/listinfo/pythonmac-sig >> >> _______________________________________________ >> Pythonmac-SIG maillist - Pythonmac-SIG at python.org >> http://mail.python.org/mailman/listinfo/pythonmac-sig > > > ___________________________________________________________________________ > > Australian Antarctic Division - Commonwealth of Australia > IMPORTANT: This transmission is intended for the addressee only. If > you are not the > intended recipient, you are notified that use or dissemination of > this communication is > strictly prohibited by Commonwealth law. If you have received this > transmission in error, > please notify the sender immediately by e-mail or by telephoning +61 > 3 6232 3209 and > DELETE the message. > Visit our web site at http://www.antarctica.gov.au/ > ___________________________________________________________________________ > _______________________________________________ > Pythonmac-SIG maillist - Pythonmac-SIG at python.org > http://mail.python.org/mailman/listinfo/pythonmac-sig -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 2224 bytes Desc: not available Url : http://mail.python.org/pipermail/pythonmac-sig/attachments/20071127/efb3bf3e/attachment-0001.bin From tuckers4all911 at yahoo.co.uk Tue Nov 27 13:43:41 2007 From: tuckers4all911 at yahoo.co.uk (david odey) Date: Tue, 27 Nov 2007 12:43:41 +0000 (GMT) Subject: [Pythonmac-SIG] hi Message-ID: <156739.53467.qm@web23403.mail.ird.yahoo.com> Please I would love to receive a daily newsletter with simple python codes for beginners; and to progress as time goes. ALWAYS THERE FOR YOU --------------------------------- For ideas on reducing your carbon footprint visit Yahoo! For Good this month. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/pythonmac-sig/attachments/20071127/a40a142b/attachment.htm From jcmendez at alum.mit.edu Tue Nov 27 13:50:39 2007 From: jcmendez at alum.mit.edu (=?ISO-8859-1?Q?Juan_C._M=E9ndez?=) Date: Tue, 27 Nov 2007 07:50:39 -0500 Subject: [Pythonmac-SIG] Problem (and workaround) with XCode and Python projects - non ascii characters in user's name Message-ID: <48a27ed0711270450i6eabd0dcjb7ee6b2bd0935a5d@mail.gmail.com> When a new project is created, XCode takes the user name and pre-fills the headers of the source files. In Python projects, this creates a problem if the user's name has non ascii characters (like accents). The problem is that the application builds and fails with these messages like the ones below in the console. 11/18/07 12:10:36 AM kkpycd[33468] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: '/Users/jcmendez/kkpycd/main.m:44 main() PyRun_SimpleFile failed with file '/Users/jcmendez/kkpycd/build/Release/kkpycd.app/Contents/Resources/main.py'. See console for errors.' 11/18/07 12:10:36 AM kkpycd[33468] Stack: ( 2490802795, 2487529627, 2490802251, 2490802314 ) Tracking the problem it's possible to see that: 11/18/07 12:11:11 AM [0x0-0xb40b4].com.yourcompany.kkpy2[95313] SyntaxError: Non-ASCII character '\x8e' in file /Users/jcmendez/kkpy2/build/Release/kkpy2.app/Contents/Resources/kkpy2AppDelegate.py on line 5, but no encoding declared; see http://www.python.org/peps/pep-0263.html for details Not a big deal, but may deter many Python folks from writing Cocoa apps. Already filed a bug report with Apple, but thought it may be interesting to post in this list as well. Juan C. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/pythonmac-sig/attachments/20071127/1c372ffc/attachment.htm From dwf at cs.toronto.edu Wed Nov 28 00:11:14 2007 From: dwf at cs.toronto.edu (David Warde-Farley) Date: Tue, 27 Nov 2007 18:11:14 -0500 Subject: [Pythonmac-SIG] Fw: Re: Any hints on building libpng universal? References: <474B51D7.5040100@noaa.gov> Message-ID: <1196205076.1F25393F@bc12.dngr.org> Chris Barker brought it to my attention that packages that go bup on Pythonmac.org should have their own static copies of (non system?) dependencies. The current matplotlib package expects libpng in /usr/local/lib. If someone can give me a very basic rundown of how this is done I'd be happy to submit a fixed package. DWF From Chris.Barker at noaa.gov Wed Nov 28 01:34:07 2007 From: Chris.Barker at noaa.gov (Christopher Barker) Date: Tue, 27 Nov 2007 16:34:07 -0800 Subject: [Pythonmac-SIG] Fw: Re: Any hints on building libpng universal? In-Reply-To: <1196205076.1F25393F@bc12.dngr.org> References: <474B51D7.5040100@noaa.gov> <1196205076.1F25393F@bc12.dngr.org> Message-ID: <474CB77F.9010003@noaa.gov> David Warde-Farley wrote: > Chris Barker brought it to my attention that packages that go bup on > Pythonmac.org should have their own static copies of (non system?) > dependencies. That's right. I think libpng and libfreetype are the ones required at this point. > The current matplotlib package expects libpng in > /usr/local/lib. is it dependent on the freetype in Apple's X11? I have a build installed that is, though I'm not totally sure where I got it. Didn't Russell Owen point you to directions? Here they are again: http://www.astro.washington.edu/rowen/BuildingMatplotlibForMac.html The only problem with those is that it required deleting the dylib, but if you have other apps that depend on it, you won't want to do that. At some point, I has set up my system with a "StaticLibs Dir" in the MPL source, and edited the setup.py to find stuff there. Should I dig this up and contribute it? -Chris -- Christopher Barker, Ph.D. Oceanographer Emergency Response Division NOAA/NOS/OR&R (206) 526-6959 voice 7600 Sand Point Way NE (206) 526-6329 fax Seattle, WA 98115 (206) 526-6317 main reception Chris.Barker at noaa.gov From rowen at cesmail.net Wed Nov 28 01:36:22 2007 From: rowen at cesmail.net (Russell E. Owen) Date: Tue, 27 Nov 2007 16:36:22 -0800 Subject: [Pythonmac-SIG] Any hints on building libpng universal? References: <474B4884.6080507@noaa.gov> <93C2603F-5D2C-405A-907F-B13A7DBB8F2D@cs.toronto.edu> <474B51D7.5040100@noaa.gov> Message-ID: In article <474B51D7.5040100 at noaa.gov>, Christopher Barker wrote: > David Warde-Farley wrote: > >> are you building a new MPL for pythonmac? The one there *should* be > >> build with a static universal libpng already. > > > > Alas, it is not. The python2.5 one looks for libpng in /usr/local/lib. > > aarrgg! that isn't how stuff in that archive is supposed to be built -- > does anyone know who submitted that? They should have the lib for you. It was probably me but if so I am surprised. I don't have shared version of libpng (nor libfreetype (see P.S.). I just verified that and built a new matplotlib installer. You can get it here: and I'll submit the installer after confirmation that the shared library issue is resolved. -- Russell P.S. % ls -l /usr/local/lib/*png* /usr/local/lib/*free* -rw-r--r-- 1 root 501 4258580 Oct 16 13:30 /usr/local/lib/libfreetype.a -rwxr-xr-x 1 root 501 838 Oct 16 13:30 /usr/local/lib/libfreetype.la lrwxr-xr-x 1 root 501 10 Oct 16 13:23 /usr/local/lib/libpng.a -> libpng12.a lrwxr-xr-x 1 root 501 11 Oct 16 13:23 /usr/local/lib/libpng.la -> libpng12.la -rw-r--r-- 1 root 501 1068644 Oct 16 13:23 /usr/local/lib/libpng12.a -rwxr-xr-x 1 root 501 818 Oct 16 13:23 /usr/local/lib/libpng12.la From fiee.visuelle at gmail.com Tue Nov 27 23:16:55 2007 From: fiee.visuelle at gmail.com (Henning Hraban Ramm) Date: Tue, 27 Nov 2007 23:16:55 +0100 Subject: [Pythonmac-SIG] Problem (and workaround) with XCode and Python projects - non ascii characters in user's name In-Reply-To: <48a27ed0711270450i6eabd0dcjb7ee6b2bd0935a5d@mail.gmail.com> References: <48a27ed0711270450i6eabd0dcjb7ee6b2bd0935a5d@mail.gmail.com> Message-ID: <96240D8E-6B47-46BD-ABE1-DED4AC57E01F@gmail.com> Am 2007-11-27 um 13:50 schrieb Juan C. M?ndez: > When a new project is created, XCode takes the user name and pre- > fills the headers of the source files. In Python projects, this > creates a problem if the user's name has non ascii characters (like > accents). The problem is that the application builds and fails with > these messages like the ones below in the console. 11/18/07 > 12:10:36 AM kkpycd[33468] *** Terminating app due to uncaught > exception 'NSInternalInconsistencyException', reason: '/Users/ > jcmendez/kkpycd/main.m:44 main() PyRun_SimpleFile failed with file > '/Users/jcmendez/kkpycd/build/Release/kkpycd.app/Contents/Resources/ > main.py'. See console for errors.' 11/18/07 12:10:36 AM kkpycd > [33468] Stack: ( 2490802795, 2487529627, 2490802251, 2490802314 ) > Tracking the problem it's possible to see that: 11/18/07 12:11:11 > AM [0x0-0xb40b4].com.yourcompany.kkpy2[95313] SyntaxError: Non- > ASCII character '\x8e' in file /Users/jcmendez/kkpy2/build/Release/ > kkpy2.app/Contents/Resources/kkpy2AppDelegate.py on line 5, but no > encoding declared; see http://www.python.org/peps/pep-0263.html for > details Not a big deal, but may deter many Python folks from > writing Cocoa apps. Already filed a bug report with Apple, but > thought it may be interesting to post in this list as well. I guess the right coding line will help, e.g. # -*- coding: utf-8 -*- Greetlings from Lake Constance! Hraban --- http://www.fiee.net https://www.cacert.org (I'm an assurer) From jcmendez at alum.mit.edu Wed Nov 28 15:25:07 2007 From: jcmendez at alum.mit.edu (=?ISO-8859-1?Q?Juan_C._M=E9ndez?=) Date: Wed, 28 Nov 2007 09:25:07 -0500 Subject: [Pythonmac-SIG] Problem (and workaround) with XCode and Python projects - non ascii characters in user's name Message-ID: <48a27ed0711280625k251e9628pe3d74cae91c9049e@mail.gmail.com> Hraban - Sure, that fixes the problem right away... sorry I mentioned the workaround in the title, but didn't write what the workaround was. However Apple needs to fix the template, since someone that just starts using XCode may be thrown off by the cryptic message *** Terminating app due to uncaught exception 'NSInternalInconsistencyException' Only if you are comfortable with the development environment you'll be able to drill down and find the source of the problem. The Apple Bug ID is 5607184 > > I guess the right coding line will help, e.g. > # -*- coding: utf-8 -*- > > Greetlings from Lake Constance! > Hraban > --- -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/pythonmac-sig/attachments/20071128/910cc157/attachment.htm From david at optixx.org Wed Nov 28 20:00:03 2007 From: david at optixx.org (David Voswinkel) Date: Wed, 28 Nov 2007 20:00:03 +0100 Subject: [Pythonmac-SIG] appscript create new iphoto album In-Reply-To: <5A163413-ECAB-456D-857F-BE8310CEB9F0@virgin.net> References: <5A163413-ECAB-456D-857F-BE8310CEB9F0@virgin.net> Message-ID: <200711282000.04169.david@optixx.org> > You have to use its weird, non-standard 'new album' command (which > returns a broken reference, btw, so don't use that): > > app('iPhoto').new_album(name='New Album') Thx for that tip. But now iam stuck with the task to add a photo to a referenced album. I tried all kinds of app.add or app.make variations. But i end up, getting no reference back and no photo added or raising an Error 1700 / 1701. appscript.reference.CommandError: CommandError -1700: Can't make some data into the expected type. Failed command: app(u'/Applications/iPhoto.app').make(new=k.photo, with_properties={k.class_: k.photo, k.image_path: mactypes.Alias(u'/Users/david/Desktop/20071127_Misc/IMG_0299.JPG')}) or: appscript.reference.CommandError: CommandError -1700: Can't make some data into the expected type. Failed command: app(u'/Applications/iPhoto.app').make(new=k.photo, with_properties={k.class_: k.photo, k.image_path: u'/Users/david/Desktop/20071127_Misc/IMG_0299.JPG'}) or: ref = iphoto.add(file, to=album) if ref is None: raise Is there a special hack to get a photo added ? Regards David From Mathew.Oakes at aad.gov.au Thu Nov 29 22:51:39 2007 From: Mathew.Oakes at aad.gov.au (Mathew Oakes) Date: Fri, 30 Nov 2007 08:51:39 +1100 Subject: [Pythonmac-SIG] Unknown load command while building app bundle[Sec=Unclassified] References: <84590D63-A727-425A-84F6-902E604B564C@collab.nl> Message-ID: hi, I keep getting load errors on macholib with wx2.8... have installed the svn version of macholib (got it with wget as I cannot do svn through the proxies here) so the build progressed quite a bit further and then stopped (see below) help appreciated thanks, mat copying /opt/wx/2.8/lib/libwx_macud-2.8.0.dylib -> /Users/mathew_oak/ Documents/ThumbMaker/dist/Image Resizer.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-fat/egg/macholib/MachOStandalone.py", line 102, in run mm.run_file(fn) File "build/bdist.macosx-10.3-fat/egg/macholib/MachOGraph.py", line 68, in run_file self.scan_node(m) File "build/bdist.macosx-10.3-fat/egg/macholib/MachOGraph.py", line 91, in scan_node m = self.load_file(filename, caller=node) File "build/bdist.macosx-10.3-fat/egg/macholib/MachOGraph.py", line 78, in load_file return self.load_file(newname, caller=caller) File "build/bdist.macosx-10.3-fat/egg/macholib/MachOGraph.py", line 80, in load_file m = self.createNode(MachO, name) File "build/bdist.macosx-10.3-fat/egg/macholib/MachOStandalone.py", line 23, in createNode res = super(FilteredMachOGraph, self).createNode(cls, name) File "build/bdist.macosx-10.3-fat/egg/altgraph/ObjectGraph.py", line 148, in createNode m = cls(name, *args, **kw) File "build/bdist.macosx-10.3-fat/egg/macholib/MachO.py", line 61, in __init__ self.load(file(filename, 'rb')) File "build/bdist.macosx-10.3-fat/egg/macholib/MachO.py", line 76, in load self.load_header(fh, 0, size) File "build/bdist.macosx-10.3-fat/egg/macholib/MachO.py", line 106, in load_header hdr = MachOHeader(self, fh, offset, size, magic, hdr, endian) File "build/bdist.macosx-10.3-fat/egg/macholib/MachO.py", line 146, in __init__ self.load(fh) File "build/bdist.macosx-10.3-fat/egg/macholib/MachO.py", line 178, in load raise ValueError("Unknown load command: %d" % (cmd_load.cmd,)) ValueError: Unknown load command: 30 > /Users/mathew_oak/Documents/ThumbMaker/build/bdist.macosx-10.3-fat/ egg/macholib/MachO.py(178)load() (Pdb) Begin forwarded message: > From: Thijs Triemstra | Collab > Date: 26 November 2007 3:53:50 PM > To: pythonmac-sig at python.org > Subject: Re: [Pythonmac-SIG] Unknown load command while building app > bundle[Sec=Unclassified] > > Hi, > > you need the svn version of macholib. More info in: > http://mail.python.org/pipermail/pythonmac-sig/2007-June/019060.html > > Thijs > > On Nov 26, 2007, at 4:44 AM, Mathew Oakes wrote: > >> alias build works >> >> when copying stuff into app bundle get this error, cant find any >> similar references, help appreciated! >> >> Using 10.5 >> >> copying /Library/Frameworks/Python.framework/Versions/2.5/Resources/ >> version.plist -> /Users/mathew_oak/Documents/ThumbMaker/dist/ >> working001.app/Contents/Frameworks/Python.framework/Versions/2.5/ >> Resources >> 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-fat/egg/macholib/MachOStandalone.py", >> line 102, in run >> mm.run_file(fn) >> File "build/bdist.macosx-10.3-fat/egg/macholib/MachOGraph.py", line >> 66, in run_file >> m = self.createNode(MachO, pathname) >> File "build/bdist.macosx-10.3-fat/egg/macholib/MachOStandalone.py", >> line 23, in createNode >> res = super(FilteredMachOGraph, self).createNode(cls, name) >> File "build/bdist.macosx-10.3-fat/egg/altgraph/ObjectGraph.py", line >> 148, in createNode >> m = cls(name, *args, **kw) >> File "build/bdist.macosx-10.3-fat/egg/macholib/MachO.py", line 61, >> in __init__ >> self.load(file(filename, 'rb')) >> File "build/bdist.macosx-10.3-fat/egg/macholib/MachO.py", line 71, >> in load >> self.load_fat(fh) >> File "build/bdist.macosx-10.3-fat/egg/macholib/MachO.py", line 82, >> in load_fat >> self.load_header(fh, arch.offset, arch.size) >> File "build/bdist.macosx-10.3-fat/egg/macholib/MachO.py", line 106, >> in load_header >> hdr = MachOHeader(self, fh, offset, size, magic, hdr, endian) >> File "build/bdist.macosx-10.3-fat/egg/macholib/MachO.py", line 146, >> in __init__ >> self.load(fh) >> File "build/bdist.macosx-10.3-fat/egg/macholib/MachO.py", line 178, >> in load >> raise ValueError("Unknown load command: %d" % (cmd_load.cmd,)) >> ValueError: Unknown load command: 27 >>> /Users/mathew_oak/Documents/ThumbMaker/build/bdist.macosx-10.3-fat/ >> egg/macholib/MachO.py(178)load() >> (Pdb) >> (Pdb) interrupted >> >> ___________________________________________________________________________ Australian Antarctic Division - Commonwealth of Australia IMPORTANT: This transmission is intended for the addressee only. If you are not the intended recipient, you are notified that use or dissemination of this communication is strictly prohibited by Commonwealth law. If you have received this transmission in error, please notify the sender immediately by e-mail or by telephoning +61 3 6232 3209 and DELETE the message. Visit our web site at http://www.antarctica.gov.au/ ___________________________________________________________________________ -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/pythonmac-sig/attachments/20071130/4de685df/attachment.htm