From spam.wax at gmail.com Wed Jul 6 01:58:55 2011 From: spam.wax at gmail.com (Hamid M.) Date: Tue, 5 Jul 2011 19:58:55 -0400 Subject: [Pythonmac-SIG] py2app: calling from Matlab and DYLD path problem Message-ID: Hello everyone I used py2app on a script that uses Qt and VTK libraries. For this to work, I had to edit __boot__.py within bundle to manually insert Contents/Resources/lib/python2.6/lib-dynload to 'sys' path, otherwise the application would complain that it couldn't find one of the .dyld files although it was in 'lib-dynload' folder! (I followed the tutorial and I didn't modify setup.py at all) I can now launch and use the application. However when I call this application from within Matlab using 'system' calls, it seems that the executable falls back on using the dynamic libraries that comes with Matlab rather than using the ones in bundle! So I tried to unset the DYLD_LIBRARY_PATH variable before calling my app in order to remove Matlab's library paths, and that didn't help. I have tried calling my application using both of these from Matlab command prompt: >> system('unset DYLD_LIBRARY_PATH; open -a /path/to/nirviz.app') and >> system('unset DYLD_LIBRARY_PATH; /path/to/nirviz.app/Contents/MacOS/nirviz') I was wondering if you guys could help me with this, any hint is appreciated. thanks in advance, Hamid G From JSkibbie at schawk.com Wed Jul 13 04:00:32 2011 From: JSkibbie at schawk.com (Jim Skibbie) Date: Wed, 13 Jul 2011 02:00:32 +0000 Subject: [Pythonmac-SIG] Converting python for CoreGraphics Message-ID: I have a python script that takes a PDF file and returns the width and height of the document's first page. When I moved this to Snow Leopard, I have to run this in 32-bit mode or I can an error: File "/BinaryCache/CoreGraphicsBindings/CoreGraphicsBindings-26~139/Root/System/Library/Frameworks/Python.framework/Versions/2.6/Extras/lib/python/CoreGraphics/__init__.py", line 7, in ImportError: /System/Library/Frameworks/Python.framework/Versions/2.6/Extras/lib/python/CoreGraphics/_CoreGraphics.so: no appropriate 64-bit architecture Googling around, I find that CoreGraphics is no longer bound to python in Snow Leopard and that it will eventually need to be converted to PyObjC. Can anyone point me in a direction on where I might find some information on how to do this kind of porting? The existing script is below: # step 1: import the required modules import os, sys from CoreGraphics import * if len( sys.argv ) != 2: print "ERROR: useage: python example2.py pdf_filename" sys.exit(1) # step 2: read the pdf file name from the command line arguments pdf_filename = sys.argv[1] pdf_name, ext = os.path.splitext( pdf_filename ) # step 3: create the input PDF document provider = CGDataProviderCreateWithFilename( pdf_filename ) pdf = CGPDFDocumentCreateWithProvider( provider ) if pdf is None: print "ERROR reading PDF document - \r\n check that the supplied filename points to a PDF file" sys.exit(1) page_number = 1 #page_rect = pdf.getMediaBox( page_number ) page_rect = pdf.getPage(page_number).getBoxRect(page_number) page_width = float(page_rect.getWidth()) page_height = float(page_rect.getHeight()) print "%f\r\n%f" % (page_width, page_height) Thanks. Jim -------------- next part -------------- An HTML attachment was scrubbed... URL: From georges.arsouze at gmail.com Thu Jul 14 21:27:28 2011 From: georges.arsouze at gmail.com (Georges Arsouze) Date: Thu, 14 Jul 2011 21:27:28 +0200 Subject: [Pythonmac-SIG] help Message-ID: Hi sorry for my poor english I'am working on mac os 10.6.1 with Python 3.1 I have wish 8.6 on my computer I want to use ttk widgets or tix widgets when i do import tkinter >>> tkinter._test() i obtain this is a tcl/tk version 8.4 on tk docs i see i must have a tcl/tk version 8.5 what can i do ? i try python 3.2 from activestate when i do import tkinter >>> tkinter._test() i obtain this is a tcl/tk version 8.5 but i have a trash with idle what can i do ? can you explain me step by step what i must do regards -------------- next part -------------- An HTML attachment was scrubbed... URL: From ronaldoussoren at mac.com Fri Jul 15 10:55:04 2011 From: ronaldoussoren at mac.com (Ronald Oussoren) Date: Fri, 15 Jul 2011 10:55:04 +0200 Subject: [Pythonmac-SIG] Converting python for CoreGraphics In-Reply-To: References: Message-ID: On 13 Jul, 2011, at 4:00, Jim Skibbie wrote: > I have a python script that takes a PDF file and returns the width and height of the document's first page. When I moved this to Snow Leopard, I have to run this in 32-bit mode or I can an error: > File "/BinaryCache/CoreGraphicsBindings/CoreGraphicsBindings-26~139/Root/System/Library/Frameworks/Python.framework/Versions/2.6/Extras/lib/python/CoreGraphics/__init__.py", line 7, in > ImportError: /System/Library/Frameworks/Python.framework/Versions/2.6/Extras/lib/python/CoreGraphics/_CoreGraphics.so: no appropriate 64-bit architecture > Googling around, I find that CoreGraphics is no longer bound to python in Snow Leopard and that it will eventually need to be converted to PyObjC. > Can anyone point me in a direction on where I might find some information on how to do this kind of porting? The Quartz APIs are available through pyobjc (using "import Quartz"). IIIRC the CoreGraphics module contains an OO-ish interface, the Quartz module is just a straightforward mapping of the C API, which means you have to call global functions instead of methods on objects. One thing you will probably run into is functions that aren't avaiable in the Quartz package: the CoreGraphics module contains a number of functions that aren't wrappers for functions in the public C API of the CoreGraphics framework, and those functions are therefore not available in the Quartz . Ronald > The existing script is below: > # step 1: import the required modules > import os, sys > from CoreGraphics import * > > if len( sys.argv ) != 2: > print "ERROR: useage: python example2.py pdf_filename" > sys.exit(1) > > # step 2: read the pdf file name from the command line arguments > pdf_filename = sys.argv[1] > pdf_name, ext = os.path.splitext( pdf_filename ) > > # step 3: create the input PDF document > provider = CGDataProviderCreateWithFilename( pdf_filename ) > pdf = CGPDFDocumentCreateWithProvider( provider ) > if pdf is None: > print "ERROR reading PDF document - \r\n check that the supplied filename points to a PDF file" > sys.exit(1) > > page_number = 1 > > #page_rect = pdf.getMediaBox( page_number ) > > page_rect = pdf.getPage(page_number).getBoxRect(page_number) > > page_width = float(page_rect.getWidth()) > page_height = float(page_rect.getHeight()) > > print "%f\r\n%f" % (page_width, page_height) > > Thanks. > Jim > _______________________________________________ > Pythonmac-SIG maillist - Pythonmac-SIG at python.org > http://mail.python.org/mailman/listinfo/pythonmac-sig > unsubscribe: http://mail.python.org/mailman/options/Pythonmac-SIG -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 2224 bytes Desc: not available URL: From dan at rosspixelworks.com Fri Jul 15 18:17:42 2011 From: dan at rosspixelworks.com (Dan Ross) Date: Fri, 15 Jul 2011 11:17:42 -0500 Subject: [Pythonmac-SIG] Progressbar in tkinter app Message-ID: <0f493579c509ef33cb1bd517072d50fc@rosspixelworks.com> I'm working on a tkinter gui for an app I made. I can't seem to get a progressbar to start and stop while a function runs. (pseduo-code) def my_function(): progress_bar.start() ##### do a bunch of stuff ##### progress_bar.stop() That should work shouldn't it? Or do I need a separate thread? Thanks all, Dan From half.italian at gmail.com Fri Jul 15 19:20:44 2011 From: half.italian at gmail.com (Sean DiZazzo) Date: Fri, 15 Jul 2011 10:20:44 -0700 Subject: [Pythonmac-SIG] Progressbar in tkinter app In-Reply-To: <0f493579c509ef33cb1bd517072d50fc@rosspixelworks.com> References: <0f493579c509ef33cb1bd517072d50fc@rosspixelworks.com> Message-ID: You need a separate thread. Well, you might be able to get the progressbar to update, but your app will be unresponsive until the task finishes. Here's the article I used to learn: http://uucode.com/texts/pylongopgui/pyguiapp.html It's a little overly complicated but works very well. ~Sean On Fri, Jul 15, 2011 at 9:17 AM, Dan Ross wrote: > I'm working on a tkinter gui for an app I made. > > I can't seem to get a progressbar to start and stop while a function runs. > > (pseduo-code) > > def my_function(): > progress_bar.start() > ##### do a bunch of stuff ##### > progress_bar.stop() > > That should work shouldn't it? Or do I need a separate thread? > > Thanks all, > > Dan > > > ______________________________**_________________ > Pythonmac-SIG maillist - Pythonmac-SIG at python.org > http://mail.python.org/**mailman/listinfo/pythonmac-sig > unsubscribe: http://mail.python.org/**mailman/options/Pythonmac-SIG > -------------- next part -------------- An HTML attachment was scrubbed... URL: From dan at rosspixelworks.com Fri Jul 15 19:53:06 2011 From: dan at rosspixelworks.com (Dan Ross) Date: Fri, 15 Jul 2011 12:53:06 -0500 Subject: [Pythonmac-SIG] Progressbar in tkinter app In-Reply-To: References: <0f493579c509ef33cb1bd517072d50fc@rosspixelworks.com> Message-ID: <8c5514a145be59b4056592e5f494b218@rosspixelworks.com> Really? All that just to make a progress bar go and update something in the main GUI window? Yeesh. On Fri, 15 Jul 2011 10:20:44 -0700, Sean DiZazzo wrote: > You need a separate thread. ?Well, you might be able to get the > progressbar to update, but your app will be unresponsive until the > task finishes. > > Here's the article I used to > learn:?http://uucode.com/texts/pylongopgui/pyguiapp.html [4] > > It's a little overly complicated but works very well. > > ~Sean > > On Fri, Jul 15, 2011 at 9:17 AM, Dan Ross wrote: > >> I'm working on a tkinter gui for an app I made. >> >> I can't seem to get a progressbar to start and stop while a >> function runs. >> >> (pseduo-code) >> >> def my_function(): >> ? ?progress_bar.start() >> ? ?##### do a bunch of stuff ##### >> ? ?progress_bar.stop() >> >> That should work shouldn't it? Or do I need a separate thread? >> >> Thanks all, >> >> Dan >> >> _______________________________________________ >> Pythonmac-SIG maillist ?- ?Pythonmac-SIG at python.org [1] >> http://mail.python.org/mailman/listinfo/pythonmac-sig [2] >> unsubscribe: http://mail.python.org/mailman/options/Pythonmac-SIG >> [3] > > > > Links: > ------ > [1] mailto:Pythonmac-SIG at python.org > [2] http://mail.python.org/mailman/listinfo/pythonmac-sig > [3] http://mail.python.org/mailman/options/Pythonmac-SIG > [4] http://uucode.com/texts/pylongopgui/pyguiapp.html > [5] mailto:dan at rosspixelworks.com From aahz at pythoncraft.com Fri Jul 15 21:09:30 2011 From: aahz at pythoncraft.com (Aahz) Date: Fri, 15 Jul 2011 12:09:30 -0700 Subject: [Pythonmac-SIG] Progressbar in tkinter app In-Reply-To: <0f493579c509ef33cb1bd517072d50fc@rosspixelworks.com> References: <0f493579c509ef33cb1bd517072d50fc@rosspixelworks.com> Message-ID: <20110715190929.GA24520@panix.com> On Fri, Jul 15, 2011, Dan Ross wrote: > > I'm working on a tkinter gui for an app I made. > > I can't seem to get a progressbar to start and stop while a function > runs. http://pythoncraft.com/OSCON2001/FibThreaded.py -- Aahz (aahz at pythoncraft.com) <*> http://www.pythoncraft.com/ "If you don't know what your program is supposed to do, you'd better not start writing it." --Dijkstra From vinay_sajip at yahoo.co.uk Mon Jul 18 19:15:08 2011 From: vinay_sajip at yahoo.co.uk (Vinay Sajip) Date: Mon, 18 Jul 2011 17:15:08 +0000 (UTC) Subject: [Pythonmac-SIG] Python virtual environments on OS X Message-ID: I'm working on pythonv[1], a branch which aims to bring virtual environment creation functionality into Python itself (work on a PEP is in progress). I've got a prototype working quite well on Linux and Windows [2], but not yet done any work on OS X. The basic approach used is that the Python start up code (in getpath.c) looks at sys.executable and then for a configuration file env.cfg either in the executable's directory or one level up, and then for a line in env.cfg of the type home = /path/to/python If the file with that name and line are found, the home value sets sys.prefix and sys.exec_prefix, and then later on, code in site.py sets up the virtual environment. Because of the use of sys.executable, at present pythonv makes a copy of the executable (and, on Windows, all DLLs) in the environment's binaries folder. My question is, will this approach work on OS X? I can't readily build and test on an OS X system at the moment, so I'm hoping someone can enlighten me. If a python executable file has sys.prefix/sys.exec_prefix pointing to a framework build's location, will that give the virtual environment everything it needs to e.g. interface to Cocoa etc? Or does any other setup need to be done? Thanks and regards, Vinay Sajip [1] https://bitbucket.org/vinay.sajip/pythonv/ [2] http://www.red-dove.com/screencasts/pythonv/pythonv.html From nad at acm.org Mon Jul 18 21:22:16 2011 From: nad at acm.org (Ned Deily) Date: Mon, 18 Jul 2011 12:22:16 -0700 Subject: [Pythonmac-SIG] Python virtual environments on OS X References: Message-ID: In article , Vinay Sajip wrote: > I'm working on pythonv[1], a branch which aims to bring virtual environment > creation functionality into Python itself (work on a PEP is in progress). > > I've got a prototype working quite well on Linux and Windows [2], but not yet > done any work on OS X. [...] > My question is, will this approach work on OS X? I can't readily build and > test > on an OS X system at the moment, so I'm hoping someone can enlighten me. If a > python executable file has sys.prefix/sys.exec_prefix pointing to a framework > build's location, will that give the virtual environment everything it needs > to e.g. interface to Cocoa etc? Or does any other setup need to be done? > [1] https://bitbucket.org/vinay.sajip/pythonv/ > [2] http://www.red-dove.com/screencasts/pythonv/pythonv.html Vinay: I did a quick build and test using a non-default framework location and the virtual env set up by ./python -m virtualize test_dir worked just fine, just as the original virtualenv does with framework builds. So while we may find some nits down the road, I think the general approach is fine. -- Ned Deily, nad at acm.org From vinay_sajip at yahoo.co.uk Mon Jul 18 22:25:57 2011 From: vinay_sajip at yahoo.co.uk (Vinay Sajip) Date: Mon, 18 Jul 2011 20:25:57 +0000 (UTC) Subject: [Pythonmac-SIG] Python virtual environments on OS X References: Message-ID: Hi Ned, > I did a quick build and test using a non-default framework location and > the virtual env set up by ./python -m virtualize test_dir worked just > fine, just as the original virtualenv does with framework builds. So > while we may find some nits down the road, I think the general approach > is fine. That's very good news. Thanks for doing this and getting back to me. Regards, Vinay Sajip From ronaldoussoren at mac.com Tue Jul 19 08:08:38 2011 From: ronaldoussoren at mac.com (Ronald Oussoren) Date: Tue, 19 Jul 2011 08:08:38 +0200 Subject: [Pythonmac-SIG] Python virtual environments on OS X In-Reply-To: References: Message-ID: On 18 Jul, 2011, at 19:15, Vinay Sajip wrote: > I'm working on pythonv[1], a branch which aims to bring virtual environment > creation functionality into Python itself (work on a PEP is in progress). > > I've got a prototype working quite well on Linux and Windows [2], but not yet > done any work on OS X. > > The basic approach used is that the Python start up code (in getpath.c) looks > at sys.executable and then for a configuration file env.cfg either in the > executable's directory or one level up, and then for a line in env.cfg of the > type > > home = /path/to/python > > If the file with that name and line are found, the home value sets sys.prefix > and sys.exec_prefix, and then later on, code in site.py sets up the virtual > environment. I'm not sure if I like this approach, I'll read the PEP before I start discussing that though. One thing I want to mention beforehand: why is the file named 'env.cfg' instead of something starting with 'py'? The latter is basicly namespacing the filename and avoids clashes with other software (although I don't know of any software that uses an env.cfg file). > > Because of the use of sys.executable, at present pythonv makes a copy of the > executable (and, on Windows, all DLLs) in the environment's binaries folder. > > My question is, will this approach work on OS X? I can't readily build and test > on an OS X system at the moment, so I'm hoping someone can enlighten me. If a > python executable file has sys.prefix/sys.exec_prefix pointing to a framework > build's location, will that give the virtual environment everything it needs > to e.g. interface to Cocoa etc? Or does any other setup need to be done? This should work fine with a framework build, with two caveats: 1) bin/python in a framework build is not the interpreter, but a stub executable. The script that creates the virtual environment should copy the executable in Resources/Python.app/MacOS instead. bin/python just execv-s the real interpreter. 2) accessing GUI functionality requires that the executable is located in an .app bundle, that's why bin/python is a stub. The latter point means that virualenvs will be slightly less functional than the framework install there based on unless you add more OSX specific code. It should be fairly easy to get this to work though, basicly create a Python.app in a hidden folder in the virtualenv and copy the real interpreter into that, then add a bin/python that execv's that hidden Python.app. Ronald > > Thanks and regards, > > Vinay Sajip > > [1] https://bitbucket.org/vinay.sajip/pythonv/ > [2] http://www.red-dove.com/screencasts/pythonv/pythonv.html > > > _______________________________________________ > Pythonmac-SIG maillist - Pythonmac-SIG at python.org > http://mail.python.org/mailman/listinfo/pythonmac-sig > unsubscribe: http://mail.python.org/mailman/options/Pythonmac-SIG -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 2224 bytes Desc: not available URL: From vinay_sajip at yahoo.co.uk Tue Jul 19 13:52:33 2011 From: vinay_sajip at yahoo.co.uk (Vinay Sajip) Date: Tue, 19 Jul 2011 11:52:33 +0000 (UTC) Subject: [Pythonmac-SIG] Python virtual environments on OS X References: Message-ID: Ronald Oussoren mac.com> writes: > I'm not sure if I like this approach, I'll read the PEP before I start discussing that though. One thing I want > to mention beforehand: why is the file named 'env.cfg' instead of something starting with 'py'? The > latter is basicly namespacing the filename and avoids clashes with other software (although I don't know > of any software that uses an env.cfg file). Thanks for your feedback. This file will only appear in the root folder of a virtual environment (i.e. the prefix location), so it's pretty unlikely to cause a clash in practice. However, the name change is easy to make at any point before release. What is it that you don't like about the proposed approach? > This should work fine with a framework build, with two caveats: > > 1) bin/python in a framework build is not the interpreter, but a stub executable. The script that creates > the virtual environment should copy the executable in Resources/Python.app/MacOS instead. > bin/python just execv-s the real interpreter. > > 2) accessing GUI functionality requires that the executable is located in an .app bundle, that's why > bin/python is a stub. > > The latter point means that virualenvs will be slightly less functional than the framework install there > based on unless you add more OSX specific code. It should be fairly easy to get this to work though, basicly > create a Python.app in a hidden folder in the virtualenv and copy the real interpreter into that, then add a > bin/python that execv's that hidden Python.app. That raises a few more questions :-) 1. Since we only use a copy of the executable so that argv[0] (and hence sys.executable) will point to the environment (and hence allow locating the environment config), mightn't the fact that a stub is used work to our advantage, in that it doesn't take up much disk space? 2. How does the stub locate the real executable? 3. What would the minimum contents of the Python.app folder be? 4. Does PyObjC support Python 3 yet? There's no mention of it on the PyObjC site, and from what I can tell this would need to be functional before Cocoa GUIs could be programmed in Python 3. Regards, Vinay Sajip From ronaldoussoren at mac.com Tue Jul 19 14:03:54 2011 From: ronaldoussoren at mac.com (Ronald Oussoren) Date: Tue, 19 Jul 2011 14:03:54 +0200 Subject: [Pythonmac-SIG] Python virtual environments on OS X In-Reply-To: References: Message-ID: On 19 Jul, 2011, at 13:52, Vinay Sajip wrote: > Ronald Oussoren mac.com> writes: > >> I'm not sure if I like this approach, I'll read the PEP before I start > discussing that though. One thing I want >> to mention beforehand: why is the file named 'env.cfg' instead of something > starting with 'py'? The >> latter is basicly namespacing the filename and avoids clashes with other > software (although I don't know >> of any software that uses an env.cfg file). > > Thanks for your feedback. > > This file will only appear in the root folder of a virtual environment (i.e. the > prefix location), so it's pretty unlikely to cause a clash in practice. However, > the name change is easy to make at any point before release. > > What is it that you don't like about the proposed approach? I'll read the PEP before responding to this question. > >> This should work fine with a framework build, with two caveats: >> >> 1) bin/python in a framework build is not the interpreter, but a stub > executable. The script that creates >> the virtual environment should copy the executable in > Resources/Python.app/MacOS instead. >> bin/python just execv-s the real interpreter. >> >> 2) accessing GUI functionality requires that the executable is located in an > .app bundle, that's why >> bin/python is a stub. >> >> The latter point means that virualenvs will be slightly less functional than > the framework install there >> based on unless you add more OSX specific code. It should be fairly easy to > get this to work though, basicly >> create a Python.app in a hidden folder in the virtualenv and copy the real > interpreter into that, then add a >> bin/python that execv's that hidden Python.app. > > That raises a few more questions :-) > > 1. Since we only use a copy of the executable so that argv[0] (and hence > sys.executable) will point to the environment (and hence allow locating the > environment config), mightn't the fact that a stub is used work to our > advantage, in that it doesn't take up much disk space? The 'env.cfg' file will be next to the stub executable, and hence not in a location where the real interpreter will look. > 2. How does the stub locate the real executable? The stub is linked to the framework and uses that to find the sys.prefix, the real executable is located in a fixed location relative to sys.prefix. That's one other difference w.r.t. regular builds: framework builds use the location of the shared library to calculate sys.prefix. AFAIK this functionality was inherited from the NextStep port. > 3. What would the minimum contents of the Python.app folder be? With some luck only Python.app/Contents/MacOS/Python needs to be present (the real executable), but it would be better to include the Info.plist file as well because some gui frameworks use the contents of that file > 4. Does PyObjC support Python 3 yet? There's no mention of it on the PyObjC > site, and from what I can tell this would need to be functional before Cocoa > GUIs could be programmed in Python 3. PyObjC supports Python 3, the site is very much out of date. I haven't found time to redesign the site yet, which needs to be done because the maintanence scripts no longer work due to some code reorganisations in PyObjC itself. Ronald > > Regards, > > Vinay Sajip > > _______________________________________________ > Pythonmac-SIG maillist - Pythonmac-SIG at python.org > http://mail.python.org/mailman/listinfo/pythonmac-sig > unsubscribe: http://mail.python.org/mailman/options/Pythonmac-SIG -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 2224 bytes Desc: not available URL: From vinay_sajip at yahoo.co.uk Wed Jul 20 10:36:47 2011 From: vinay_sajip at yahoo.co.uk (Vinay Sajip) Date: Wed, 20 Jul 2011 08:36:47 +0000 (UTC) Subject: [Pythonmac-SIG] Python virtual environments on OS X References: Message-ID: Ronald Oussoren mac.com> writes: > The 'env.cfg' file will be next to the stub executable, and hence not in a location where the real > interpreter will look. > > > 2. How does the stub locate the real executable? > > The stub is linked to the framework and uses that to find the sys.prefix, the real executable is located in a > fixed location relative to sys.prefix. > > That's one other difference w.r.t. regular builds: framework builds use the location of the shared > library to calculate sys.prefix. AFAIK this functionality was inherited from the NextStep port. Here's the approach I've taken to this - please comment. 1. I modified the stub loader to set an environment variable "__PYTHONV_LAUNCHER__" to the absolute path of the stub executable itself. The environment key seems unambiguous enough and shouldn't clash with anything else. This might seem clunky, but seems the most obvious way to feed this information to the real executable. 2. The stub is copied to an environment's bin folder (but nothing else is, for the moment, though I've written the code to copy the dylib, Info.plist, real executable etc it's currently commented out). 3. When the stub is run, it finds the framework executable in the usual way, and runs it. 4. When the real executable gets control, code in site.py picks up the environment variable's value and looks for the env.cfg relative to that location. AFAICT this should be enough, since the real executable is executed from its framework location and presumably has access to all tbe necessary context for GUI applications, etc. I've verified that sys.site_prefix, sys.site_exec_prefix and sys.path correctly point to the virtual environment. I ran the full regression test suite in a virtual env, and only got failures in test_lib2to3 and test_packaging (due to known issues with those tests writing into write-protected locations - this happens with vanilla installed Python 3.3, too). > PyObjC supports Python 3, the site is very much out of date. I haven't found time to redesign the site yet, > which needs to be done because the maintanence scripts no longer work due to some code reorganisations in > PyObjC itself. Are there instructions somewhere on how to build and integrate into a framework build's Extras? Regards, Vinay Sajip From rowen at uw.edu Wed Jul 20 23:06:11 2011 From: rowen at uw.edu (Russell E. Owen) Date: Wed, 20 Jul 2011 14:06:11 -0700 Subject: [Pythonmac-SIG] py2app under Lion--any issues? Message-ID: Will py2app to work to build Mac application bundles under Lion (MacOS X 10.7)? I'm using python.org 32-bit python and ActiveState Tcl/Tk 8.4.19 and trying to build self-contained Python/Tk apps that run on at least MacOS X 10.5 and later. I assume there's no problems, but it would be very helpful to know what to watch out for if there are. -- Russell From rowen at uw.edu Thu Jul 21 00:31:54 2011 From: rowen at uw.edu (Russell E. Owen) Date: Wed, 20 Jul 2011 15:31:54 -0700 Subject: [Pythonmac-SIG] py2app application fails with ImportError: No module named sysconfig Message-ID: I used py2app to build an application that i've been building for years, only now it's failing at startup with the appended log. The problem is triggered by numpy 1.6.1fc3 (which I installed from source). If I build using an older numpy I don't see the problem. However, the application runs just fine from the command line, so I'm puzzled how it could be an actual bugin numpy. (If it is, though, now is a great time to report it, before 1.6.1 is released). Any idea what might be causing this and how to avoid it? A google search didn't turn up anything that looked relevant. -- Russell Traceback (most recent call last): File "/Applications/TUI.app/Contents/Resources/runtuiWithLog.py", line 76, in File "/Applications/TUI.app/Contents/Resources/lib/python2.7/TUI/Main.py", line 70, in File "/Applications/TUI.app/Contents/Resources/lib/python2.7/TUI/BackgroundTas ks.py", line 33, in File "/Applications/TUI.app/Contents/Resources/lib/python2.7/RO/Astro/Tm/__ini t__.py", line 23, in File "/Applications/TUI.app/Contents/Resources/lib/python2.7/RO/Astro/Tm/EpJFr omMJD.py", line 2, in File "/Applications/TUI.app/Contents/Resources/lib/python2.7/RO/Astro/llv/__in it__.py", line 11, in File "/Applications/TUI.app/Contents/Resources/lib/python2.7/RO/Astro/llv/etrm s.py", line 9, in File "/Applications/TUI.app/Contents/Resources/lib/python2.7/numpy/__init__.py ", line 155, in File "/Applications/TUI.app/Contents/Resources/lib/python2.7/numpy/ctypeslib.p y", line 58, in File "/Applications/TUI.app/Contents/Resources/lib/python2.7/numpy/distutils/_ _init__.py", line 7, in File "/Applications/TUI.app/Contents/Resources/lib/python2.7/numpy/distutils/c compiler.py", line 7, in File "distutils/ccompiler.pyc", line 21, in ImportError: No module named sysconfig From dan at rosspixelworks.com Thu Jul 21 00:35:52 2011 From: dan at rosspixelworks.com (Dan Ross) Date: Wed, 20 Jul 2011 17:35:52 -0500 Subject: [Pythonmac-SIG] Lion Message-ID: Anyone have reports of Pythons on Lion? From rowen at uw.edu Thu Jul 21 01:17:09 2011 From: rowen at uw.edu (Russell E. Owen) Date: Wed, 20 Jul 2011 16:17:09 -0700 Subject: [Pythonmac-SIG] py2app application fails with ImportError: No module named sysconfig References: Message-ID: In article , "Russell E. Owen" wrote: > I used py2app to build an application that i've been building for years, > only now it's failing at startup with the appended log. > > The problem is triggered by numpy 1.6.1fc3 (which I installed from > source). If I build using an older numpy I don't see the problem. > > However, the application runs just fine from the command line, so I'm > puzzled how it could be an actual bugin numpy. (If it is, though, now is > a great time to report it, before 1.6.1 is released). > > Any idea what might be causing this and how to avoid it? A google search > didn't turn up anything that looked relevant. To follow up on this, I have tested the following configurations (MacOS X 10.6.8 with MACOSX_DEPLOYMENT_TARGET=10.4): build numpy 1.6.1fc3 from source: the only case that shows a problem. I built this numpy twice and both times saw the problem. The following did not show the problem: build numpy 1.5.1 from source install numpy 1.5.1 using binary installer install numpy 1.6.0 using binary installer I also noticed that the module with the failing import (distutils/ccompiler.py) is identical in numpy 1.5.1 and 1.6.1fc3. -- Russell From janssen at parc.com Thu Jul 21 01:23:26 2011 From: janssen at parc.com (Bill Janssen) Date: Wed, 20 Jul 2011 16:23:26 PDT Subject: [Pythonmac-SIG] Lion In-Reply-To: References: Message-ID: <71066.1311204206@parc.com> Dan Ross wrote: > Anyone have reports of Pythons on Lion? It's Python 2.7.1 pre-installed in /System/Library, but I don't know about PyObjC or Twisted. Bill From dan at rosspixelworks.com Thu Jul 21 01:28:24 2011 From: dan at rosspixelworks.com (Dan Ross) Date: Wed, 20 Jul 2011 18:28:24 -0500 Subject: [Pythonmac-SIG] Lion In-Reply-To: <71066.1311204206@parc.com> References: <71066.1311204206@parc.com> Message-ID: Installing python.org's framework should work shouldn't it? On Jul 20, 2011, at 6:23 PM, Bill Janssen wrote: > Dan Ross wrote: > >> Anyone have reports of Pythons on Lion? > > It's Python 2.7.1 pre-installed in /System/Library, but I don't know > about PyObjC or Twisted. > > Bill From aahz at pythoncraft.com Thu Jul 21 02:14:01 2011 From: aahz at pythoncraft.com (Aahz) Date: Wed, 20 Jul 2011 17:14:01 -0700 Subject: [Pythonmac-SIG] Lion In-Reply-To: References: Message-ID: <20110721001401.GA12943@panix.com> On Wed, Jul 20, 2011, Dan Ross wrote: > > Anyone have reports of Pythons on Lion? Are you asking about what's installed, what works, something else? My company is getting ready for acceptance testing on Lion using 2.6.4. -- Aahz (aahz at pythoncraft.com) <*> http://www.pythoncraft.com/ "If you don't know what your program is supposed to do, you'd better not start writing it." --Dijkstra From aahz at pythoncraft.com Thu Jul 21 02:15:20 2011 From: aahz at pythoncraft.com (Aahz) Date: Wed, 20 Jul 2011 17:15:20 -0700 Subject: [Pythonmac-SIG] py2app under Lion--any issues? In-Reply-To: References: Message-ID: <20110721001520.GB12943@panix.com> On Wed, Jul 20, 2011, Russell E. Owen wrote: > > Will py2app to work to build Mac application bundles under Lion (MacOS X > 10.7)? > > I'm using python.org 32-bit python and ActiveState Tcl/Tk 8.4.19 and > trying to build self-contained Python/Tk apps that run on at least MacOS > X 10.5 and later. > > I assume there's no problems, but it would be very helpful to know what > to watch out for if there are. Works for us, but Lion always runs installs as root so you need to update your flights to use "su -u $USER" for anything you previously did as the default user. -- Aahz (aahz at pythoncraft.com) <*> http://www.pythoncraft.com/ "If you don't know what your program is supposed to do, you'd better not start writing it." --Dijkstra From nad at acm.org Thu Jul 21 02:27:08 2011 From: nad at acm.org (Ned Deily) Date: Wed, 20 Jul 2011 17:27:08 -0700 Subject: [Pythonmac-SIG] Lion References: <71066.1311204206@parc.com> Message-ID: In article , Dan Ross wrote: > Installing python.org's framework should work shouldn't it? The 64-bit/32-bin python.org installers (current releases are 3.2.1 and 2.7.2) *should* work on 10.7 Lion. I'm not so sure about the traditional 32-bit-only ones (the 10.3+ ones). As with 10.6, I expect you will need to install ActiveState Tcl/Tk 8.5 if you want to use Tkinter or IDLE as there have been some recent fixes for Cocoa Tk. I just have completed downloading the official 10.7 release and should have some preliminary results posted by tomorrow. http://www.python.org/download/ http://www.python.org/download/mac/tcltk/ -- Ned Deily, nad at acm.org From nad at acm.org Thu Jul 21 02:29:50 2011 From: nad at acm.org (Ned Deily) Date: Wed, 20 Jul 2011 17:29:50 -0700 Subject: [Pythonmac-SIG] py2app application fails with ImportError: No module named sysconfig References: Message-ID: In article , "Russell E. Owen" wrote: > In article , > "Russell E. Owen" wrote: > > > I used py2app to build an application that i've been building for years, > > only now it's failing at startup with the appended log. > > > > The problem is triggered by numpy 1.6.1fc3 (which I installed from > > source). If I build using an older numpy I don't see the problem. > > > > However, the application runs just fine from the command line, so I'm > > puzzled how it could be an actual bugin numpy. (If it is, though, now is > > a great time to report it, before 1.6.1 is released). > > > > Any idea what might be causing this and how to avoid it? A google search > > didn't turn up anything that looked relevant. > > To follow up on this, I have tested the following configurations (MacOS > X 10.6.8 with MACOSX_DEPLOYMENT_TARGET=10.4): > > build numpy 1.6.1fc3 from source: the only case that shows a problem. I > built this numpy twice and both times saw the problem. > > The following did not show the problem: > build numpy 1.5.1 from source > install numpy 1.5.1 using binary installer > install numpy 1.6.0 using binary installer > > I also noticed that the module with the failing import > (distutils/ccompiler.py) is identical in numpy 1.5.1 and 1.6.1fc3. What version of Python 2.7 are you using? And, if you built it yourself, what ./config options did you use? -- Ned Deily, nad at acm.org From dan at rosspixelworks.com Thu Jul 21 03:40:42 2011 From: dan at rosspixelworks.com (Dan Ross) Date: Wed, 20 Jul 2011 20:40:42 -0500 Subject: [Pythonmac-SIG] Lion In-Reply-To: <20110721001401.GA12943@panix.com> References: <20110721001401.GA12943@panix.com> Message-ID: <3DE6C4E4-C486-4085-BD37-6E0EF5E16CA2@rosspixelworks.com> I'm wondering if non-system Python will work since that's what I prefer using. On Jul 20, 2011, at 7:14 PM, Aahz wrote: > On Wed, Jul 20, 2011, Dan Ross wrote: >> >> Anyone have reports of Pythons on Lion? > > Are you asking about what's installed, what works, something else? > > My company is getting ready for acceptance testing on Lion using 2.6.4. > -- > Aahz (aahz at pythoncraft.com) <*> http://www.pythoncraft.com/ > > "If you don't know what your program is supposed to do, you'd better not > start writing it." --Dijkstra > _______________________________________________ > Pythonmac-SIG maillist - Pythonmac-SIG at python.org > http://mail.python.org/mailman/listinfo/pythonmac-sig > unsubscribe: http://mail.python.org/mailman/options/Pythonmac-SIG From aahz at pythoncraft.com Thu Jul 21 05:34:16 2011 From: aahz at pythoncraft.com (Aahz) Date: Wed, 20 Jul 2011 20:34:16 -0700 Subject: [Pythonmac-SIG] Lion In-Reply-To: References: <71066.1311204206@parc.com> Message-ID: <20110721033416.GA27485@panix.com> On Wed, Jul 20, 2011, Ned Deily wrote: > In article , > Dan Ross wrote: >> >> Installing python.org's framework should work shouldn't it? > > The 64-bit/32-bin python.org installers (current releases are 3.2.1 and > 2.7.2) *should* work on 10.7 Lion. I'm not so sure about the > traditional 32-bit-only ones (the 10.3+ ones). As with 10.6, I expect > you will need to install ActiveState Tcl/Tk 8.5 if you want to use > Tkinter or IDLE as there have been some recent fixes for Cocoa Tk. I > just have completed downloading the official 10.7 release and should > have some preliminary results posted by tomorrow. I'm not sure which 2.6.4 we're using, but it works with Lion. -- Aahz (aahz at pythoncraft.com) <*> http://www.pythoncraft.com/ "If you don't know what your program is supposed to do, you'd better not start writing it." --Dijkstra From ronaldoussoren at mac.com Thu Jul 21 09:10:23 2011 From: ronaldoussoren at mac.com (Ronald Oussoren) Date: Thu, 21 Jul 2011 09:10:23 +0200 Subject: [Pythonmac-SIG] Lion In-Reply-To: References: <71066.1311204206@parc.com> Message-ID: On 21 Jul, 2011, at 2:27, Ned Deily wrote: > In article , > Dan Ross wrote: > >> Installing python.org's framework should work shouldn't it? > > The 64-bit/32-bin python.org installers (current releases are 3.2.1 and > 2.7.2) *should* work on 10.7 Lion. I'm not so sure about the > traditional 32-bit-only ones (the 10.3+ ones). As with 10.6, I expect > you will need to install ActiveState Tcl/Tk 8.5 if you want to use > Tkinter or IDLE as there have been some recent fixes for Cocoa Tk. I > just have completed downloading the official 10.7 release and should > have some preliminary results posted by tomorrow. Both should work, but only the 64-bit/32-bit installer is truly useful: the xcode version for Lion is from the 4.x series and that no longer supports building PPC extensions, hence the Python installed by the 32-bit installer cannot build new extensions. Ronald -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 2224 bytes Desc: not available URL: From ronaldoussoren at mac.com Thu Jul 21 09:15:28 2011 From: ronaldoussoren at mac.com (Ronald Oussoren) Date: Thu, 21 Jul 2011 09:15:28 +0200 Subject: [Pythonmac-SIG] Lion In-Reply-To: References: <71066.1311204206@parc.com> Message-ID: <22DDB711-95F1-462A-9EA1-F80CB9896FA9@mac.com> On 21 Jul, 2011, at 1:28, Dan Ross wrote: > Installing python.org's framework should work shouldn't it? > > On Jul 20, 2011, at 6:23 PM, Bill Janssen wrote: > >> Dan Ross wrote: >> >>> Anyone have reports of Pythons on Lion? >> >> It's Python 2.7.1 pre-installed in /System/Library, but I don't know >> about PyObjC or Twisted. There is a PyObjC in Lion, to be honest I haven't checked if it is fully functional. There are some small issues with PyObjC's testsuite on Lion, which I've mostly fixed in my tree. I haven't started generating bindings for new Lion APIs yet, mostly because the tool I use to generate these is broken and I haven't finished its replacement yet. BTW. I've moved the PyObjC repository bitbucket (https://bitbucket.org/ronaldoussoren/pyobjc). That version is not fully functional at the moment: I'm switching from the ".bridgesupport" files used in earlier releases to a version that compiles these into python datastructures. Not all frameworks have been moved over at this point, the most important missing ones are the Quartz and WebKit bindings. >> >> Bill > > _______________________________________________ > Pythonmac-SIG maillist - Pythonmac-SIG at python.org > http://mail.python.org/mailman/listinfo/pythonmac-sig > unsubscribe: http://mail.python.org/mailman/options/Pythonmac-SIG -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 2224 bytes Desc: not available URL: From ronaldoussoren at mac.com Thu Jul 21 09:38:46 2011 From: ronaldoussoren at mac.com (Ronald Oussoren) Date: Thu, 21 Jul 2011 09:38:46 +0200 Subject: [Pythonmac-SIG] py2app application fails with ImportError: No module named sysconfig In-Reply-To: References: Message-ID: <53A3BD48-5252-4160-8057-719960229202@mac.com> On 21 Jul, 2011, at 0:31, Russell E. Owen wrote: > I used py2app to build an application that i've been building for years, > only now it's failing at startup with the appended log. > > The problem is triggered by numpy 1.6.1fc3 (which I installed from > source). If I build using an older numpy I don't see the problem. Where can I download this version? The numpy download page ( doesn't mention 1.6.1fc3. There is 1.6.1rc3 though (and a final release for 1.6.1). The issue might be caused by a mismatch between the module search strategy used by the import statement and the emulation by modulegraph, I'll have to build a unittest to be sure though. Does the generated app have a copy of distutils/sysconfig.py (or .pyc) in the embedded zipfile? Ronald -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 2224 bytes Desc: not available URL: From dan at rosspixelworks.com Thu Jul 21 15:33:21 2011 From: dan at rosspixelworks.com (Dan Ross) Date: Thu, 21 Jul 2011 08:33:21 -0500 Subject: [Pythonmac-SIG] Lion In-Reply-To: <22DDB711-95F1-462A-9EA1-F80CB9896FA9@mac.com> References: <71066.1311204206@parc.com> <22DDB711-95F1-462A-9EA1-F80CB9896FA9@mac.com> Message-ID: <5a27e29aecf437f3d7d434f0a4c09d9c@rosspixelworks.com> Cool. Thanks for the replies guys. Thanks for the PyObjC work too Ronald. On Thu, 21 Jul 2011 09:15:28 +0200, Ronald Oussoren wrote: > On 21 Jul, 2011, at 1:28, Dan Ross wrote: > >> Installing python.org's framework should work shouldn't it? >> >> On Jul 20, 2011, at 6:23 PM, Bill Janssen wrote: >> >>> Dan Ross wrote: >>> >>>> Anyone have reports of Pythons on Lion? >>> >>> It's Python 2.7.1 pre-installed in /System/Library, but I don't >>> know >>> about PyObjC or Twisted. > > There is a PyObjC in Lion, to be honest I haven't checked if it is > fully functional. > > There are some small issues with PyObjC's testsuite on Lion, which > I've mostly fixed in my tree. I haven't started generating bindings > for new Lion APIs yet, mostly because the tool I use to generate > these > is broken and I haven't finished its replacement yet. > > BTW. I've moved the PyObjC repository bitbucket > (https://bitbucket.org/ronaldoussoren/pyobjc). That version is not > fully functional at the moment: I'm switching from the > ".bridgesupport" files used in earlier releases to a version that > compiles these into python datastructures. Not all frameworks have > been moved over at this point, the most important missing ones are > the > Quartz and WebKit bindings. >>> >>> Bill >> >> _______________________________________________ >> Pythonmac-SIG maillist - Pythonmac-SIG at python.org >> http://mail.python.org/mailman/listinfo/pythonmac-sig >> unsubscribe: http://mail.python.org/mailman/options/Pythonmac-SIG From alice.inside.mirror at gmail.com Thu Jul 21 18:34:19 2011 From: alice.inside.mirror at gmail.com (Alice Marcot) Date: Thu, 21 Jul 2011 12:34:19 -0400 Subject: [Pythonmac-SIG] error Message-ID: When trying to use py2app according to the tutorial I am getting this error: *** creating application bundle: downloader *** error: /usr/local/lib/python2.7/dist-packages/py2app-0.6.3-py2.7.egg/py2app/apptemplate/prebuilt/main-i686: No such file or directory -------------- next part -------------- An HTML attachment was scrubbed... URL: From rowen at uw.edu Thu Jul 21 21:16:26 2011 From: rowen at uw.edu (Russell E. Owen) Date: Thu, 21 Jul 2011 12:16:26 -0700 Subject: [Pythonmac-SIG] py2app application fails with ImportError: No module named sysconfig References: Message-ID: In article , Ned Deily wrote: > In article , > "Russell E. Owen" wrote: > > > In article , > > "Russell E. Owen" wrote: > > > > > I used py2app to build an application that i've been building for years, > > > only now it's failing at startup with the appended log. > > > > > > The problem is triggered by numpy 1.6.1fc3 (which I installed from > > > source). If I build using an older numpy I don't see the problem. > > > > > > However, the application runs just fine from the command line, so I'm > > > puzzled how it could be an actual bugin numpy. (If it is, though, now is > > > a great time to report it, before 1.6.1 is released). > > > > > > Any idea what might be causing this and how to avoid it? A google search > > > didn't turn up anything that looked relevant. > > > > To follow up on this, I have tested the following configurations (MacOS > > X 10.6.8 with MACOSX_DEPLOYMENT_TARGET=10.4): > > > > build numpy 1.6.1fc3 from source: the only case that shows a problem. I > > built this numpy twice and both times saw the problem. > > > > The following did not show the problem: > > build numpy 1.5.1 from source > > install numpy 1.5.1 using binary installer > > install numpy 1.6.0 using binary installer > > > > I also noticed that the module with the failing import > > (distutils/ccompiler.py) is identical in numpy 1.5.1 and 1.6.1fc3. > > What version of Python 2.7 are you using? And, if you built it > yourself, what ./config options did you use? The 32-bit binary installer from python.org -- Russell From rowen at uw.edu Thu Jul 21 21:35:55 2011 From: rowen at uw.edu (Russell E. Owen) Date: Thu, 21 Jul 2011 12:35:55 -0700 Subject: [Pythonmac-SIG] Lion References: <71066.1311204206@parc.com> Message-ID: In article , Ronald Oussoren wrote: > On 21 Jul, 2011, at 2:27, Ned Deily wrote: > > > In article , > > Dan Ross wrote: > > > >> Installing python.org's framework should work shouldn't it? > > > > The 64-bit/32-bin python.org installers (current releases are 3.2.1 and > > 2.7.2) *should* work on 10.7 Lion. I'm not so sure about the > > traditional 32-bit-only ones (the 10.3+ ones). As with 10.6, I expect > > you will need to install ActiveState Tcl/Tk 8.5 if you want to use > > Tkinter or IDLE as there have been some recent fixes for Cocoa Tk. I > > just have completed downloading the official 10.7 release and should > > have some preliminary results posted by tomorrow. > > Both should work, but only the 64-bit/32-bit installer is truly useful: the > xcode version for Lion is from the 4.x series and that no longer supports > building PPC extensions, hence the Python installed by the 32-bit installer > cannot build new extensions. Ouch. I've been using the 32-bit (10.3) versions so I can build apps that run on MacOS X 10.5 and later (10.4 as well, but I have no requirement for that). It sounds like the only ways to do that now are: - Compile Python from source, plus all packages I use (numpy, matplotlib, PIL...) - Use the 32-bit version of Python and never, ever build an extension on 10.7. - Try to use an older XCode on 10.7. I doubt that would work properly, if at all. - Stay with 10.6 or at least keep it around for building apps to distribute. I suspect it'll be at least 6 months and probably closer to a year before I can abandon 10.5 users. It'd be nice to have a python.org python that at least supported 10.5-10.7 (the 64 bit version required 10.6 and later, I believe due to limitations in Apple's Tck/Tk). It sounds as if it would ditch PPC support and either be 32-bit or else require a 3rd party Tck/Tk such as ActiveState's offering. -- Russell From rowen at uw.edu Thu Jul 21 21:38:12 2011 From: rowen at uw.edu (Russell E. Owen) Date: Thu, 21 Jul 2011 12:38:12 -0700 Subject: [Pythonmac-SIG] py2app under Lion--any issues? References: <20110721001520.GB12943@panix.com> Message-ID: In article <20110721001520.GB12943 at panix.com>, Aahz wrote: > On Wed, Jul 20, 2011, Russell E. Owen wrote: > > > > Will py2app to work to build Mac application bundles under Lion (MacOS X > > 10.7)? > > > > I'm using python.org 32-bit python and ActiveState Tcl/Tk 8.4.19 and > > trying to build self-contained Python/Tk apps that run on at least MacOS > > X 10.5 and later. > > > > I assume there's no problems, but it would be very helpful to know what > > to watch out for if there are. > > Works for us, but Lion always runs installs as root so you need to > update your flights to use "su -u $USER" for anything you previously did > as the default user. Ronald Oussouran points out in the Lion thread that: > Both (the more compatible 32-bit python.org Python binary installer and the 64-bit/32-bit version) > should work, but only the 64-bit/32-bit installer is truly useful: the > xcode version for Lion is from the 4.x series and that no longer supports > building PPC extensions, hence the Python installed by the 32-bit installer > cannot build new extensions. That's a very serious limitation indeed. -- Russell From rowen at uw.edu Thu Jul 21 21:43:52 2011 From: rowen at uw.edu (Russell E. Owen) Date: Thu, 21 Jul 2011 12:43:52 -0700 Subject: [Pythonmac-SIG] py2app application fails with ImportError: No module named sysconfig References: <53A3BD48-5252-4160-8057-719960229202@mac.com> Message-ID: In article <53A3BD48-5252-4160-8057-719960229202 at mac.com>, Ronald Oussoren wrote: > On 21 Jul, 2011, at 0:31, Russell E. Owen wrote: > > > I used py2app to build an application that i've been building for years, > > only now it's failing at startup with the appended log. > > > > The problem is triggered by numpy 1.6.1fc3 (which I installed from > > source). If I build using an older numpy I don't see the problem. > > Where can I download this version? The numpy download page > ( doesn't mention > 1.6.1fc3. There is 1.6.1rc3 though (and a final release for 1.6.1). > > The issue might be caused by a mismatch between the module search strategy > used by the import statement and the emulation by modulegraph, I'll have to > build a unittest to be sure though. > > Does the generated app have a copy of distutils/sysconfig.py (or .pyc) in the > embedded zipfile? > > Ronald Sorry, I meant numpy 1.6.1rc3. It's nice to know that 1.6.1 has been released; I had missed the announcement. However, the binary says 10.6 so I'm guessing I can't use it with my 32-bit 10.3 python.org Python so I've not tested to see if the problem has gone away. Yes the generated app does include distutils/sysconfig.pyc (but not .py) in its Contents/Resources/lib/python2.7/site-packages.zip -- Russell From brendan.simon at etrix.com.au Thu Jul 21 23:18:12 2011 From: brendan.simon at etrix.com.au (Brendan Simon (eTRIX)) Date: Fri, 22 Jul 2011 07:18:12 +1000 Subject: [Pythonmac-SIG] py2app under Lion--any issues? In-Reply-To: References: Message-ID: <4E289794.7080207@etrix.com.au> On 22/07/11 5:45 AM, pythonmac-sig-request at python.org wrote: > Subject: > Re: [Pythonmac-SIG] py2app under Lion--any issues? > From: > "Russell E. Owen" > Date: > 5:38 AM > > To: > pythonmac-sig at python.org > > > In article <20110721001520.GB12943 at panix.com>, > Aahz wrote: > > Ronald Oussouran points out in the Lion thread that: > >> > Both (the more compatible 32-bit python.org Python binary installer and the 64-bit/32-bit version) >> > should work, but only the 64-bit/32-bit installer is truly useful: the >> > xcode version for Lion is from the 4.x series and that no longer supports >> > building PPC extensions, hence the Python installed by the 32-bit installer >> > cannot build new extensions. > That's a very serious limitation indeed. I note that Lion EULA now permits use of up to 4 instances of the OS running in Virutal Machines, so you be able to use OS X (10.6 or 10.5 or 10.4) in a VM (VirtualBox, Parallels, VMWare, etc) to do your PowerPC builds ?? Maybe over kill, but it's also not a bad way to do some testing on the target OS :) -------------- next part -------------- An HTML attachment was scrubbed... URL: From aragost at gmail.com Fri Jul 22 01:11:45 2011 From: aragost at gmail.com (Agos) Date: Fri, 22 Jul 2011 01:11:45 +0200 Subject: [Pythonmac-SIG] py2app issue with wx Message-ID: <9D1116A5-8194-479B-946F-43BFC8EFEC8E@gmail.com> Hi everybody! I hope somebody can help me :) I have this setup: Enthought Python Distribution 7.0-1 32 bit Which includes Python 2.7.1 Running on Mac OS X 10.6.8 My application, which uses - wx - matplotlib - numpy - scipy What I'm trying to do is to package it as a .app with py2app. The app gets packaged ok, runs fine on my Mac, but does not run on any other Mac (educated guess: it does not run on any Mac without the Enthought Python Distribution). Here is my setup.py: https://gist.github.com/1098405 Here is the ouput of the build command: http://dl.dropbox.com/u/365171/py2appbuildoutput.zip [warning, >1MB when uncompressed, do not open with Textmate ;)] The output of the build command looks pretty uneventful BUT the last line reports: error: can't copy '/Library/Frameworks/Python.framework/Versions/7.0/lib/python7.0/config/Makefile': doesn't exist or not a regular file which I don't know if is to be expected. Is it? Upon launch (on any Mac I've met beyond mine), this is the error I get: https://gist.github.com/1098413 Looking around I've found some cases of very similar errors: http://old.nabble.com/Problems-getting-started-with-py2app-and-wxPython-td25686278.html https://groups.google.com/forum/#!topic/wxpython-users/ehI8ecZqDDI https://groups.google.com/forum/#!topic/wxpython-users/sdIaPG_K4s0 http://www.google.it/search?sourceid=chrome&ie=UTF-8&q=py2app+%22_core_.so%22 The proposed solutions I've found are: 1) update py2app. I'm using py2app-0.6.3-py2.7.egg and altgraph-0.9-py2.7.egg (from homebrew) which are to my knowledge the latest versions currently available. 2) do not use the ?stock? python, but rather download it from python.org. I can't use the python.org one, but I think the EPD python is sufficiently non-stock. Any idea? I'm afraid I can't provide a minimal example to reproduce the problem. I'll try to build one this weekend. Until then, the code is here: https://github.com/Agos/BeatingModeSW (the only things missing are the aforementioned setup.py, the app icon and the good old ez_setup.py). A binary showing the problem is here: http://dl.dropbox.com/u/365171/bmgui.zip [warning: 40 meg download]. Any help is very appreciated. Regards, A. P.S. I tried just now to add 'includes': ['wx'], but there was no difference. -------------- next part -------------- An HTML attachment was scrubbed... URL: From aahz at pythoncraft.com Fri Jul 22 01:24:59 2011 From: aahz at pythoncraft.com (Aahz) Date: Thu, 21 Jul 2011 16:24:59 -0700 Subject: [Pythonmac-SIG] Lion In-Reply-To: References: <71066.1311204206@parc.com> Message-ID: <20110721232459.GA2551@panix.com> On Thu, Jul 21, 2011, Russell E. Owen wrote: > In article , > Ronald Oussoren wrote: >> On 21 Jul, 2011, at 2:27, Ned Deily wrote: >> >> Both should work, but only the 64-bit/32-bit installer is truly useful: the >> xcode version for Lion is from the 4.x series and that no longer supports >> building PPC extensions, hence the Python installed by the 32-bit installer >> cannot build new extensions. > > Ouch. I've been using the 32-bit (10.3) versions so I can build apps > that run on MacOS X 10.5 and later (10.4 as well, but I have no > requirement for that). > > It sounds like the only ways to do that now are: > - Compile Python from source, plus all packages I use (numpy, > matplotlib, PIL...) > - Use the 32-bit version of Python and never, ever build an extension on > 10.7. > - Try to use an older XCode on 10.7. I doubt that would work properly, > if at all. > - Stay with 10.6 or at least keep it around for building apps to > distribute. The latter is what we're doing. -- Aahz (aahz at pythoncraft.com) <*> http://www.pythoncraft.com/ "If you don't know what your program is supposed to do, you'd better not start writing it." --Dijkstra From nad at acm.org Fri Jul 22 01:26:41 2011 From: nad at acm.org (Ned Deily) Date: Thu, 21 Jul 2011 16:26:41 -0700 Subject: [Pythonmac-SIG] Lion References: <71066.1311204206@parc.com> Message-ID: In article , Ned Deily wrote: > The 64-bit/32-bin python.org installers (current releases are 3.2.1 and > 2.7.2) *should* work on 10.7 Lion. I'm not so sure about the > traditional 32-bit-only ones (the 10.3+ ones). As with 10.6, I expect > you will need to install ActiveState Tcl/Tk 8.5 if you want to use > Tkinter or IDLE as there have been some recent fixes for Cocoa Tk. I > just have completed downloading the official 10.7 release and should > have some preliminary results posted by tomorrow. Here's my take on things after installing and some quick testing with 10.7 Lion: - If you were satisfied with using the Apple-supplied Pythons in previous OS X releases, you'll probably be satisfied with the 2.7, 2.6, or 2.5 system Pythons in 10.7. - You should not rely on the Apple-suppled Pythons if you want to use IDLE. http://www.python.org/download/mac/tcltk/ - If you prefer to use more recent Pythons and have been satisfied with python.org OS X installers, use the most recent 3.2.1 or 2.7.2 64-bit/32-bit (x86-64 / i386) installers for Mac OS X: http://www.python.org/download/ As with 10.6, if you are planning to use IDLE or Tkinter with these installers, you should also install the most recent ActiveTcl 8.5 if you can (check the license terms): http://www.activestate.com/activetcl/downloads - If you need to install any Python packages that build C extension modules, you'll need to install Xcode for Lion (currently 4.1 and now available for free download through the Mac App store). - The traditional python.org 32-bit-only 10.3+ (i386/PPC) Pythons can be installed on 10.7 and do work in general; however, it is not practical to build C extension modules on 10.7 that will work with them (since Xcode 4 no longer includes the 10.4u SDK nor gcc-4.0). Unless you have specialized needs and know what you are doing, you should avoid using the traditional 32-bit-only installers on 10.7 in favor of either using the 64-bit/32-bit variants, using versions from a different distributor, or building your own. As on 10.6, if you need to run in 32-bit mode, you can use "python3.2-32" or "python2.7-32" with the 64-bit/32-bit variants. Random details: Apple ships 10.7 with 3 system Pythons: /usr/bin/python2.7 Python 2.7.1 (r271:86832, Jun 16 2011, 16:59:05) [GCC 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2335.15.00)] on darwin /usr/bin/python2.6 Python 2.6.6 (r266:84292, Jun 16 2011, 16:59:16) [GCC 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2335.15.00)] on darwin /usr/bin/python2.5 Python 2.5.5 (r255:77872, Jun 16 2011, 16:58:16) [GCC 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2335.15.00)] on darwin The 2.7 and 2.6 instances are 2-way Intel universal binaries (x86_64 and i386); the 2.5 one is i386 (32-bit) only. The 2.7 version, at least, comes pre-installed with various 3rd-party packages, like setupttols, PyObjC, py2app, numpy, twisted, Zope, etc, similar to what was shipped for 2.6 in 10.6. (I didn't look at the 2.6 and 2.5 frameworks.) The downside of shipping these packages is that some, including Python itself, are not the latest versions. Tcl/Tk: As in 10.6, Apple ships two versions of Tcl/Tk: a Cocoa Tk 8.5 and the venerable Carbon Tk 8.4. The 8.5 version has been updated to 8.5.9. The Tkinters in all three Apple-supplied Pythons are linked with 8.5. The good news is that the updated 8.5 is not the disaster that the 10.6 version was. The bad news is that it is missing at least one fix to Tk from earlier this year: Cocoa Tk crashes when typing a composite character into a text field (http://sourceforge.net/tracker/index.php?func=detail&aid=2907388&group_i d=12997&atid=112997). The fix for this crash is incorporated into the most recent ActiveTcl 8.5 releases for OS X. However, the system Pythons will not attempt to dynamically link to user-installed Tcl/Tk frameworks in /Library (where the ActiveState frameowrks are installed), unlike the Pythons installed by python.org installers. So, out of the box, the IDLE versions that come with the system Pythons are vulnerable to this. But at least they aren't totally unusable as was the case with 10.6. And I suppose if there are enough bug reports this fix might get applied in a future 10.7 update. Although it's not practical to build packages with C extension modules on 10.7 for the traditional 32-bit-only python.org Pythons (as explained above), it is possible to build such packages with the same Python installed on a 10.6, 10.5, or even 10.4 system, create a Distutils bdist or setuptools/Distribute bdist-egg and then install the binary distribution on the 10.7 system. I would avoid going down that path if possible, unless it is needed as a temporary transition phase. -- Ned Deily, nad at acm.org From aahz at pythoncraft.com Fri Jul 22 06:10:18 2011 From: aahz at pythoncraft.com (Aahz) Date: Thu, 21 Jul 2011 21:10:18 -0700 Subject: [Pythonmac-SIG] Lion In-Reply-To: References: <71066.1311204206@parc.com> Message-ID: <20110722041018.GA15204@panix.com> On Thu, Jul 21, 2011, Ned Deily wrote: > > Although it's not practical to build packages with C extension modules > on 10.7 for the traditional 32-bit-only python.org Pythons (as explained > above), it is possible to build such packages with the same Python > installed on a 10.6, 10.5, or even 10.4 system, create a Distutils bdist > or setuptools/Distribute bdist-egg and then install the binary > distribution on the 10.7 system. I would avoid going down that path if > possible, unless it is needed as a temporary transition phase. Why? Isn't that the only way to get a multi-platform build? -- Aahz (aahz at pythoncraft.com) <*> http://www.pythoncraft.com/ "If you don't know what your program is supposed to do, you'd better not start writing it." --Dijkstra From ronaldoussoren at mac.com Fri Jul 22 07:49:25 2011 From: ronaldoussoren at mac.com (Ronald Oussoren) Date: Fri, 22 Jul 2011 07:49:25 +0200 Subject: [Pythonmac-SIG] Lion In-Reply-To: <20110722041018.GA15204@panix.com> References: <71066.1311204206@parc.com> <20110722041018.GA15204@panix.com> Message-ID: On 22 Jul, 2011, at 6:10, Aahz wrote: > On Thu, Jul 21, 2011, Ned Deily wrote: >> >> Although it's not practical to build packages with C extension modules >> on 10.7 for the traditional 32-bit-only python.org Pythons (as explained >> above), it is possible to build such packages with the same Python >> installed on a 10.6, 10.5, or even 10.4 system, create a Distutils bdist >> or setuptools/Distribute bdist-egg and then install the binary >> distribution on the 10.7 system. I would avoid going down that path if >> possible, unless it is needed as a temporary transition phase. > > Why? Isn't that the only way to get a multi-platform build? It is the only way to get a build that works with PPC systems, with some care you can binaries on 10.7 that work just fine earlier releases. To create binaries that work on 10.5 (or even 10.4) you'll need a new python install though, the Intel-only installer on python.org only supports 10.6 or later due to the Tkinter dependency. The hardest part w.r.t. binaries that run on earlier versions is that C software that uses a configure script might detect features on your build system that aren't available on earlier releases. Ronald > Aahz (aahz at pythoncraft.com) <*> http://www.pythoncraft.com/ > > "If you don't know what your program is supposed to do, you'd better not > start writing it." --Dijkstra > _______________________________________________ > Pythonmac-SIG maillist - Pythonmac-SIG at python.org > http://mail.python.org/mailman/listinfo/pythonmac-sig > unsubscribe: http://mail.python.org/mailman/options/Pythonmac-SIG -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 2224 bytes Desc: not available URL: From rowen at uw.edu Fri Jul 22 21:10:54 2011 From: rowen at uw.edu (Russell E. Owen) Date: Fri, 22 Jul 2011 12:10:54 -0700 Subject: [Pythonmac-SIG] Lion References: <71066.1311204206@parc.com> <20110722041018.GA15204@panix.com> Message-ID: In article , Ronald Oussoren wrote: > On 22 Jul, 2011, at 6:10, Aahz wrote: > > > On Thu, Jul 21, 2011, Ned Deily wrote: > >> > >> Although it's not practical to build packages with C extension modules > >> on 10.7 for the traditional 32-bit-only python.org Pythons (as explained > >> above), it is possible to build such packages with the same Python > >> installed on a 10.6, 10.5, or even 10.4 system, create a Distutils bdist > >> or setuptools/Distribute bdist-egg and then install the binary > >> distribution on the 10.7 system. I would avoid going down that path if > >> possible, unless it is needed as a temporary transition phase. > > > > Why? Isn't that the only way to get a multi-platform build? > > It is the only way to get a build that works with PPC systems, with some care > you can binaries on 10.7 that work just fine earlier releases. > > To create binaries that work on 10.5 (or even 10.4) you'll need a new > python install though, the Intel-only installer on python.org only supports > 10.6 or later due to the Tkinter dependency. > > The hardest part w.r.t. binaries that run on earlier versions is that C > software > that uses a configure script might detect features on your build system > that aren't available on earlier releases. > > Ronald Rob Manegan suggested another approach that I am considering: install the older SDKs on XCode 4.1. I found a link that provides clear instructions: Personally I'm happy to ditch PPC and MacOS X 10.4, but I'm not in a position to abandon MacOS X 10.5 users yet. However, from what you said it sounds as if the only way to build extensions with the 32-bit python.org python is to install the 10.4/ppc support. So I think my options (since I need to distribute an app that can run on 10.5 and later) are: - Install 10.4 support in XCode 4.1, as above. The main annoyance with this is the need to stay at gcc 4.0. - Build extensions on 10.6 or earlier. This is not a big deal because keep an old laptop around for this purpose due to unresolved backward compatibility issues building matplotlib and PIL binaries on 10.6. - Switch to ActiveState Python (since they offer a 10.5-and-later python and python.org sadly does not) or build my own. This involves a bit of licensing headache as I have to renew a free license every year. It sounds like any of these will work, but I'm looking forward to being able to ditch 10.5 support. -- Russell From nad at acm.org Fri Jul 22 22:29:31 2011 From: nad at acm.org (Ned Deily) Date: Fri, 22 Jul 2011 13:29:31 -0700 Subject: [Pythonmac-SIG] Lion References: <71066.1311204206@parc.com> <20110722041018.GA15204@panix.com> Message-ID: In article , "Russell E. Owen" wrote: > In article , > Ronald Oussoren wrote: > > > On 22 Jul, 2011, at 6:10, Aahz wrote: > > > > > On Thu, Jul 21, 2011, Ned Deily wrote: > > >> > > >> Although it's not practical to build packages with C extension modules > > >> on 10.7 for the traditional 32-bit-only python.org Pythons (as explained > > >> above), it is possible to build such packages with the same Python > > >> installed on a 10.6, 10.5, or even 10.4 system, create a Distutils bdist > > >> or setuptools/Distribute bdist-egg and then install the binary > > >> distribution on the 10.7 system. I would avoid going down that path if > > >> possible, unless it is needed as a temporary transition phase. > > > > > > Why? Isn't that the only way to get a multi-platform build? > > > > It is the only way to get a build that works with PPC systems, with some > > care > > you can binaries on 10.7 that work just fine earlier releases. > > > > To create binaries that work on 10.5 (or even 10.4) you'll need a new > > python install though, the Intel-only installer on python.org only supports > > 10.6 or later due to the Tkinter dependency. > > > > The hardest part w.r.t. binaries that run on earlier versions is that C > > software > > that uses a configure script might detect features on your build system > > that aren't available on earlier releases. > > > > Ronald > > Rob Manegan suggested another approach that I am considering: install > the older SDKs on XCode 4.1. > > I found a link that provides clear instructions: > > > Personally I'm happy to ditch PPC and MacOS X 10.4, but I'm not in a > position to abandon MacOS X 10.5 users yet. However, from what you said > it sounds as if the only way to build extensions with the 32-bit > python.org python is to install the 10.4/ppc support. > > So I think my options (since I need to distribute an app that can run on > 10.5 and later) are: > - Install 10.4 support in XCode 4.1, as above. The main annoyance with > this is the need to stay at gcc 4.0. Note those instructions were for installing both Xcodes on 10.6, not 10.7, and before Xcode 4.1 was released. So be cautious. But it should be possible to make it work on 10.7. But, of course, it's not something to recommend for the casual user. Also, IIRC, the big main reason we stayed with gcc-4.0 and the 10.4u SDK was that the 10.5 SDK did not support the PPC G3 machines (like the Pismo) which are supported by 10.4 (but not 10.5). If you don't need to support them, you may be able to get by with the 10.5 SDK. As it stands, the current 32-bit-only python.org installers will work on any Apple machine that was supported to run 10.3.9 through 10.7 (excluding the issue of extension building on 10.7 and probably 10.3 as well). > - Build extensions on 10.6 or earlier. This is not a big deal because > keep an old laptop around for this purpose due to unresolved backward > compatibility issues building matplotlib and PIL binaries on 10.6. This is probably the safest option. > - Switch to ActiveState Python (since they offer a 10.5-and-later python > and python.org sadly does not) or build my own. This involves a bit of > licensing headache as I have to renew a free license every year. Again, as long as you don't mind ditching 10.5 PPC users as the A/S Python distribution is Intel only, I believe. We discussed having a python.org 10.5+ 64-bit/32-bit installer; in fact, there was a 3-way universal for the original 2.7 release. But that was before there was a reasonable 64-bit Tk solution which unfortunately does not include PPC. We could look at going back to that for future releases but I think it is not a good idea at this point. There are other differences between 10.5 and 10.6 (missing API's, older libraries, etc); it would mean either not supporting some of the machines that can run 10.5 (PPC); and 10.6 is a much cleaner dividing line, IMO. That is, from the perspective of what Python needs from OS X, the gap between 10.5 and 10.6 is much wider than that between 10.6 and 10.7. We also have some important new options to explore for future releases, like moving from gcc to clang, among many other things. Given our very limited development and testing resources, I think the time is better spent looking to the future than more work on the past. For future releases (next year's 3.3 for instance), we'll need to look closely at just what we claim to support in the form of installers. Certainly, we won't want to break or remove support in the source for existing older platforms (10.3.9+) but clearly their importance is fading. -- Ned Deily, nad at acm.org From rowen at uw.edu Fri Jul 22 23:25:43 2011 From: rowen at uw.edu (Russell Owen) Date: Fri, 22 Jul 2011 14:25:43 -0700 Subject: [Pythonmac-SIG] py2app application fails with ImportError: No module named sysconfig In-Reply-To: References: Message-ID: <280EDC66-BE30-455F-A9FC-80349C6D537C@uw.edu> On Jul 20, 2011, at 3:31 PM, Russell E. Owen wrote: > I used py2app to build an application that i've been building for years, > only now it's failing at startup with the appended log. > > The problem is triggered by numpy 1.6.1fc3 (which I installed from > source). If I build using an older numpy I don't see the problem. > > However, the application runs just fine from the command line, so I'm > puzzled how it could be an actual bugin numpy. (If it is, though, now is > a great time to report it, before 1.6.1 is released). > > Any idea what might be causing this and how to avoid it? A google search > didn't turn up anything that looked relevant. > > -- Russell For some reason 1.6.1 release does not exhibit this problem. I tried the 32-bit binary installer and also installing from source and in both cases the application runs just fine. I verified yet again that 1.6.1rc3 shows the problem (by building it yet and then my app yet again). For every test I always delete numpy from site-packages before installing the next version. I don't know what happened with 1.6.1rc3, but I'm very relieved the bug is gone in 1.6.1 release. For those who are curious there are only four python files that are different between 1.6.1rc3 and 1.6.1 release (according to bbdiff). Of these the only change I can even imagine is relevant is this one: numpy/ctypeslib.py changes when this line is called (1.6.1rc3 did it right away; 1.6.1 moves it into the code); from numpy.distutils.misc_util import get_shared_lib_extension The others are: - numpy/polynomial/polytemplate.py one __str__ method and one __repr__ method changed - numpy/version.py: only version data changed - setup.py: only version data changed -- Russell From calion at mac.com Sat Jul 23 00:43:55 2011 From: calion at mac.com (Jim Syler) Date: Fri, 22 Jul 2011 17:43:55 -0500 Subject: [Pythonmac-SIG] Python for Tiger PPC I found your wonderful page at that has numpy and PIL for Tiger, which I can't find anywhere else, but I'm trying to run pymapper , which requires Python 2.6 or later (but not Python 3). Do these binaries exist anywhere? Or am I stuck trying to figure out how to build them? Thanks! Jim Message-ID: I found a wonderful page at that has numpy and PIL for Tiger, which I can't find anywhere else, but I'm trying to run pymapper , which requires Python 2.6 or later (but not Python 3). Do these binaries exist anywhere? Or am I stuck trying to figure out how to build them? Thanks! Jim -- A computer lets you make more mistakes faster than any invention in human history with the possible exceptions of handguns and tequila. -------------- next part -------------- An HTML attachment was scrubbed... URL: From nad at acm.org Sat Jul 23 02:07:14 2011 From: nad at acm.org (Ned Deily) Date: Fri, 22 Jul 2011 17:07:14 -0700 Subject: [Pythonmac-SIG] py2app application fails with ImportError: No module named sysconfig References: <280EDC66-BE30-455F-A9FC-80349C6D537C@uw.edu> Message-ID: In article <280EDC66-BE30-455F-A9FC-80349C6D537C at uw.edu>, Russell Owen wrote: > On Jul 20, 2011, at 3:31 PM, Russell E. Owen wrote: > > > I used py2app to build an application that i've been building for years, > > only now it's failing at startup with the appended log. > > > > The problem is triggered by numpy 1.6.1fc3 (which I installed from > > source). If I build using an older numpy I don't see the problem. > > > > However, the application runs just fine from the command line, so I'm > > puzzled how it could be an actual bugin numpy. (If it is, though, now is > > a great time to report it, before 1.6.1 is released). > > > > Any idea what might be causing this and how to avoid it? A google search > > didn't turn up anything that looked relevant. > > > > -- Russell > > For some reason 1.6.1 release does not exhibit this problem. I tried the > 32-bit binary installer and also installing from source and in both cases the > application runs just fine. > > I verified yet again that 1.6.1rc3 shows the problem (by building it yet and > then my app yet again). For every test I always delete numpy from > site-packages before installing the next version. > > I don't know what happened with 1.6.1rc3, but I'm very relieved the bug is > gone in 1.6.1 release. > > For those who are curious there are only four python files that are different > between 1.6.1rc3 and 1.6.1 release (according to bbdiff). Of these the only > change I can even imagine is relevant is this one: > > numpy/ctypeslib.py changes when this line is called (1.6.1rc3 did it right > away; 1.6.1 moves it into the code); > from numpy.distutils.misc_util import get_shared_lib_extension > > The others are: > - numpy/polynomial/polytemplate.py one __str__ method and one __repr__ method > changed > - numpy/version.py: only version data changed > - setup.py: only version data changed Ah, I hadn't noticed this in the traceback you initially posted but it appears that numpy has its own package named distutils that apparently supplants the normal Python distutils. That seems rather error prone! There are some differences in the latest Python 2.7 with how and when the real distutils.sysconfig is called. No doubt the change that moves the "from numpy.distutils.misc_util" import solves an import ambiguity somewhere so that the normal distutils.sysconfig is found and imported earlier. -- Ned Deily, nad at acm.org From lists at joshpowell.net Mon Jul 25 07:42:50 2011 From: lists at joshpowell.net (Josh Powell) Date: Mon, 25 Jul 2011 00:42:50 -0500 Subject: [Pythonmac-SIG] Pythonmac-SIG Digest, Vol 99, Issue 12 In-Reply-To: References: Message-ID: <96043967-9FB3-4CAE-B946-B8770FC6CC22@joshpowell.net> On Jul 21, 2011, at 6:27 P, pythonmac-sig-request at python.org wrote: > From: "Brendan Simon (eTRIX)" -snip- > I note that Lion EULA now permits use of up to 4 instances of the OS > running in Virutal Machines, so you be able to use OS X (10.6 or > 10.5 or 10.4) in a VM (VirtualBox, Parallels, VMWare, etc) to do > your PowerPC builds ?? Maybe over kill, but it's also not a bad way > to do some testing on the target OS :) From what I've seen the EULA allows only 2 VM instances, and it only seems to apply to Lion, not 10.4, 5, 6, 3, 2, or 1. I believe older versions' EULAs still apply to those versions, and it's my understanding that VMs are not allowed for older versions, except using server versions of OS X. I'm not an attorney, and I'm intending this as a caution and not legal advice. I would recommend carefully reading the relevant EULAs and/or consulting an attorney before running any version of OS X in a VM. Cheers, Josh -------------- next part -------------- An HTML attachment was scrubbed... URL: From Chris.Barker at noaa.gov Mon Jul 25 19:12:20 2011 From: Chris.Barker at noaa.gov (Christopher Barker) Date: Mon, 25 Jul 2011 10:12:20 -0700 Subject: [Pythonmac-SIG] Python for Tiger PPC I found your wonderful page at that has numpy and PIL for Tiger, which I can't find anywhere else, but I'm trying to run pymapper , which requires Python 2.6 or later (but not Python 3). Do these binaries exist anywhere? Or am I stuck trying to figure out how to build them? Thanks! Jim In-Reply-To: References: Message-ID: <4E2DA3F4.9050102@noaa.gov> Jim Syler wrote: > I found a wonderful page > at that has numpy > and PIL for Tiger, which I can't find anywhere else, As you've notices, that repository hasn't been maintained for years -- to bad. However, one reason it hasn't is that many package maintainers are providing binaries for OS-X themselves. You should be able to get numpy from the numpy site. As for PIL -- various folks have made OS-X binaries, and despite expressed interest, somehow they have never gotten put up on the PIL site. Most recently Russel Owen (on this list) has built PIL binaries and posted them on a site of his -- it's not a very public site, but some googling (or searching this and/or the PIL list) should find 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 uw.edu Mon Jul 25 23:13:28 2011 From: rowen at uw.edu (Russell E. Owen) Date: Mon, 25 Jul 2011 14:13:28 -0700 Subject: [Pythonmac-SIG] Python for Tiger PPC I found your wonderful page at that has numpy and PIL for Tiger, which I can't find anywhere else, but I'm trying to run pymapper , which requires Python 2.6 or later (but not Python 3). Do these binaries exist anywhere? Or am I stuck trying to figure out how to build them? Thanks! Jim References: <4E2DA3F4.9050102@noaa.gov> Message-ID: In article <4E2DA3F4.9050102 at noaa.gov>, Christopher Barker wrote: > Jim Syler wrote: > > I found a wonderful page > > at that has numpy > > and PIL for Tiger, which I can't find anywhere else, > > As you've notices, that repository hasn't been maintained for years -- > to bad. > > However, one reason it hasn't is that many package maintainers are > providing binaries for OS-X themselves. You should be able to get numpy > from the numpy site. > > As for PIL -- various folks have made OS-X binaries, and despite > expressed interest, somehow they have never gotten put up on the PIL site. > > Most recently Russel Owen (on this list) has built PIL binaries and > posted them on a site of his -- it's not a very public site, but some > googling (or searching this and/or the PIL list) should find it. Yes indeed. My PIL Mac binary installers are here: Regards, -- Russell P.S. Last November Fredrik Lundh said he would serve them, but it's never happened. I recently emailed him to check remind him, but no answer. Rather discouraging. From damiano.albani at gmail.com Thu Jul 28 18:17:17 2011 From: damiano.albani at gmail.com (Damiano ALBANI) Date: Thu, 28 Jul 2011 18:17:17 +0200 Subject: [Pythonmac-SIG] Issue with QTKit + CoreVideo usage Message-ID: Hello, In the context of prototyping a GStreamer plugin, I'm trying to use the QTKit API in Python to capture from a video source. On the overall, it works, I can grab frames and save them as files for instance. Now, I'd like to access low-level frame data but I didn't managed to do it in Python. I've uploaded a simple test case on "http://pastebin.com/kyhggtWM". Here are the kind of messages that I get, each time the function "captureOutput_..." is called: ... 2011-07-28 18:01:51.101 Python[446:580b] PyObjCPointer created: at 0x1033103d0 of type {__CVBuffer=}@@ 2011-07-28 18:01:51.102 Python[446:580b] *** Ignoring exception: Class OC_PythonObject: no such selector: _cfTypeID ... Any idea what I'm doing wrong here? I'm new to the world of PyObjC so I might be forgetting to import stuff or something trivial like that. BTW, I'm using Mac OS X 10.6.8. Thanks, -- Damiano ALBANI -------------- next part -------------- An HTML attachment was scrubbed... URL: From ronaldoussoren at mac.com Fri Jul 29 08:12:55 2011 From: ronaldoussoren at mac.com (Ronald Oussoren) Date: Fri, 29 Jul 2011 08:12:55 +0200 Subject: [Pythonmac-SIG] Issue with QTKit + CoreVideo usage In-Reply-To: References: Message-ID: On 28 Jul, 2011, at 18:17, Damiano ALBANI wrote: > Hello, > > In the context of prototyping a GStreamer plugin, I'm trying to use the QTKit API in Python to capture from a video source. > On the overall, it works, I can grab frames and save them as files for instance. > Now, I'd like to access low-level frame data but I didn't managed to do it in Python. > I've uploaded a simple test case on "http://pastebin.com/kyhggtWM". > Here are the kind of messages that I get, each time the function "captureOutput_..." is called: > > ... > 2011-07-28 18:01:51.101 Python[446:580b] PyObjCPointer created: at 0x1033103d0 of type {__CVBuffer=}@@ > 2011-07-28 18:01:51.102 Python[446:580b] *** Ignoring exception: Class OC_PythonObject: no such selector: _cfTypeID > ... > > Any idea what I'm doing wrong here? I'm new to the world of PyObjC so I might be forgetting to import stuff or something trivial like that. > BTW, I'm using Mac OS X 10.6.8. The test case looks correct, which means this is likely a problem with PyObjC's metadata (which describes features of the Cocoa API that cannot be extracted from the ObjC runtime). I'll look into this during the weekend. Ronald > > Thanks, > > -- > Damiano ALBANI > _______________________________________________ > Pythonmac-SIG maillist - Pythonmac-SIG at python.org > http://mail.python.org/mailman/listinfo/pythonmac-sig > unsubscribe: http://mail.python.org/mailman/options/Pythonmac-SIG -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 2224 bytes Desc: not available URL: From lists+Pythonmac-SIG at hoech.org Sun Jul 31 00:41:24 2011 From: lists+Pythonmac-SIG at hoech.org (=?UTF-8?B?RmxvcmlhbiBIw7ZjaA==?=) Date: Sun, 31 Jul 2011 00:41:24 +0200 Subject: [Pythonmac-SIG] OS X 10.7 Lion, py2app 0.6.3, argv-emulation, wxPython Message-ID: <4E348894.2050603@hoech.org> In 10.7, some functionality of the Carbon libraries is only available in 32-bit mode, but py2app created binaries run in 64-bit mode on Lion. In my case wx and py2app's argv-emulation feature needed Carbon functionality that isn't available in 64-bit mode, so I did work around this by replacing the binaries with 32-bit ones after the app was created. First, I used the official python.org Python 2.7 x86-64/i386 installer. Then I built my app with the 32-bit python: python2.7-32 setup.py p2app Then I replaced the binaries in the app: cp /Library/Python/2.7/site-packages/py2app-0.6.3-py2.7.egg/py2app/apptemplate/prebuilt/main-i386 /PATH/TO/APP/APPNAME.app/Contents/MacOS/APPNAME cp /Library/Frameworks/Python.framework/Versions/2.7/bin/python2.7-32 /PATH/TO/APP/APPNAME.app/Contents/MacOS/python Just thought I'd share my findings. Regards -- Florian H?ch From lists at hoech.net Sun Jul 31 00:39:58 2011 From: lists at hoech.net (=?UTF-8?B?RmxvcmlhbiBIw7ZjaA==?=) Date: Sun, 31 Jul 2011 00:39:58 +0200 Subject: [Pythonmac-SIG] OS X 10.7 Lion, py2app 0.6.3, argv-emulation, wxPython Message-ID: <4E34883E.8070309@hoech.net> In 10.7, some functionality of the Carbon libraries is only available in 32-bit mode, but py2app created binaries run in 64-bit mode on Lion. In my case wx and py2app's argv-emulation feature needed Carbon functionality that isn't available in 64-bit mode, so I did work around this by replacing the binaries with 32-bit ones after the app was created. First, I used the official python.org Python 2.7 x86-64/i386 installer. Then I built my app with the 32-bit python: python2.7-32 setup.py p2app Then I replaced the binaries in the app: cp /Library/Python/2.7/site-packages/py2app-0.6.3-py2.7.egg/py2app/apptemplate/prebuilt/main-i386 /PATH/TO/APP/APPNAME.app/Contents/MacOS/APPNAME cp /Library/Frameworks/Python.framework/Versions/2.7/bin/python2.7-32 /PATH/TO/APP/APPNAME.app/Contents/MacOS/python Just thought I'd share my findings. Regards -- Florian H?ch