From michaeldforzano at gmail.com Sun Jul 8 02:38:02 2012 From: michaeldforzano at gmail.com (Michael Forzano) Date: Sat, 07 Jul 2012 17:38:02 -0700 Subject: [Pythonmac-SIG] Problem Running App built with Py2App Message-ID: <4FF8D66A.60009@gmail.com> Hi All, I'm trying to build an app with Py2app. I'm on Python2.7 and Mac OSX 10.7. The error occurs on OSX 10.5 as well. The app builds successfully, but when running it in console with the command: rsg.app/Content/MacOS/rsg I get the following error: 2012-07-05 20:34:56.090 rsg[7483:707] rsg Error Does anyone know what's going on or how we might be able to get some more information, i.e. a stack trace? The app uses WXPython among other things. The app ran fine when built on 2.6, but due to our updated code depending on 2.7 this is no longer an option. If you guys need more info let me know, as this error isn't very descriptive so not sure where to even start looking for the cause. Thanks, Mike From jan.flyborg at gmail.com Sun Jul 8 19:07:40 2012 From: jan.flyborg at gmail.com (Jan Flyborg) Date: Sun, 8 Jul 2012 19:07:40 +0200 Subject: [Pythonmac-SIG] Problem Running App built with Py2App In-Reply-To: <4FF8D66A.60009@gmail.com> References: <4FF8D66A.60009@gmail.com> Message-ID: I am not an expert on py2app, per se, but the easiest way to solve problems like this, is normally to try to remove stuff from your build, just to see if you can make it work. Start with a minimal script and see if you can make it work and then add in more and more modules to see when the problem arrives. Also, "7483:707" looks like a line and column number, but since I do not have access to the code it is hard to tell. Maybe that is something you can investigate. Cheers //Jan Flyborg On Sun, Jul 8, 2012 at 2:38 AM, Michael Forzano wrote: > Hi All, > > I'm trying to build an app with Py2app. I'm on Python2.7 and Mac OSX 10.7. > The error occurs on OSX 10.5 as well. The app builds successfully, but when > running it in console with the command: > rsg.app/Content/MacOS/rsg > I get the following error: > 2012-07-05 20:34:56.090 rsg[7483:707] rsg Error > Does anyone know what's going on or how we might be able to get some more > information, i.e. a stack trace? The app uses WXPython among other things. > The app ran fine when built on 2.6, but due to our updated code depending on > 2.7 this is no longer an option. If you guys need more info let me know, as > this error isn't very descriptive so not sure where to even start looking > for the cause. > > Thanks, > Mike > _______________________________________________ > 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 -- Jan Flyborg CTO - Esentus Technology AB - www.esentus.com - +46 702 854132 (mobile) From ed.pataky at gmail.com Tue Jul 10 01:46:05 2012 From: ed.pataky at gmail.com (Ed Pataky) Date: Mon, 9 Jul 2012 18:46:05 -0500 Subject: [Pythonmac-SIG] question Message-ID: i have a mac where i installed python, and tornado web server .. i used py2app and created an executable which wraps my tornado kickoff script into an executable .. works ok sometimes, but i am confused about a couple things: 1) when i run the app, since it is essentially a command line script with no GUI, i see nothing, although i is running ... how can i create the app so that it opens the terminal and shows the output? 2) sometimes it gets blocked by the firewall and sometimes it does not .. i have manually gone in and added it to he allowed list in the firewall, then as soon as it tries to open a port, the firewall blocks it ... i am not sure how i did it but i got it work a few times, then sometimes it is blocked .. how can i make sure when i run the app, it has full permission without having to mess with the firewall setting ... for example, is there an admin option when making the executable? 3) Finally, i am not sure what is actually wrapped in the executable, using basic standard options without specifying libraries to load, etc .. will the executable have the tornado related libraries already there, or it will only run on a mac with tornado already installed ... ? my macs have tornado so i cannot test this unless i uninstall it ... i guess my question is, is it smart enough to know to include all the tornado stuff too? ed -------------- next part -------------- An HTML attachment was scrubbed... URL: From ronaldoussoren at mac.com Tue Jul 10 07:43:13 2012 From: ronaldoussoren at mac.com (Ronald Oussoren) Date: Tue, 10 Jul 2012 07:43:13 +0200 Subject: [Pythonmac-SIG] question In-Reply-To: References: Message-ID: On 10 Jul, 2012, at 1:46, Ed Pataky wrote: > i have a mac where i installed python, and tornado web server .. i used py2app and created an executable which wraps my tornado kickoff script into an executable .. works ok sometimes, but i am confused about a couple things: > > 1) when i run the app, since it is essentially a command line script with no GUI, i see nothing, although i is running ... how can i create the app so that it opens the terminal and shows the output? You cannot do that using py2app unless you capture stdout/stderr yourself and forward them a Window you create yourself. I don't know how easy it would be to this with Tornado. > > 2) sometimes it gets blocked by the firewall and sometimes it does not .. i have manually gone in and added it to he allowed list in the firewall, then as soon as it tries to open a port, the firewall blocks it ... i am not sure how i did it but i got it work a few times, then sometimes it is blocked .. how can i make sure when i run the app, it has full permission without having to mess with the firewall setting ... for example, is there an admin option when making the executable? Signing the generated app should help with this, although it should work without signing as well (although you'll have to reconfirm the firewall restriction every time you change the app when you don't sign). You don't need to use an Apple-provided key for this, any code-signing certificate should work including self-signed. > > 3) Finally, i am not sure what is actually wrapped in the executable, using basic standard options without specifying libraries to load, etc .. will the executable have the tornado related libraries already there, or it will only run on a mac with tornado already installed ... ? my macs have tornado so i cannot test this unless i uninstall it ... i guess my question is, is it smart enough to know to include all the tornado stuff too? Py2app includes all dependencies it can detect. I don't know if anyone has tried using py2app with tornado before. Py2app basicly looks for import statements in your script and includes all those modules as dependencies. It then does the same for all included modules as well until there is nothing more to add. At the end a seperate process looks for binary dependencies (that is, include the shared libraries used by python extension modules). There are 2 common ways this might fail to include everything you need: 1) Python module uses '__import__' or 'execfile' to load modules, those are hard to detect using the bytecode scanner used by py2app 2) C library uses data/configuration files Ronald > > ed > _______________________________________________ > 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: 4788 bytes Desc: not available URL: From wrw at mac.com Tue Jul 10 14:20:22 2012 From: wrw at mac.com (William R. Wing (Bill Wing)) Date: Tue, 10 Jul 2012 08:20:22 -0400 Subject: [Pythonmac-SIG] question In-Reply-To: References: Message-ID: <1781D22C-3211-45AB-965D-DA6F6BC6181C@mac.com> On Jul 9, 2012, at 7:46 PM, Ed Pataky wrote: > i have a mac where i installed python, and tornado web server .. i used py2app and created an executable which wraps my tornado kickoff script into an executable .. works ok sometimes, but i am confused about a couple things: > > 1) when i run the app, since it is essentially a command line script with no GUI, i see nothing, although i is running ... how can i create the app so that it opens the terminal and shows the output? > Strictly speaking you can't without a lot of extra trouble - BUT any print statements in your script will be logged to the system log and is then easily viewable in the Console app in your Utilities folder. > 2) sometimes it gets blocked by the firewall and sometimes it does not .. i have manually gone in and added it to he allowed list in the firewall, then as soon as it tries to open a port, the firewall blocks it ... i am not sure how i did it but i got it work a few times, then sometimes it is blocked .. how can i make sure when i run the app, it has full permission without having to mess with the firewall setting ... for example, is there an admin option when making the executable? Could you be a little more specific here - are you opening a port to listen for incoming sessions or are you trying to open an outbound session? Also, exactly which version of the OS are you running? Apple has been locking things down more and more in the progression from 10.6 to 10.7. -Bill From chris.barker at noaa.gov Tue Jul 10 17:45:55 2012 From: chris.barker at noaa.gov (Chris Barker) Date: Tue, 10 Jul 2012 08:45:55 -0700 Subject: [Pythonmac-SIG] Problem Running App built with Py2App In-Reply-To: <4FFBB456.9040700@gmail.com> References: <4FF8D66A.60009@gmail.com> <4FFBB456.9040700@gmail.com> Message-ID: it's best to keep this on the list (not the default reply option...) > What console app are you referring to? /Applications/Utilities/Console.app > When we built with 2.6, we were on > OSX 10.5, but since we're getting the same error of both OSX 10.5 and 10.7 > with Py 2.7 it seems that OS version is not the issue. are you building and running on the same OS version (at this point...) > We are using the > python.org distribution. > > I've thought it could be caused by a missing dependency, but regardless of > what options we pass to py2app running the app results in the same error. yup -- weird, if Console.app doesn't give you any more hints, you'll need to start from a small minimal app and work your way up... -Chris > > Mike > > > On 7/9/2012 10:40 AM, Chris Barker wrote: >> >> On Sat, Jul 7, 2012 at 5:38 PM, Michael Forzano >> wrote: >> >>> I'm trying to build an app with Py2app. I'm on Python2.7 and Mac OSX >>> 10.7. >>> The error occurs on OSX 10.5 as well. The app builds successfully, but >>> when >>> running it in console with the command: >>> rsg.app/Content/MacOS/rsg >>> I get the following error: >>> 2012-07-05 20:34:56.090 rsg[7483:707] rsg Error >>> Does anyone know what's going on or how we might be able to get some more >>> information, i.e. a stack trace? >> >> the Console app often report a more useful message when a py2app app >> crashes. >> >>> The app uses WXPython among other things. >>> The app ran fine when built on 2.6, but due to our updated code depending >>> on >>> 2.7 this is no longer an option. >> >> Were you building on OS-X 10.7 in both cases? >> >> Are you using the python.org build of python 2.7? >> >> Anyway, I'd make sure you have the latest py2app and its dependencies >> in the pyton you are using, and then do as suggested, start really >> simpel and slowly add more. >> >> py2app works fine for me with python2.7 and wxPython on OS-X 10.6 -- I >> haven't treid 10.7 yet. >> >> HTH, >> -Chris >> >> If you guys need more info let me know, as >>> >>> this error isn't very descriptive so not sure where to even start looking >>> for the cause. >>> >>> Thanks, >>> Mike >>> _______________________________________________ >>> 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 >> >> >> > -- 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 aranafireheart at mac.com Tue Jul 10 18:04:31 2012 From: aranafireheart at mac.com (Arana Fireheart) Date: Tue, 10 Jul 2012 12:04:31 -0400 Subject: [Pythonmac-SIG] PyQT on Lion? Message-ID: <2E549717-DA3E-45D8-AFDC-FBF7E216B65D@mac.com> Hi, I have been trying to build a version of Python and PyQT for some time now on my iMac (Core 2 Duo) running 10.7.4 I have not been able to get any configuration(s) to work properly. I am currently trying to build in a virtual environment using homebrew. I have two problems that I can not seem to resolve. First I can not seem to be able to figure out how to get pyserial to install properly. Also once if I try to comment out the import serial line, I'm told that python can't find PyQT. Any ideas? This is about the fourth build I have tried, and I can't seem to ever get ALL of the pieces to work on my mac (I've build successfully in Ubuntu, running under Paralells) Arana Before commenting out import serial: Aranas-BIG-Toy:GreenHouse arana$ python GreenHouse.pyw Traceback (most recent call last): File "GreenHouse.pyw", line 5, in import serial ImportError: No module named serial After commenting out import serial: Aranas-BIG-Toy:GreenHouse arana$ python GreenHouse.pyw Traceback (most recent call last): File "GreenHouse.pyw", line 6, in from PyQt4 import QtCore ImportError: No module named PyQt4 Aranas-BIG-Toy:GreenHouse arana$ Code snippet: #!/usr/bin/env python import os, sys import serial from PyQt4 import QtCore from PyQt4 import QtGui from greenHouse_ui import Ui_MainWindow import GreenHouse_rc arana$ echo $PATH /usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin:/Library/Frameworks/Python.framework/Versions/Current/bin arana$ echo $PYTHONPATH /usr/local/lib/python: arana$ python Python 2.7.1 (r271:86832, Jul 31 2011, 19:30:53) [GCC 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2335.15.00)] on darwin Type "help", "copyright", "credits" or "license" for more information. From charlie.clark at clark-consulting.eu Tue Jul 10 19:37:15 2012 From: charlie.clark at clark-consulting.eu (Charlie Clark) Date: Tue, 10 Jul 2012 19:37:15 +0200 Subject: [Pythonmac-SIG] PyQT on Lion? In-Reply-To: <2E549717-DA3E-45D8-AFDC-FBF7E216B65D@mac.com> References: <2E549717-DA3E-45D8-AFDC-FBF7E216B65D@mac.com> Message-ID: Am 10.07.2012, 18:04 Uhr, schrieb Arana Fireheart : > Hi, > I have been trying to build a version of Python and PyQT for some time > now on my iMac (Core 2 Duo) running 10.7.4 > I have not been able to get any configuration(s) to work properly. I am > currently trying to build in a virtual environment using homebrew. > I have two problems that I can not seem to resolve. First I can not > seem to be able to figure out how to get pyserial to install properly. > Also once if I try to comment out the import serial line, I'm told that > python can't find PyQT. Any ideas? This is about the fourth build I have > tried, and I can't seem to ever get ALL of the pieces to work on my mac > (I've build successfully in Ubuntu, running under Paralells) I think the virtualenv might be a challenge. PyQT works fine on Lion and it did on Snow Leopard. I know you're using Homebrew but you might want to try using the MacPorts version because it will install the binary and save you a heck of a build time. I use it to build LinkChecker on Mac OS. Charlie -- Charlie Clark Managing Director Clark Consulting & Research German Office Kronenstr. 27a D?sseldorf D- 40217 Tel: +49-211-600-3657 Mobile: +49-178-782-6226 From aranafireheart at mac.com Wed Jul 11 14:41:18 2012 From: aranafireheart at mac.com (Arana Fireheart) Date: Wed, 11 Jul 2012 08:41:18 -0400 Subject: [Pythonmac-SIG] PyQT on Lion? (Charlie Clark) In-Reply-To: References: Message-ID: <6BFB1100-46D9-4624-AFF5-6E05CA342F77@mac.com> Charlie, I tried virtualenv after reading lots of people extolling it's virtues. Having had little luck with other methods I thought I would give it a try. I have managed to get this all built on my MacBookPro which is running Snow Leopard, but not on my desktop machine (iMac). HomeBrew lists PyQT as installed, but when I try to run some code it fails with a "can't find module". What I don't get is why python can't locate the installed modules. Do you have any hints as to how I can track this down? Arana On Jul 11, 2012, at 6:00 AM, pythonmac-sig-request at python.org wrote: > > From: "Charlie Clark" > Subject: Re: [Pythonmac-SIG] PyQT on Lion? > Date: July 10, 2012 1:37:15 PM EDT > To: pythonmac-sig at python.org > > > Am 10.07.2012, 18:04 Uhr, schrieb Arana Fireheart : > >> Hi, >> I have been trying to build a version of Python and PyQT for some time now on my iMac (Core 2 Duo) running 10.7.4 >> I have not been able to get any configuration(s) to work properly. I am currently trying to build in a virtual environment using homebrew. >> I have two problems that I can not seem to resolve. First I can not seem to be able to figure out how to get pyserial to install properly. Also once if I try to comment out the import serial line, I'm told that python can't find PyQT. Any ideas? This is about the fourth build I have tried, and I can't seem to ever get ALL of the pieces to work on my mac (I've build successfully in Ubuntu, running under Paralells) > > I think the virtualenv might be a challenge. PyQT works fine on Lion and it did on Snow Leopard. I know you're using Homebrew but you might want to try using the MacPorts version because it will install the binary and save you a heck of a build time. I use it to build LinkChecker on Mac OS. > > Charlie > -- -------------- next part -------------- An HTML attachment was scrubbed... URL: From charlie.clark at clark-consulting.eu Wed Jul 11 22:19:31 2012 From: charlie.clark at clark-consulting.eu (Charlie Clark) Date: Wed, 11 Jul 2012 22:19:31 +0200 Subject: [Pythonmac-SIG] PyQT on Lion? (Charlie Clark) In-Reply-To: <6BFB1100-46D9-4624-AFF5-6E05CA342F77@mac.com> References: <6BFB1100-46D9-4624-AFF5-6E05CA342F77@mac.com> Message-ID: Am 11.07.2012, 14:41 Uhr, schrieb Arana Fireheart : > Charlie, > I tried virtualenv after reading lots of people extolling it's virtues. > Having had little luck with other methods I thought I would give it a > try. I have managed to get this all built on my MacBookPro which is > running Snow Leopard, but not on my desktop machine (iMac). HomeBrew > lists PyQT as installed, but when I try to run some code it fails with a > "can't find module". > What I don't get is why python can't locate the installed modules. Do > you have any hints as to how I can track this down? Hi Arana, virtualenv's are indeed a great idea. They allow you to isolate the libraries for different projects from each other. However, if you are using libraries that need compiling then it can be better to use "system" libraries. You can do this in a virtualenv with the switch "--system-site-packages" Charlie -- Charlie Clark Managing Director Clark Consulting & Research German Office Kronenstr. 27a D?sseldorf D- 40217 Tel: +49-211-600-3657 Mobile: +49-178-782-6226 From thomas.robitaille at gmail.com Mon Jul 16 16:07:36 2012 From: thomas.robitaille at gmail.com (Thomas Robitaille) Date: Mon, 16 Jul 2012 16:07:36 +0200 Subject: [Pythonmac-SIG] Bundling zmq with py2app Message-ID: Hi everyone, I am trying to build a MacOS X application using py2app, and am running into issues with the python zmq module. For example, if I have a setup.py script with: from setuptools import setup OPTIONS = { 'argv_emulation': False, 'includes': ['zmq'], 'excludes': [], } setup( app=['test.py'], data_files=[], options={'py2app': OPTIONS}, setup_requires=['py2app'], ) and test.py contains: import zmq.core.constants and I build with: python setup.py py2app then I get the following exception when trying to launch the resulting .app file: Traceback (most recent call last): File "/Users/tom/Dropbox/zmq/dist/test.app/Contents/Resources/__boot__.py", line 39, in _run('test.py') File "/Users/tom/Dropbox/zmq/dist/test.app/Contents/Resources/__boot__.py", line 36, in _run execfile(path, globals(), globals()) File "/Users/tom/Dropbox/zmq/dist/test.app/Contents/Resources/test.py", line 1, in import zmq.core.constants File "zmq/__init__.pyc", line 29, in File "zmq/core/__init__.pyc", line 26, in File "zmq/core/error.pyc", line 18, in File "zmq/core/error.pyc", line 11, in __load File "error.pyx", line 34, in init zmq.core.error (zmq/core/error.c:1195) ImportError: No module named strtypes Does anyone have any idea how to get this working? Thanks! Tom From ronaldoussoren at mac.com Mon Jul 16 17:04:32 2012 From: ronaldoussoren at mac.com (Ronald Oussoren) Date: Mon, 16 Jul 2012 17:04:32 +0200 Subject: [Pythonmac-SIG] Bundling zmq with py2app In-Reply-To: References: Message-ID: On 16 Jul, 2012, at 16:07, Thomas Robitaille wrote: > Hi everyone, > > I am trying to build a MacOS X application using py2app, and am > running into issues with the python zmq module. For example, if I have > a setup.py script with: Which zmq module? There are at least 2 different 0MQ bindings on PyPI. If I install 'pyzmq' I get a different error than you, the libzmq.dylib was not present when I started the binary. A quick fix is to change 'includes' to 'packages' in the OPTIONS dictionary. Ronald -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 4788 bytes Desc: not available URL: From ronaldoussoren at mac.com Mon Jul 16 17:16:39 2012 From: ronaldoussoren at mac.com (Ronald Oussoren) Date: Mon, 16 Jul 2012 17:16:39 +0200 Subject: [Pythonmac-SIG] Bundling zmq with py2app In-Reply-To: References: Message-ID: On 16 Jul, 2012, at 17:04, Ronald Oussoren wrote: > > On 16 Jul, 2012, at 16:07, Thomas Robitaille wrote: > >> Hi everyone, >> >> I am trying to build a MacOS X application using py2app, and am >> running into issues with the python zmq module. For example, if I have >> a setup.py script with: > > Which zmq module? There are at least 2 different 0MQ bindings on PyPI. > > If I install 'pyzmq' I get a different error than you, the libzmq.dylib was not present > when I started the binary. A quick fix is to change 'includes' to 'packages' in > the OPTIONS dictionary. The next py2app release will contain a recipe that ensures that pyzmq works without mentioning it setup.py. Ronald -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 4788 bytes Desc: not available URL: From aranafireheart at mac.com Mon Jul 16 22:51:21 2012 From: aranafireheart at mac.com (Arana Fireheart) Date: Mon, 16 Jul 2012 16:51:21 -0400 Subject: [Pythonmac-SIG] PyQT on Lion? (Charlie Clark) In-Reply-To: References: Message-ID: Charlie, Thanks for the response. Part of the reason I was trying to use virtualenv was to 'disconnect' from a few years of builds (some successful/ some unsuccessful). I was hoping to avoid doing a 'clean install' of my machine and reinstall of of the apps etc. The latest attempt is to perform a 'new' install of PyQT and then copy the site-packages directory into the virtual environment (or possibly sym link it). I think this one shows the most promise for getting an environment that will not only run my PyQT apps but allow me to build a distribution version with py2app (which I have NEVER managed to be able to do!!) I'll let you all know how it goes, Iv'e got my finger's crossed! Arana On Jul 12, 2012, at 6:00 AM, pythonmac-sig-request at python.org wrote: > Am 11.07.2012, 14:41 Uhr, schrieb Arana Fireheart : > >> Charlie, >> I tried virtualenv after reading lots of people extolling it's virtues. Having had little luck with other methods I thought I would give it a try. I have managed to get this all built on my MacBookPro which is running Snow Leopard, but not on my desktop machine (iMac). HomeBrew lists PyQT as installed, but when I try to run some code it fails with a "can't find module". >> What I don't get is why python can't locate the installed modules. Do you have any hints as to how I can track this down? > > Hi Arana, > > virtualenv's are indeed a great idea. They allow you to isolate the > libraries for different projects from each other. However, if you are > using libraries that need compiling then it can be better to use "system" > libraries. You can do this in a virtualenv with the switch "--system-site-packages" > > Charlie > -- > Charlie Clark > Managing Director > Clark Consulting & Research > German Office > Kronenstr. 27a > D?sseldorf > D- 40217 > Tel: +49-211-600-3657 > Mobile: +49-178-782-6226 > > > > unsubscribe: http://mail.python.org/mailman/options/Pythonmac-SIG From thomas.robitaille at gmail.com Mon Jul 16 22:55:13 2012 From: thomas.robitaille at gmail.com (Thomas Robitaille) Date: Mon, 16 Jul 2012 22:55:13 +0200 Subject: [Pythonmac-SIG] Bundling zmq with py2app In-Reply-To: References: Message-ID: Hi Ronald, > Which zmq module? There are at least 2 different 0MQ bindings on PyPI. I'm using pyzmq. > If I install 'pyzmq' I get a different error than you, the libzmq.dylib was not present > when I started the binary. A quick fix is to change 'includes' to 'packages' in > the OPTIONS dictionary. This works, thanks! What exactly is the difference between 'includes' and 'packages'? Thanks, Tom From michael.mccracken at gmail.com Mon Jul 16 23:39:09 2012 From: michael.mccracken at gmail.com (Michael McCracken) Date: Mon, 16 Jul 2012 16:39:09 -0500 Subject: [Pythonmac-SIG] PyQT on Lion? (Charlie Clark) In-Reply-To: References: Message-ID: Arana, please feel free to ask here about any questions building distributable apps with PyQt - I'm currently working on this and I might be able to share some workarounds I've had to use. Also, I'd suggest you use the current development version of py2app, which has some related changes. For example, see an earlier thread about needing to create a qt.conf file in the app bundle to avoid plugin warnings and potential crashes: http://mail.python.org/pipermail/pythonmac-sig/2012-May/023569.html -mike On Mon, Jul 16, 2012 at 3:51 PM, Arana Fireheart wrote: > Charlie, > > Thanks for the response. Part of the reason I was trying to use virtualenv was to 'disconnect' from a few years of builds (some successful/ some unsuccessful). I was hoping to avoid doing a 'clean install' of my machine and reinstall of of the apps etc. > > The latest attempt is to perform a 'new' install of PyQT and then copy the site-packages directory into the virtual environment (or possibly sym link it). I think this one shows the most promise for getting an environment that will not only run my PyQT apps but allow me to build a distribution version with py2app (which I have NEVER managed to be able to do!!) > > I'll let you all know how it goes, Iv'e got my finger's crossed! > > Arana > > > > On Jul 12, 2012, at 6:00 AM, pythonmac-sig-request at python.org wrote: > >> Am 11.07.2012, 14:41 Uhr, schrieb Arana Fireheart : >> >>> Charlie, >>> I tried virtualenv after reading lots of people extolling it's virtues. Having had little luck with other methods I thought I would give it a try. I have managed to get this all built on my MacBookPro which is running Snow Leopard, but not on my desktop machine (iMac). HomeBrew lists PyQT as installed, but when I try to run some code it fails with a "can't find module". >>> What I don't get is why python can't locate the installed modules. Do you have any hints as to how I can track this down? >> >> Hi Arana, >> >> virtualenv's are indeed a great idea. They allow you to isolate the >> libraries for different projects from each other. However, if you are >> using libraries that need compiling then it can be better to use "system" >> libraries. You can do this in a virtualenv with the switch "--system-site-packages" >> >> Charlie >> -- >> Charlie Clark >> Managing Director >> Clark Consulting & Research >> German Office >> Kronenstr. 27a >> D?sseldorf >> D- 40217 >> Tel: +49-211-600-3657 >> Mobile: +49-178-782-6226 >> >> >> >> unsubscribe: http://mail.python.org/mailman/options/Pythonmac-SIG > > _______________________________________________ > 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 ronaldoussoren at mac.com Mon Jul 16 23:06:23 2012 From: ronaldoussoren at mac.com (Ronald Oussoren) Date: Mon, 16 Jul 2012 23:06:23 +0200 Subject: [Pythonmac-SIG] Bundling zmq with py2app In-Reply-To: References: Message-ID: On 16 jul. 2012, at 22:55, Thomas Robitaille wrote: > Hi Ronald, > >> Which zmq module? There are at least 2 different 0MQ bindings on PyPI. > > I'm using pyzmq. > >> If I install 'pyzmq' I get a different error than you, the libzmq.dylib was not present >> when I started the binary. A quick fix is to change 'includes' to 'packages' in >> the OPTIONS dictionary. > > This works, thanks! What exactly is the difference between 'includes' > and 'packages'? Includes tells py2app that a module should be included, as if there is an import statement for that module. Packages tells py2app to include an entire package, and to not include it in the zip file. "includes" should only be necessary to specify dependencies that cannot be found by looking for import statements, for example for modules that are imported from C code. Ronald > > Thanks, > Tom From livingstonemark at gmail.com Tue Jul 17 02:18:42 2012 From: livingstonemark at gmail.com (Mark Livingstone) Date: Tue, 17 Jul 2012 10:18:42 +1000 Subject: [Pythonmac-SIG] Py2app error Message-ID: Hello, Using both EPD 7.3 academic and free, I have tried to use py2app to make an installer. This is the first time I have tried to do this. I will ask on their mailing list as well. My setup.py script looks like this: import wx import sys # Application Information APP = "salstat.py" NAME = 'SalStat' VERSION = '2.2' PACKAGES = [''] URL = 'http://code.google.com/p/salstat-statistics-package-2/' LICENSE = 'GPL 2' AUTHOR = 'Sebastian' AUTHOR_EMAIL = 'selobu at gmail.com' DESCRIPTION = 'Statistics Package' YEAR = 2012 # End of Application Information def BuildOSXApp(): """ Build the OSX Applet """ from setuptools import setup # py2app uses this to generate the plist xml for the applet copyright = "Copyright %s %s" % (AUTHOR, YEAR) appid = "com.%s.%s" % (NAME, NAME) PLIST = dict(CFBundleName = NAME, CFBundleIconFile = 'salstat.ico', CFBundleShortVersionString = VERSION, CFBundleGetInfoString = NAME + " " + VERSION, CFBundleExecutable = NAME, CFBundleIdentifier = appid, CFBundleTypeMIMETypes = ['text/plain'], CFBundleDevelopmentRegion = 'English', NSHumanReadableCopyright = copyright ) PY2APP_OPTS = dict(iconfile = "salstat.ico", argv_emulation = True, plist = PLIST) setup( app = [APP,], version = VERSION, options = dict( py2app = PY2APP_OPTS), description = NAME, author = AUTHOR, author_email = AUTHOR_EMAIL, url = URL, setup_requires = ['py2app'], ) if __name__ == '__main__': if wx.Platform == '__WXMAC__': # OS X BuildOSXApp() else: print "Unsupported platform: %s" % wx.Platform When I run it, it starts off fine and seems to work until it quits like this: creating /Users/mlivingstone/Documents/workspace/salstat-statistics-package-2/src/dist/SalStat.app/Contents/Resources/lib/python2.7/lib-dynload/PIL creating /Users/mlivingstone/Documents/workspace/salstat-statistics-package-2/src/dist/SalStat.app/Contents/Resources/lib/python2.7/lib-dynload/wx copying /Library/Frameworks/Python.framework/Versions/7.3/Resources/Python.app/Contents/MacOS/Python -> /Users/mlivingstone/Documents/workspace/salstat-statistics-package-2/src/dist/SalStat.app/Contents/MacOS/python creating /Users/mlivingstone/Documents/workspace/salstat-statistics-package-2/src/dist/SalStat.app/Contents/Frameworks/Python.framework creating /Users/mlivingstone/Documents/workspace/salstat-statistics-package-2/src/dist/SalStat.app/Contents/Frameworks/Python.framework/Versions creating /Users/mlivingstone/Documents/workspace/salstat-statistics-package-2/src/dist/SalStat.app/Contents/Frameworks/Python.framework/Versions/7.3 creating /Users/mlivingstone/Documents/workspace/salstat-statistics-package-2/src/dist/SalStat.app/Contents/Frameworks/Python.framework/Versions/7.3/Resources creating /Users/mlivingstone/Documents/workspace/salstat-statistics-package-2/src/dist/SalStat.app/Contents/Frameworks/Python.framework/Versions/7.3/include creating /Users/mlivingstone/Documents/workspace/salstat-statistics-package-2/src/dist/SalStat.app/Contents/Frameworks/Python.framework/Versions/7.3/include/python2.7 creating /Users/mlivingstone/Documents/workspace/salstat-statistics-package-2/src/dist/SalStat.app/Contents/Frameworks/Python.framework/Versions/7.3/lib creating /Users/mlivingstone/Documents/workspace/salstat-statistics-package-2/src/dist/SalStat.app/Contents/Frameworks/Python.framework/Versions/7.3/lib/python7.3 creating /Users/mlivingstone/Documents/workspace/salstat-statistics-package-2/src/dist/SalStat.app/Contents/Frameworks/Python.framework/Versions/7.3/lib/python7.3/config copying /Library/Frameworks/Python.framework/Versions/7.3/Python -> /Users/mlivingstone/Documents/workspace/salstat-statistics-package-2/src/dist/SalStat.app/Contents/Frameworks/Python.framework/Versions/7.3 copying /Library/Frameworks/Python.framework/Versions/7.3/Resources/Info.plist -> /Users/mlivingstone/Documents/workspace/salstat-statistics-package-2/src/dist/SalStat.app/Contents/Frameworks/Python.framework/Versions/7.3/Resources copying /Library/Frameworks/Python.framework/Versions/7.3/include/python2.7/pyconfig.h -> /Users/mlivingstone/Documents/workspace/salstat-statistics-package-2/src/dist/SalStat.app/Contents/Frameworks/Python.framework/Versions/7.3/include/python2.7 error: can't copy '/Library/Frameworks/Python.framework/Versions/7.3/lib/python7.3/config/Makefile': doesn't exist or not a regular file Looking back through the mile of screen space I have snipped, it seems to have successfully found all the other dependencies like wx, numpy, scipy etc. When I check, indeed that file (Makefile) does not exist at that location. Thanks in advance for any help! MarkL From ronaldoussoren at mac.com Tue Jul 17 07:49:29 2012 From: ronaldoussoren at mac.com (Ronald Oussoren) Date: Tue, 17 Jul 2012 07:49:29 +0200 Subject: [Pythonmac-SIG] Py2app error In-Reply-To: References: Message-ID: <1B26E03E-9503-49F6-9D12-EDE83E001E6B@mac.com> On 17 Jul, 2012, at 2:18, Mark Livingstone wrote: > Hello, > > Using both EPD 7.3 academic and free, I have tried to use py2app to > make an installer. This is the first time I have tried to do this. I > will ask on their mailing list as well. I guess I'll have to download EPD to test this, but it looks like EPD has a Python.framework where the framework version is different from the Python version, and parts of py2app assume they are the same (which it why copying pyconfig.h succeeds but copying Makefile fails). Ronald -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 4788 bytes Desc: not available URL: From michael.mccracken at gmail.com Tue Jul 17 20:03:37 2012 From: michael.mccracken at gmail.com (Michael McCracken) Date: Tue, 17 Jul 2012 13:03:37 -0500 Subject: [Pythonmac-SIG] Question about py2app packages and includes options Message-ID: I am trying to package a main .app with helper apps in Main.app/Resources/Helper.app, and I want to have a single Resources/lib directory and a single Frameworks/ directory to cut down on space. So I'm tweaking the main app's includes and packages options to get all the dependencies in one place, and relying on the automatic logic won't work. My question is: why does 'packages' copy the package recursively, but not into the .zip, while 'includes' only gets single modules? I was expecting packages to put the whole package in the .zip, and I didn't find any explanation in the docs. This is a minor point, since it works fine with 'packages' doing what it does, it'd just be nice to get them into the zip. Thanks, -mike From chris.barker at noaa.gov Wed Jul 18 00:25:46 2012 From: chris.barker at noaa.gov (Chris Barker) Date: Tue, 17 Jul 2012 15:25:46 -0700 Subject: [Pythonmac-SIG] Question about py2app packages and includes options In-Reply-To: References: Message-ID: On Tue, Jul 17, 2012 at 11:03 AM, Michael McCracken > My question is: why does 'packages' copy the package recursively, but > not into the .zip, because there are packages that don't work right if zipped -- so this gets around that. > while 'includes' only gets single modules? I suspect it's because there should be a way to include a particular module without the whole package. Essentially: "includes" adds a module to list, just as thought there were an "import module name" line in the code -- it is used to cover dynamic imports that won't be caught by walking the code. "packages" makes na compete copy of the package, and puts it outside the zip bundle -- this is fro including packages that have auxiliary files, etc, and/or can't be zipped for other reasons. It's a big ugly, but I've managed to put packages into the zip with something like this: includes = ["package", "package.subpackage" "package.subpackage.module1" "package.subpackage.module2" ] for some reason (is it a bug? -- or has it been fixed?) doing: includes = [ "package.subpackage.module"] puts module in the root, so it's there but can't be imported the same way. HTH, - 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 Tue Jul 17 19:26:26 2012 From: chris.barker at noaa.gov (Chris Barker) Date: Tue, 17 Jul 2012 10:26:26 -0700 Subject: [Pythonmac-SIG] Py2app error In-Reply-To: <1B26E03E-9503-49F6-9D12-EDE83E001E6B@mac.com> References: <1B26E03E-9503-49F6-9D12-EDE83E001E6B@mac.com> Message-ID: On Mon, Jul 16, 2012 at 10:49 PM, Ronald Oussoren wrote > I guess I'll have to download EPD to test this, but it looks like EPD has a Python.framework where the framework version is different from the Python version, and parts of py2app assume they are the same (which it why copying pyconfig.h succeeds but copying Makefile fails). Also -- check the license on the version(s) of EPD you are using -- you may not be free to re-distribute in this way anyway -- at least that used to be the case. -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 michael.mccracken at gmail.com Wed Jul 18 00:49:09 2012 From: michael.mccracken at gmail.com (Michael McCracken) Date: Tue, 17 Jul 2012 17:49:09 -0500 Subject: [Pythonmac-SIG] Question about py2app packages and includes options In-Reply-To: References: Message-ID: On Tue, Jul 17, 2012 at 5:25 PM, Chris Barker wrote: > On Tue, Jul 17, 2012 at 11:03 AM, Michael McCracken > >> My question is: why does 'packages' copy the package recursively, but >> not into the .zip, > > because there are packages that don't work right if zipped -- so this > gets around that. That makes sense - but as you mention, it seems like there's some missing functionality. >> while 'includes' only gets single modules? > > I suspect it's because there should be a way to include a particular > module without the whole package. Essentially: > > "includes" adds a module to list, just as thought there were an > "import module name" line in the code -- it is used to cover dynamic > imports that won't be caught by walking the code. > > "packages" makes na compete copy of the package, and puts it outside > the zip bundle -- this is fro including packages that have auxiliary > files, etc, and/or can't be zipped for other reasons. > > It's a big ugly, but I've managed to put packages into the zip with > something like this: > > includes = ["package", > "package.subpackage" > "package.subpackage.module1" > "package.subpackage.module2" > ] > > for some reason (is it a bug? -- or has it been fixed?) doing: > > includes = [ "package.subpackage.module"] > > puts module in the root, so it's there but can't be imported the same way. I don't have time to test, but I think that's been fixed. However, it's no fun if you have a lot of subpackages to add that way. For what it's worth, the approach I'm now taking is to create the full packages for each helper app, then just directly add the missing files in site-packages.zip and lib-dynload from the helper into the main app. Using ZipFile, it's not too bad. I looked at the source for how py2app uses modulegraph, to see if I could just generate the dependencies for the sub apps and pass them as the 'includes' for the main app, but that seemed involved enough that I ended up doing the above. -mike > HTH, > > - 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 > unsubscribe: http://mail.python.org/mailman/options/Pythonmac-SIG From livingstonemark at gmail.com Wed Jul 18 04:39:55 2012 From: livingstonemark at gmail.com (Mark Livingstone) Date: Wed, 18 Jul 2012 12:39:55 +1000 Subject: [Pythonmac-SIG] Py2app error In-Reply-To: References: <1B26E03E-9503-49F6-9D12-EDE83E001E6B@mac.com> Message-ID: Hi Chris, In the latest couple of releases, they have brought out a cut down EPD-Free which gets round that issue. It installs their python and Numpy, Scipy, IPython, matplotlib, traits & chaco so you end up getting wx / qt as well. Cheers, MArkL On 18 July 2012 03:26, Chris Barker wrote: > On Mon, Jul 16, 2012 at 10:49 PM, Ronald Oussoren wrote > >> I guess I'll have to download EPD to test this, but it looks like EPD has a Python.framework where the framework version is different from the Python version, and parts of py2app assume they are the same (which it why copying pyconfig.h succeeds but copying Makefile fails). > > Also -- check the license on the version(s) of EPD you are using -- > you may not be free to re-distribute in this way anyway -- at least > that used to be the case. > > -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 livingstonemark at gmail.com Wed Jul 18 04:48:41 2012 From: livingstonemark at gmail.com (Mark Livingstone) Date: Wed, 18 Jul 2012 12:48:41 +1000 Subject: [Pythonmac-SIG] Py2app error In-Reply-To: <1B26E03E-9503-49F6-9D12-EDE83E001E6B@mac.com> References: <1B26E03E-9503-49F6-9D12-EDE83E001E6B@mac.com> Message-ID: Hi Ronald, I Played a but further? With a bit of terminal foo, I changed to the Apple python. I blew away DIST & Build and tried again. What I found is that because the EPD directories were still at the beginning of my path, it still tried to access that Makefile instead of looking for the Apple Python related files :-( So I got rid of the EPD paths, and the MAc Port paths, and now it seems there is no wx module to import under Apple Python! I think I will have to play with MAc Ports, and see if I can get those ducks in a row and try again! Cheers, MArkL On 17 July 2012 15:49, Ronald Oussoren wrote: > > On 17 Jul, 2012, at 2:18, Mark Livingstone wrote: > >> Hello, >> >> Using both EPD 7.3 academic and free, I have tried to use py2app to >> make an installer. This is the first time I have tried to do this. I >> will ask on their mailing list as well. > > I guess I'll have to download EPD to test this, but it looks like EPD has a Python.framework where the framework version is different from the Python version, and parts of py2app assume they are the same (which it why copying pyconfig.h succeeds but copying Makefile fails). > > Ronald From ronaldoussoren at mac.com Wed Jul 18 10:30:46 2012 From: ronaldoussoren at mac.com (Ronald Oussoren) Date: Wed, 18 Jul 2012 10:30:46 +0200 Subject: [Pythonmac-SIG] Py2app error In-Reply-To: References: <1B26E03E-9503-49F6-9D12-EDE83E001E6B@mac.com> Message-ID: <78120967-6CD5-4BD0-8B50-FF50150DC4C8@mac.com> On 18 Jul, 2012, at 4:48, Mark Livingstone wrote: > Hi Ronald, > > I Played a but further? > > With a bit of terminal foo, I changed to the Apple python. I blew away > DIST & Build and tried again. What I found is that because the EPD > directories were still at the beginning of my path, it still tried to > access that Makefile instead of looking for the Apple Python related > files :-( > > So I got rid of the EPD paths, and the MAc Port paths, and now it > seems there is no wx module to import under Apple Python! > > I think I will have to play with MAc Ports, and see if I can get those > ducks in a row and try again! Fixing this in py2app should be fairly easy, I won't have time to look into this until later this week though. Ronald -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 4788 bytes Desc: not available URL: From ronaldoussoren at mac.com Wed Jul 18 12:07:27 2012 From: ronaldoussoren at mac.com (Ronald Oussoren) Date: Wed, 18 Jul 2012 12:07:27 +0200 Subject: [Pythonmac-SIG] Question about py2app packages and includes options In-Reply-To: References: Message-ID: On 18 Jul, 2012, at 0:25, Chris Barker wrote: > > > It's a big ugly, but I've managed to put packages into the zip with > something like this: > > includes = ["package", > "package.subpackage" > "package.subpackage.module1" > "package.subpackage.module2" > ] > > for some reason (is it a bug? -- or has it been fixed?) doing: > > includes = [ "package.subpackage.module"] > > puts module in the root, so it's there but can't be imported the same way. I don't think this is fixed yet, I've added an item to the py2app tracker for this: https://bitbucket.org/ronaldoussoren/py2app/issue/52 Ronald -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 4788 bytes Desc: not available URL: From michael.mccracken at gmail.com Wed Jul 18 18:56:51 2012 From: michael.mccracken at gmail.com (Michael McCracken) Date: Wed, 18 Jul 2012 11:56:51 -0500 Subject: [Pythonmac-SIG] Question about py2app packages and includes options In-Reply-To: References: Message-ID: On Wed, Jul 18, 2012 at 11:14 AM, Chris Barker wrote: > On Tue, Jul 17, 2012 at 3:49 PM, Michael McCracken > wrote: > >> That makes sense - but as you mention, it seems like there's some >> missing functionality. > > I think so, yes, but it can get the job done. > >> However, it's no fun if you have a lot of subpackages to add that way. > > nope -- but for the most part they are picked up by regular imports, > anyway. You only need to do this if there are some dynamic importing > in your code -- and in that case, it's likely you'll want the whole > package anyway. In my (probably unusual) situation, it's not dynamic imports: I have these helper apps that I'm including in the main app bundle. I wanted to have their Frameworks and lib directories just be symlinks to the top level, which then had to have the sum of all the modules. The modules the sub-apps use are picked up and put in the zip just fine when they're built separately, but I need to put those modules in the toplevel .zip. I was looking for a nice way to do that from the options, but that's the specific thing that's missing. That said, the code to just directly merge the zips and lib-dynload directories was pretty straightforward and seems to be working well. If anyone else ever has a similar need, I'd be happy to share it. -mike > > -- > > Christopher Barker, Ph.D. > Oceanographer > > Emergency Response Division > NOAA/NOS/OR&R (206) 526-6959 voice > 7600 Sand Point Way NE (206) 526-6329 fax > Seattle, WA 98115 (206) 526-6317 main reception > > Chris.Barker at noaa.gov From chris.barker at noaa.gov Wed Jul 18 18:14:14 2012 From: chris.barker at noaa.gov (Chris Barker) Date: Wed, 18 Jul 2012 09:14:14 -0700 Subject: [Pythonmac-SIG] Question about py2app packages and includes options In-Reply-To: References: Message-ID: On Tue, Jul 17, 2012 at 3:49 PM, Michael McCracken wrote: > That makes sense - but as you mention, it seems like there's some > missing functionality. I think so, yes, but it can get the job done. > However, it's no fun if you have a lot of subpackages to add that way. nope -- but for the most part they are picked up by regular imports, anyway. You only need to do this if there are some dynamic importing in your code -- and in that case, it's likely you'll want the whole package anyway. -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 aranafireheart at mac.com Fri Jul 20 20:06:54 2012 From: aranafireheart at mac.com (Arana Fireheart) Date: Fri, 20 Jul 2012 14:06:54 -0400 Subject: [Pythonmac-SIG] PyQT on Lion? In-Reply-To: References: Message-ID: <010E9186-252A-459C-8BE8-9DE05FC0E4A4@mac.com> Okay, I GIVE UP!! I have tried just about everything I can think of and they all failed! I have spent over a month on this and can't seem to get all of these pieces to work together. I have tried all the latest developers releases for QT, sip and PyQt and all I can get to is a wrong architecture message (see below). I have tried virtualenv and no virtualenv. I have tried to force python to use 32-bit (defaults write com.apple.versioner.python Prefer-32-Bit -bool yes), without any change. I think it is an issue with 32/64-bit versions, but I can't figure out which piece is the one using the wrong architecture... If ANYONE has managed to get PyQt to build and install on Lion, could you please let me know how you did it? Arana from PyQt4 import QtCore ImportError: dlopen(/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/PyQt4/QtCore.so, 2): no suitable image found. Did find: /Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/PyQt4/QtCore.so: mach-o, but wrong architecture On Jul 16, 2012, at 4:51 PM, pythonmac-sig-request at python.org wrote: > From: Arana Fireheart > Subject: Re: [Pythonmac-SIG] PyQT on Lion? (Charlie Clark) > Date: July 16, 2012 4:51:21 PM EDT > To: pythonmac-sig at python.org > > > Charlie, > > Thanks for the response. Part of the reason I was trying to use virtualenv was to 'disconnect' from a few years of builds (some successful/ some unsuccessful). I was hoping to avoid doing a 'clean install' of my machine and reinstall of of the apps etc. > > The latest attempt is to perform a 'new' install of PyQT and then copy the site-packages directory into the virtual environment (or possibly sym link it). I think this one shows the most promise for getting an environment that will not only run my PyQT apps but allow me to build a distribution version with py2app (which I have NEVER managed to be able to do!!) > > I'll let you all know how it goes, Iv'e got my finger's crossed! > > Arana > > > > On Jul 12, 2012, at 6:00 AM, pythonmac-sig-request at python.org wrote: > >> Am 11.07.2012, 14:41 Uhr, schrieb Arana Fireheart : >> >>> Charlie, >>> I tried virtualenv after reading lots of people extolling it's virtues. Having had little luck with other methods I thought I would give it a try. I have managed to get this all built on my MacBookPro which is running Snow Leopard, but not on my desktop machine (iMac). HomeBrew lists PyQT as installed, but when I try to run some code it fails with a "can't find module". >>> What I don't get is why python can't locate the installed modules. Do you have any hints as to how I can track this down? >> >> Hi Arana, >> >> virtualenv's are indeed a great idea. They allow you to isolate the >> libraries for different projects from each other. However, if you are >> using libraries that need compiling then it can be better to use "system" >> libraries. You can do this in a virtualenv with the switch "--system-site-packages" >> >> Charlie >> -- >> Charlie Clark >> Managing Director >> Clark Consulting & Research >> German Office >> Kronenstr. 27a >> D?sseldorf >> D- 40217 >> Tel: +49-211-600-3657 >> Mobile: +49-178-782-6226 >> >> >> >> unsubscribe: http://mail.python.org/mailman/options/Pythonmac-SIG > > > > > unsubscribe: http://mail.python.org/mailman/options/Pythonmac-SIG -------------- next part -------------- An HTML attachment was scrubbed... URL: From nad at acm.org Fri Jul 20 20:38:03 2012 From: nad at acm.org (Ned Deily) Date: Fri, 20 Jul 2012 11:38:03 -0700 Subject: [Pythonmac-SIG] PyQT on Lion? References: <010E9186-252A-459C-8BE8-9DE05FC0E4A4@mac.com> Message-ID: In article <010E9186-252A-459C-8BE8-9DE05FC0E4A4 at mac.com>, Arana Fireheart wrote: > Okay, I GIVE UP!! > > I have tried just about everything I can think of and they all failed! I > have spent over a month on this and can't seem to get all of these pieces to > work together. > > I have tried all the latest developers releases for QT, sip and PyQt and all > I can get to is a wrong architecture message (see below). I have tried > virtualenv and no virtualenv. I have tried to force python to use 32-bit > (defaults write com.apple.versioner.python Prefer-32-Bit -bool yes), without > any change. I think it is an issue with 32/64-bit versions, but I can't > figure out which piece is the one using the wrong architecture... > > If ANYONE has managed to get PyQt to build and install on Lion, could you > please let me know how you did it... > > Arana > > > from PyQt4 import QtCore > ImportError: > dlopen(/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-pa > ckages/PyQt4/QtCore.so, 2): no suitable image found. Did find: > > /Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/ > PyQt4/QtCore.so: mach-o, but wrong architecture For what it's worth, the "defaults" trick to run in 32-bit-mode is an Apple modification to their system Pythons in 10.6 and 10.7, i.e. /usr/bin/python* and /System/Library/Frameworks/Python.framework. It doesn't work with other Pythons, which you apparently have installed (/Library/Frameworks/Python.framework). Which Python are you using? You can determine what architectures are involved by using the "file" command: cd /Library/Frameworks/Python.framework/Versions/2.6 file ./lib/python2.6/site-packages/PyQt4/QtCore.so file ./bin/python2.6 There must be a common subset of architectures and the interpreter has to running in one of those common archs. -- Ned Deily, nad at acm.org From thomas.robitaille at gmail.com Fri Jul 20 20:56:47 2012 From: thomas.robitaille at gmail.com (Thomas Robitaille) Date: Fri, 20 Jul 2012 20:56:47 +0200 Subject: [Pythonmac-SIG] PyQT on Lion? In-Reply-To: <010E9186-252A-459C-8BE8-9DE05FC0E4A4@mac.com> References: <010E9186-252A-459C-8BE8-9DE05FC0E4A4@mac.com> Message-ID: <5D07D591-4BEF-4A9B-BF37-F7FA682C5673@gmail.com> I use Macports to manage my Python installation on 10.6 and 10.7 and haven't had any issues - and 'port install py27-pyqt4' works great. See http://astrofrog.github.com/macports-python/ for more details on using Python from Macports. Macports is also now much faster than it used to be since binary builds are available in many cases. Cheers, Tom On 20 Jul 2012, at 20:06, Arana Fireheart wrote: > Okay, I GIVE UP!! > > I have tried just about everything I can think of and they all failed! I have spent over a month on this and can't seem to get all of these pieces to work together. > > I have tried all the latest developers releases for QT, sip and PyQt and all I can get to is a wrong architecture message (see below). I have tried virtualenv and no virtualenv. I have tried to force python to use 32-bit (defaults write com.apple.versioner.python Prefer-32-Bit -bool yes), without any change. I think it is an issue with 32/64-bit versions, but I can't figure out which piece is the one using the wrong architecture... > > If ANYONE has managed to get PyQt to build and install on Lion, could you please let me know how you did it? > > Arana > > > from PyQt4 import QtCore > ImportError: dlopen(/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/PyQt4/QtCore.so, 2): no suitable image found. Did find: > /Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/PyQt4/QtCore.so: mach-o, but wrong architecture > > > On Jul 16, 2012, at 4:51 PM, pythonmac-sig-request at python.org wrote: > >> From: Arana Fireheart >> Subject: Re: [Pythonmac-SIG] PyQT on Lion? (Charlie Clark) >> Date: July 16, 2012 4:51:21 PM EDT >> To: pythonmac-sig at python.org >> >> >> Charlie, >> >> Thanks for the response. Part of the reason I was trying to use virtualenv was to 'disconnect' from a few years of builds (some successful/ some unsuccessful). I was hoping to avoid doing a 'clean install' of my machine and reinstall of of the apps etc. >> >> The latest attempt is to perform a 'new' install of PyQT and then copy the site-packages directory into the virtual environment (or possibly sym link it). I think this one shows the most promise for getting an environment that will not only run my PyQT apps but allow me to build a distribution version with py2app (which I have NEVER managed to be able to do!!) >> >> I'll let you all know how it goes, Iv'e got my finger's crossed! >> >> Arana >> >> >> >> On Jul 12, 2012, at 6:00 AM, pythonmac-sig-request at python.org wrote: >> >>> Am 11.07.2012, 14:41 Uhr, schrieb Arana Fireheart : >>> >>>> Charlie, >>>> I tried virtualenv after reading lots of people extolling it's virtues. Having had little luck with other methods I thought I would give it a try. I have managed to get this all built on my MacBookPro which is running Snow Leopard, but not on my desktop machine (iMac). HomeBrew lists PyQT as installed, but when I try to run some code it fails with a "can't find module". >>>> What I don't get is why python can't locate the installed modules. Do you have any hints as to how I can track this down? >>> >>> Hi Arana, >>> >>> virtualenv's are indeed a great idea. They allow you to isolate the >>> libraries for different projects from each other. However, if you are >>> using libraries that need compiling then it can be better to use "system" >>> libraries. You can do this in a virtualenv with the switch "--system-site-packages" >>> >>> Charlie >>> -- >>> Charlie Clark >>> Managing Director >>> Clark Consulting & Research >>> German Office >>> Kronenstr. 27a >>> D?sseldorf >>> D- 40217 >>> Tel: +49-211-600-3657 >>> Mobile: +49-178-782-6226 >>> >>> >>> >>> unsubscribe: http://mail.python.org/mailman/options/Pythonmac-SIG >> >> >> >> >> unsubscribe: http://mail.python.org/mailman/options/Pythonmac-SIG > > _______________________________________________ > 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 aranafireheart at mac.com Fri Jul 20 23:04:32 2012 From: aranafireheart at mac.com (Arana Fireheart) Date: Fri, 20 Jul 2012 17:04:32 -0400 Subject: [Pythonmac-SIG] PyQT on Lion? In-Reply-To: References: Message-ID: <7A6B804D-970E-4000-B540-A79A84257F37@mac.com> Ned, Thanks for the help. I am VERY grateful for any assistance I can get with this. It appears that I have two issues. First is that I am not using the system python (maybe I shouldn't be), secondly that the version of PyQt in that directory is compiled for 64 bit. At least that is what I believe the following is telling me? ??? Thanks, Arana Aranas-BIG-Toy:PyQt Install arana$ cd /Library/Frameworks/Python.framework/Versions/2.6 Aranas-BIG-Toy:2.6 arana$ file ./lib/python2.6/site-packages/PyQt4/QtCore.so ./lib/python2.6/site-packages/PyQt4/QtCore.so: Mach-O 64-bit bundle x86_64 Aranas-BIG-Toy:2.6 arana$ file ./bin/python2.6 ./bin/python2.6: Mach-O universal binary with 2 architectures ./bin/python2.6 (for architecture ppc): Mach-O executable ppc ./bin/python2.6 (for architecture i386): Mach-O executable i386 Aranas-BIG-Toy:2.6 arana$ which python /usr/bin/python Aranas-BIG-Toy:2.6 arana$ file /usr/bin/python /usr/bin/python: Mach-O universal binary with 2 architectures /usr/bin/python (for architecture x86_64): Mach-O 64-bit executable x86_64 /usr/bin/python (for architecture i386): Mach-O executable i386 Aranas-BIG-Toy:2.6 arana$ echo $PATH /usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin:/Library/Frameworks/Python.framework/Versions/Current/bin Aranas-BIG-Toy:2.6 arana$ echo $PYTHONPATH Aranas-BIG-Toy:2.6 arana$ On Jul 20, 2012, at 2:58 PM, pythonmac-sig-request at python.org wrote: > > > From: Ned Deily > Subject: Re: [Pythonmac-SIG] PyQT on Lion? > Date: July 20, 2012 2:38:03 PM EDT > To: pythonmac-sig at python.org > > > In article <010E9186-252A-459C-8BE8-9DE05FC0E4A4 at mac.com>, > Arana Fireheart wrote: >> Okay, I GIVE UP!! >> >> I have tried just about everything I can think of and they all failed! I >> have spent over a month on this and can't seem to get all of these pieces to >> work together. >> >> I have tried all the latest developers releases for QT, sip and PyQt and all >> I can get to is a wrong architecture message (see below). I have tried >> virtualenv and no virtualenv. I have tried to force python to use 32-bit >> (defaults write com.apple.versioner.python Prefer-32-Bit -bool yes), without >> any change. I think it is an issue with 32/64-bit versions, but I can't >> figure out which piece is the one using the wrong architecture... >> >> If ANYONE has managed to get PyQt to build and install on Lion, could you >> please let me know how you did it... >> >> Arana >> >> >> from PyQt4 import QtCore >> ImportError: >> dlopen(/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-pa >> ckages/PyQt4/QtCore.so, 2): no suitable image found. Did find: >> >> /Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/ >> PyQt4/QtCore.so: mach-o, but wrong architecture > > For what it's worth, the "defaults" trick to run in 32-bit-mode is an > Apple modification to their system Pythons in 10.6 and 10.7, i.e. > /usr/bin/python* and /System/Library/Frameworks/Python.framework. It > doesn't work with other Pythons, which you apparently have installed > (/Library/Frameworks/Python.framework). Which Python are you using? > You can determine what architectures are involved by using the "file" > command: > > cd /Library/Frameworks/Python.framework/Versions/2.6 > file ./lib/python2.6/site-packages/PyQt4/QtCore.so > file ./bin/python2.6 > > There must be a common subset of architectures and the interpreter has > to running in one of those common archs. > > -- > Ned Deily, > nad at acm.org > > > > > > From: Thomas Robitaille > Subject: Re: [Pythonmac-SIG] PyQT on Lion? > Date: July 20, 2012 2:56:47 PM EDT > To: Arana Fireheart > Cc: "pythonmac-sig at python.org" > > > I use Macports to manage my Python installation on 10.6 and 10.7 and haven't had any issues - and 'port install py27-pyqt4' works great. > > See http://astrofrog.github.com/macports-python/ for more details on using Python from Macports. > > Macports is also now much faster than it used to be since binary builds are available in many cases. > > Cheers, > Tom > > On 20 Jul 2012, at 20:06, Arana Fireheart wrote: > >> Okay, I GIVE UP!! >> >> I have tried just about everything I can think of and they all failed! I have spent over a month on this and can't seem to get all of these pieces to work together. >> >> I have tried all the latest developers releases for QT, sip and PyQt and all I can get to is a wrong architecture message (see below). I have tried virtualenv and no virtualenv. I have tried to force python to use 32-bit (defaults write com.apple.versioner.python Prefer-32-Bit -bool yes), without any change. I think it is an issue with 32/64-bit versions, but I can't figure out which piece is the one using the wrong architecture... >> >> If ANYONE has managed to get PyQt to build and install on Lion, could you please let me know how you did it? >> >> Arana >> >> >> from PyQt4 import QtCore >> ImportError: dlopen(/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/PyQt4/QtCore.so, 2): no suitable image found. Did find: >> /Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/PyQt4/QtCore.so: mach-o, but wrong architecture >> >> >> On Jul 16, 2012, at 4:51 PM, pythonmac-sig-request at python.org wrote: >> >>> From: Arana Fireheart >>> Subject: Re: [Pythonmac-SIG] PyQT on Lion? (Charlie Clark) >>> Date: July 16, 2012 4:51:21 PM EDT >>> To: pythonmac-sig at python.org >>> >>> >>> Charlie, >>> >>> Thanks for the response. Part of the reason I was trying to use virtualenv was to 'disconnect' from a few years of builds (some successful/ some unsuccessful). I was hoping to avoid doing a 'clean install' of my machine and reinstall of of the apps etc. >>> >>> The latest attempt is to perform a 'new' install of PyQT and then copy the site-packages directory into the virtual environment (or possibly sym link it). I think this one shows the most promise for getting an environment that will not only run my PyQT apps but allow me to build a distribution version with py2app (which I have NEVER managed to be able to do!!) >>> >>> I'll let you all know how it goes, Iv'e got my finger's crossed! >>> >>> Arana >>> >>> >>> >>> On Jul 12, 2012, at 6:00 AM, pythonmac-sig-request at python.org wrote: >>> >>>> Am 11.07.2012, 14:41 Uhr, schrieb Arana Fireheart : >>>> >>>>> Charlie, >>>>> I tried virtualenv after reading lots of people extolling it's virtues. Having had little luck with other methods I thought I would give it a try. I have managed to get this all built on my MacBookPro which is running Snow Leopard, but not on my desktop machine (iMac). HomeBrew lists PyQT as installed, but when I try to run some code it fails with a "can't find module". >>>>> What I don't get is why python can't locate the installed modules. Do you have any hints as to how I can track this down? >>>> >>>> Hi Arana, >>>> >>>> virtualenv's are indeed a great idea. They allow you to isolate the >>>> libraries for different projects from each other. However, if you are >>>> using libraries that need compiling then it can be better to use "system" >>>> libraries. You can do this in a virtualenv with the switch "--system-site-packages" >>>> >>>> Charlie >>>> -- >>>> Charlie Clark >>>> Managing Director >>>> Clark Consulting & Research >>>> German Office >>>> Kronenstr. 27a >>>> D?sseldorf >>>> D- 40217 >>>> Tel: +49-211-600-3657 >>>> Mobile: +49-178-782-6226 >>>> >>>> >>>> >>>> unsubscribe: http://mail.python.org/mailman/options/Pythonmac-SIG >>> >>> >>> >>> >>> unsubscribe: http://mail.python.org/mailman/options/Pythonmac-SIG >> >> _______________________________________________ >> 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 > > > unsubscribe: http://mail.python.org/mailman/options/Pythonmac-SIG -------------- next part -------------- An HTML attachment was scrubbed... URL: From nad at acm.org Sat Jul 21 00:23:42 2012 From: nad at acm.org (Ned Deily) Date: Fri, 20 Jul 2012 15:23:42 -0700 Subject: [Pythonmac-SIG] PyQT on Lion? References: <7A6B804D-970E-4000-B540-A79A84257F37@mac.com> Message-ID: In article <7A6B804D-970E-4000-B540-A79A84257F37 at mac.com>, Arana Fireheart wrote: > It appears that I have two issues. First is that I am not using the system > python (maybe I shouldn't be), secondly that the version of PyQt in that > directory is compiled for 64 bit. At least that is what I believe the > following is telling me... ??? > Aranas-BIG-Toy:PyQt Install arana$ cd > /Library/Frameworks/Python.framework/Versions/2.6 > Aranas-BIG-Toy:2.6 arana$ file > ./lib/python2.6/site-packages/PyQt4/QtCore.so > ./lib/python2.6/site-packages/PyQt4/QtCore.so: Mach-O 64-bit bundle x86_64 > Aranas-BIG-Toy:2.6 arana$ file ./bin/python2.6 > ./bin/python2.6: Mach-O universal binary with 2 architectures > ./bin/python2.6 (for architecture ppc): Mach-O executable ppc > ./bin/python2.6 (for architecture i386): Mach-O executable i386 > > Aranas-BIG-Toy:2.6 arana$ which python > /usr/bin/python > Aranas-BIG-Toy:2.6 arana$ file /usr/bin/python > /usr/bin/python: Mach-O universal binary with 2 architectures > /usr/bin/python (for architecture x86_64): Mach-O 64-bit executable x86_64 > /usr/bin/python (for architecture i386): Mach-O executable i386 > > Aranas-BIG-Toy:2.6 arana$ echo $PATH > /usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin:/Library/Frameworks/ > Python.framework/Versions/Current/bin > Aranas-BIG-Toy:2.6 arana$ echo $PYTHONPATH I know nothing about PyQt4 and I don't know which Python you should be using but what the above says is that you are using a non-system Python 2.6 that is 32-bit-only and you've installed to it a version of PyQt4 whose extension module QtCore is built only for 64-bit. So, yeah, that won't work. All I can do is to echo Tom's earlier advice to use a package manager like MacPorts for a complete solution including Python. Trying to build and install projects on OS X with multiple dependencies on third-party libraries is fraught with gotchas as you are seeing. Let someone else do the hard work of integrating all the pieces. There may be a little time at the beginning to get used to the package manager's quirks but it will almost certainly pay off in the long run. -- Ned Deily, nad at acm.org From nordenmark at gmail.com Sun Jul 22 11:44:29 2012 From: nordenmark at gmail.com (Nicklas Nordenmark) Date: Sun, 22 Jul 2012 11:44:29 +0200 Subject: [Pythonmac-SIG] py2app bunlding scikits-image etc. Message-ID: <427AAA5609CF4FF8856089322B98665C@gmail.com> Hey guys, didn't know where else to post so I thought I'd give this list a shot. I've been googling a lot but hasn't been able to find any reasonable answers. I'm on a macbook running Lion trying to bundle a pretty extensive application that's using: * wxPython * numpy * scipy * reportlab I'm using python2.7 and py2app for the bundling and here's the setup.py file: import ez_setup ez_setup.use_setuptools() from setuptools import setup Plist={} DATA_FILES = ['../rm_logo.jpg'] OPTIONS = {'argv_emulation': True, 'plist': Plist, } setup( app=["../sasdm.py"], data_files=DATA_FILES, description="Description", author="Author", options={'py2app': OPTIONS}, setup_requires=["py2app"], ) I've tried both python setup.py py2app and sudo python setup.py py2app The bundling always ends up failing with the message: error: cannot copy tree '/Library/Python/2.7/site-packages/skimage/data/chessboard_GRAY_U8.npz': not a directory I've confirmed that "/Library/Python/2.7/site-packages/skimage/data/chessboard_GRAY_U8.npz" in fact does exist. I've installed the latest development version of scikits-image too but no apparent difference there. I appreciate any clues. Regards -- Nicklas Nordenmark -------------- next part -------------- An HTML attachment was scrubbed... URL: From charlie.clark at clark-consulting.eu Sun Jul 22 13:19:01 2012 From: charlie.clark at clark-consulting.eu (Charlie Clark) Date: Sun, 22 Jul 2012 13:19:01 +0200 Subject: [Pythonmac-SIG] PyQT on Lion? In-Reply-To: <010E9186-252A-459C-8BE8-9DE05FC0E4A4@mac.com> References: <010E9186-252A-459C-8BE8-9DE05FC0E4A4@mac.com> Message-ID: Am 20.07.2012, 20:06 Uhr, schrieb Arana Fireheart : > Okay, I GIVE UP!! > I have tried just about everything I can think of and they all failed! > I have spent over a month on this and can't seem to get all of these > pieces to work together. > I have tried all the latest developers releases for QT, sip and PyQt > and all I can get to is a wrong architecture message (see below). I have > tried virtualenv and no virtualenv. I have tried to force python to use > 32-bit (defaults write com.apple.versioner.python Prefer-32-Bit -bool > yes), without any change. I think it is an issue with 32/64-bit > versions, but I can't figure out which piece is the one using the wrong > architecture... > If ANYONE has managed to get PyQt to build and install on Lion, could > you please let me know how you did it? This is simply not true. You have succeeded in installing PyQT using Homebrew. Your problems seem to be related with what you want to do with it afterwards. Installing PyQT using either Homebrew or MacPorts will limit the effectiveness of any virtualenv. Charlie -- Charlie Clark Managing Director Clark Consulting & Research German Office Kronenstr. 27a D?sseldorf D- 40217 Tel: +49-211-600-3657 Mobile: +49-178-782-6226 From ronaldoussoren at mac.com Mon Jul 23 16:20:47 2012 From: ronaldoussoren at mac.com (Ronald Oussoren) Date: Mon, 23 Jul 2012 16:20:47 +0200 Subject: [Pythonmac-SIG] py2app bunlding scikits-image etc. In-Reply-To: <427AAA5609CF4FF8856089322B98665C@gmail.com> References: <427AAA5609CF4FF8856089322B98665C@gmail.com> Message-ID: On 22 Jul, 2012, at 11:44, Nicklas Nordenmark wrote: > > > The bundling always ends up failing with the message: > error: cannot copy tree '/Library/Python/2.7/site-packages/skimage/data/chessboard_GRAY_U8.npz': not a directory > > I've confirmed that "/Library/Python/2.7/site-packages/skimage/data/chessboard_GRAY_U8.npz" in fact does exist. What is the output of "file /Library/Python/2.7/site-packages/skimage/data/chessboard_GRAY_U8.npz"? It seems that py2app thinks that chessboard_GRAY_U8.npz is a directory instead of a regular file, which could be explained by a bug in the handing of zipped python eggs. Ronald -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 4788 bytes Desc: not available URL: From aranafireheart at mac.com Mon Jul 23 16:25:43 2012 From: aranafireheart at mac.com (Arana Fireheart) Date: Mon, 23 Jul 2012 10:25:43 -0400 Subject: [Pythonmac-SIG] PyQT on Lion? In-Reply-To: References: Message-ID: <7C54459B-259D-4E81-AFE1-5E80BD14685A@mac.com> Charlie, Really!? How can you tell that from what I sent? The issue I have with homebrew (which btw, is the package manager I would prefer to use?), is that I can't get pyserial to install under homebrew. I know there is a way to build an installer using homebrew, but pyserial isn't available under git , and I went looking for another 'path' to the goal, since I really didn't want to build everything from scratch! As far as I can tell there isn't any one place that describes who puts what where for OS X. Is anyone aware of one? I'm *really* thinking about starting one! Also, what do you mean that installing PyQt with homebrew "will limit the effectiveness of any virtualenv"? I couldn't seem to get my virtual environment to find PyQt. I even tried copying it to the virtual environment, as someone on Stack Overflow had suggested. I just feel like I can manage to get to 98%, but never get any one install to work entirely. I feel so close to a solution, but it is always just out of reach... Arana On Jul 23, 2012, at 6:00 AM, pythonmac-sig-request at python.org wrote: > > From: "Charlie Clark" > Subject: Re: [Pythonmac-SIG] PyQT on Lion? > Date: July 22, 2012 7:19:01 AM EDT > To: pythonmac-sig at python.org > > > Am 20.07.2012, 20:06 Uhr, schrieb Arana Fireheart : > >> Okay, I GIVE UP!! >> I have tried just about everything I can think of and they all failed! I have spent over a month on this and can't seem to get all of these pieces to work together. >> I have tried all the latest developers releases for QT, sip and PyQt and all I can get to is a wrong architecture message (see below). I have tried virtualenv and no virtualenv. I have tried to force python to use 32-bit (defaults write com.apple.versioner.python Prefer-32-Bit -bool yes), without any change. I think it is an issue with 32/64-bit versions, but I can't figure out which piece is the one using the wrong architecture... >> If ANYONE has managed to get PyQt to build and install on Lion, could you please let me know how you did it? > > This is simply not true. You have succeeded in installing PyQT using Homebrew. Your problems seem to be related with what you want to do with it afterwards. Installing PyQT using either Homebrew or MacPorts will limit the effectiveness of any virtualenv. > > Charlie > -- > Charlie Clark > Managing Director > Clark Consulting & Research > German Office > Kronenstr. 27a > D?sseldorf > D- 40217 > Tel: +49-211-600-3657 > Mobile: +49-178-782-6226 > > > > unsubscribe: http://mail.python.org/mailman/options/Pythonmac-SIG -------------- next part -------------- An HTML attachment was scrubbed... URL: From charlie.clark at clark-consulting.eu Mon Jul 23 16:41:47 2012 From: charlie.clark at clark-consulting.eu (Charlie Clark) Date: Mon, 23 Jul 2012 16:41:47 +0200 Subject: [Pythonmac-SIG] PyQT on Lion? In-Reply-To: <7C54459B-259D-4E81-AFE1-5E80BD14685A@mac.com> References: <7C54459B-259D-4E81-AFE1-5E80BD14685A@mac.com> Message-ID: Am 23.07.2012, 16:25 Uhr, schrieb Arana Fireheart : > Charlie, > Really!? How can you tell that from what I sent? Yep. From your e-mail from 10th July. > The issue I have with homebrew (which btw, is the package manager I > would prefer to use?), is that I can't get pyserial to install under > homebrew. ah, new information. > I know there is a way to build an installer using homebrew, but pyserial > isn't available under git , and I went looking for another 'path' to the > goal, since I really didn't want to build everything from scratch! sudo path/to/your/homebrew's python/pip install pyserial (this should also work in a virtual environment) > As far as I can tell there isn't any one place that describes who puts > what where for OS X. Is anyone aware of one? I'm *really* thinking about > starting one! It's quite easy: either you use the stuff Apple f*cks up; or you use a package manager such Homebrew or MacPorts. It is asking for trouble to mix and match the two, especially as Apple almost never updates libraries between releases. > Also, what do you mean that installing PyQt with homebrew "will limit > the effectiveness of any virtualenv"? I couldn't seem to get my virtual > environment to find PyQt. That's what I meant by "limiting". If the virtualenv has access to the system packages, necessary for PyQT, the the degree of isolation that you have is reduced. I hit a similar bump recently getting Weasyprint running. Charlie -- Charlie Clark Managing Director Clark Consulting & Research German Office Kronenstr. 27a D?sseldorf D- 40217 Tel: +49-211-600-3657 Mobile: +49-178-782-6226 From ronaldoussoren at mac.com Mon Jul 23 17:31:52 2012 From: ronaldoussoren at mac.com (Ronald Oussoren) Date: Mon, 23 Jul 2012 17:31:52 +0200 Subject: [Pythonmac-SIG] py2app bunlding scikits-image etc. In-Reply-To: References: <427AAA5609CF4FF8856089322B98665C@gmail.com> Message-ID: <5C371D2C-218D-4FCC-AF97-76968E62B77F@mac.com> On 23 Jul, 2012, at 16:20, Ronald Oussoren wrote: > > On 22 Jul, 2012, at 11:44, Nicklas Nordenmark wrote: >> >> >> The bundling always ends up failing with the message: >> error: cannot copy tree '/Library/Python/2.7/site-packages/skimage/data/chessboard_GRAY_U8.npz': not a directory >> >> I've confirmed that "/Library/Python/2.7/site-packages/skimage/data/chessboard_GRAY_U8.npz" in fact does exist. > > What is the output of "file /Library/Python/2.7/site-packages/skimage/data/chessboard_GRAY_U8.npz"? It seems that py2app thinks that chessboard_GRAY_U8.npz is a directory instead of a regular file, which could be explained by a bug in the handing of zipped python eggs. It is a zipfile: chessboard_GRAY_U8.npz: Zip archive data, at least v2.0 to extract This is a bug in the support for zipped egg files. Fixing this should be easy enough, I don't have time to work on that right now but will hopefully get around to this later this week. Ronald > > Ronald > > _______________________________________________ > 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: 4788 bytes Desc: not available URL: From velman at cox.net Sun Jul 29 00:51:51 2012 From: velman at cox.net (John Velman) Date: Sat, 28 Jul 2012 15:51:51 -0700 Subject: [Pythonmac-SIG] Concise documentation for PyObjC? Message-ID: <20120728225151.GA3689@cox.net> I'm on OSX 10.7.4 (and will probably move to 10.8 soon). My XCode is 4.3.3. I'm writing a minimalist program to examine and edit markdown. Since the basic program is pretty minimal I want to add plugin extensions. I found this excellent example by Steven Degutis, from back in 2010, (Xcode 3): (http://www.informit.com/blogs/blog.aspx?uk=Ask-Big-Nerd-Ranch-Adding-Python-Scripting-to-Cocoa-apps) Using this as an example, I added a plugin management class (ObjC), and added a class implemented in Python to execute the plugins. I added Python.framework to my project in the usual way. I used some Steven Degutis' plugins to test it. Everything worked with no problem. Very easy! (The XCode 4.3.3 application includes Python.framework for both 2.6 and 2.7., and PyObjC is in there). I've looked for documentation with Google, and so far I've learned - PyObjC is s.o.l. - PyObjC is e.o.l. - There are a million old tutorials on using PyObjC to build a whole app. - There is a new version of PyObjC comming out shortly (probably right, I think I found this on this list) - PyObjC is no longer included in XCode (WRONG). - PyObjC doesn't work on Lion (WRONG). But I can't find any documentation. I'd really like it if someone could point me to some concise documentation. I don't need GUI templates in IB. I don't even need Python file templates. And I don't think I want a tutorial. Just some syntax and semantics for def, @classmethod, other things that I might need that aren't in the examples. Since everything works so well and so easily, I'd like to stick with Python instead of learning Lua, using AppleScript, or any of 100 other possible solutions. Thanks, John Velman From velman at cox.net Mon Jul 30 02:00:38 2012 From: velman at cox.net (John Velman) Date: Sun, 29 Jul 2012 17:00:38 -0700 Subject: [Pythonmac-SIG] Concise documentation for PyObjC? In-Reply-To: <20120728225151.GA3689@cox.net> References: <20120728225151.GA3689@cox.net> Message-ID: <20120730000038.GA557@cox.net> First, I'll apologize for the frustrated tone of my previous message, but there is sure a lot of noise out there. I finally found the PyObjC website (via wikipedia). I'm amazed that no combination of keywords I tried before turned it up, at least on the first few pages. The PyObjC site seems to have everything I want! Best, John Velman (original message not included) From ronaldoussoren at mac.com Mon Jul 30 08:59:57 2012 From: ronaldoussoren at mac.com (Ronald Oussoren) Date: Mon, 30 Jul 2012 08:59:57 +0200 Subject: [Pythonmac-SIG] Concise documentation for PyObjC? In-Reply-To: <20120728225151.GA3689@cox.net> References: <20120728225151.GA3689@cox.net> Message-ID: <5BA5FE75-ECFC-4068-AFA5-6D5F76C1B599@mac.com> On 29 Jul, 2012, at 0:51, John Velman wrote: > I'm on OSX 10.7.4 (and will probably move to 10.8 soon). My XCode is > 4.3.3. > > I'm writing a minimalist program to examine and edit markdown. Since the > basic program is pretty minimal I want to add plugin extensions. > > I found this excellent example by Steven Degutis, from back in 2010, > (Xcode 3): > (http://www.informit.com/blogs/blog.aspx?uk=Ask-Big-Nerd-Ranch-Adding-Python-Scripting-to-Cocoa-apps) > > Using this as an example, I added a plugin management class (ObjC), and > added a class implemented in Python to execute the plugins. I added > Python.framework to my project in the usual way. I used some Steven Degutis' > plugins to test it. Everything worked with no problem. Very easy! > > (The XCode 4.3.3 application includes Python.framework for both 2.6 and 2.7., > and PyObjC is in there). > > I've looked for documentation with Google, and so far I've learned > > - PyObjC is s.o.l. > - PyObjC is e.o.l. > - There are a million old tutorials on using PyObjC to build a whole > app. > - There is a new version of PyObjC comming out shortly (probably right, > I think I found this on this list) I'm still working on that new release. I'm working it in my spare time, and the project scope is fairly large, which explains why it is moving forward so slowly. > - PyObjC is no longer included in XCode (WRONG). That one is actually true, there are no PyObjC templates shipped with Xcode. PyObjC is still shipped with OSX though. > - PyObjC doesn't work on Lion (WRONG). PyObjC should work just fine on Lion, and Mountain Lion. > > But I can't find any documentation. I'd really like it if someone could > point me to some concise documentation. I don't need GUI templates in IB. > I don't even need Python file templates. And I don't think I want a > tutorial. Just some syntax and semantics for def, @classmethod, other > things that I might need that aren't in the examples. http://pyobjc.sourceforge.net/ contains documentation. The version information on that site is way out of date, but the documentation hasn't changed much since then. > > Since everything works so well and so easily, I'd like to stick with Python > instead of learning Lua, using AppleScript, or any of 100 other possible > solutions. > > Thanks, > > John Velman > _______________________________________________ > 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: 4788 bytes Desc: not available URL: From velman at cox.net Mon Jul 30 19:27:35 2012 From: velman at cox.net (John Velman) Date: Mon, 30 Jul 2012 10:27:35 -0700 Subject: [Pythonmac-SIG] Concise documentation for PyObjC? In-Reply-To: <5BA5FE75-ECFC-4068-AFA5-6D5F76C1B599@mac.com> References: <20120728225151.GA3689@cox.net> <5BA5FE75-ECFC-4068-AFA5-6D5F76C1B599@mac.com> Message-ID: <20120730172734.GA463@cox.net> Thanks for your reply and the reference to the website. I have one point of confusion. There is PyObjC I've snipped out most of the email history to focus on one thing: On Mon, Jul 30, 2012 at 08:59:57AM +0200, Ronald Oussoren wrote: > > On 29 Jul, 2012, at 0:51, John Velman wrote: > > > I'm on OSX 10.7.4 (and will probably move to 10.8 soon). My XCode is > > 4.3.3. ...[snip] > > > - PyObjC is no longer included in XCode (WRONG). > > That one is actually true, there are no PyObjC templates shipped with Xcode. > > PyObjC is still shipped with OSX though. My claim that this was wrong was based on the following: I have XCode 4.3.3 which is shipped as an application. The PyObjC api is certainly in there, although it is well hidden. I found it by doing find . -iname "*pyobjc*" from the Contents directory of the app. This yields, for example: ------ ./Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.7.sdk/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/PyObjC ------ But Python.framework with in the System/Library, /System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python In fact the PyObjC folder in the XCode.app library is *only* a couple .h files, about 20KB, while the folder in the System/Library is extensive and weighs in at about 5 MB. The Python.framework that shows up in my program is actually the one from XCode.app. But Xcode knows how to find what it needs in System, apparently. This is already more than I need to know, but this arrangement helped keep me confused when I was trying to get started. (I don't much care about the templates at the moment.) Thanks again, and also thanks for your work on PyObjC! John Velman From michael.mccracken at gmail.com Tue Jul 31 16:47:39 2012 From: michael.mccracken at gmail.com (Michael McCracken) Date: Tue, 31 Jul 2012 07:47:39 -0700 Subject: [Pythonmac-SIG] py2app: works for me on 10.6, not 10.7 Message-ID: Hi, my py2app setup script is working fine if I run it on 10.6, but on 10.7 I've run into some problems. I want a standalone app, and on 10.6 I didn't specify semi_standalone: False in the options, and it worked fine. On 10.7, it appeared to be using the system python (loading old system versions of some dependencies), and on a quick look through the py2app code it seemed to be deciding it was semi-standalone, so I added semi_standalone: False. This solved results in a app wrapper without the Python.framework copied in, giving me the "Python runtime could not be located" error. Is there something obvious I'm missing in moving builds to 10.7? Thanks, -mike From chris.barker at noaa.gov Tue Jul 31 20:56:25 2012 From: chris.barker at noaa.gov (Chris Barker) Date: Tue, 31 Jul 2012 11:56:25 -0700 Subject: [Pythonmac-SIG] py2app: works for me on 10.6, not 10.7 In-Reply-To: References: Message-ID: On Tue, Jul 31, 2012 at 7:47 AM, Michael McCracken wrote: > Hi, my py2app setup script is working fine if I run it on 10.6, but on > 10.7 I've run into some problems. > > I want a standalone app, and on 10.6 I didn't specify semi_standalone: > False in the options, and it worked fine. > On 10.7, it appeared to be using the system python (loading old system > versions of some dependencies), I'm not totally sure, but 10.7 probably has a version of python out of the box that 10.6 doesn't. But anyway, if you want it standalone, you need to make sure that you DONT'T use Apple's Python: Did you install the same python.org versions on 10.7 as you did on 10.6? Are you sure you're running py2app (i.e. setup.py py2app) with that Python? If so, py2app should keep it all clear for you. (note: if any extensions need to be compiled, you need to make sure you use an older XCode, also, but if your app is running fine with the right pyton outside py2app, then you should be set.) HTH, -Chris and on a quick look through the py2app > code it seemed to be deciding it was semi-standalone, so I added > semi_standalone: False. > This solved results in a app wrapper without the Python.framework > copied in, giving me the "Python runtime could not be located" error. > > Is there something obvious I'm missing in moving builds to 10.7? > > Thanks, > -mike > _______________________________________________ > 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 -- 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 michael.mccracken at gmail.com Tue Jul 31 23:28:18 2012 From: michael.mccracken at gmail.com (Michael McCracken) Date: Tue, 31 Jul 2012 14:28:18 -0700 Subject: [Pythonmac-SIG] py2app: works for me on 10.6, not 10.7 In-Reply-To: References: Message-ID: Thanks, Chris - you gave me an important clue. We are using homebrew to install python 2.7.3, so I assumed we were OK there, but we are also using zope's buildout to download dependencies, and it creates a python wrapper script with #!/usr/bin/python . So indeed, I was using the wrong python. Thanks for getting me to look again. Cheers, -mike On Tue, Jul 31, 2012 at 11:56 AM, Chris Barker wrote: > On Tue, Jul 31, 2012 at 7:47 AM, Michael McCracken > wrote: >> Hi, my py2app setup script is working fine if I run it on 10.6, but on >> 10.7 I've run into some problems. >> >> I want a standalone app, and on 10.6 I didn't specify semi_standalone: >> False in the options, and it worked fine. >> On 10.7, it appeared to be using the system python (loading old system >> versions of some dependencies), > > I'm not totally sure, but 10.7 probably has a version of python out of > the box that 10.6 doesn't. But anyway, if you want it standalone, you > need to make sure that you DONT'T use Apple's Python: > > Did you install the same python.org versions on 10.7 as you did on 10.6? > > Are you sure you're running py2app (i.e. setup.py py2app) with that Python? > > If so, py2app should keep it all clear for you. > > (note: if any extensions need to be compiled, you need to make sure > you use an older XCode, also, but if your app is running fine with the > right pyton outside py2app, then you should be set.) > > HTH, > -Chris > > > and on a quick look through the py2app >> code it seemed to be deciding it was semi-standalone, so I added >> semi_standalone: False. >> This solved results in a app wrapper without the Python.framework >> copied in, giving me the "Python runtime could not be located" error. >> >> Is there something obvious I'm missing in moving builds to 10.7? >> >> Thanks, >> -mike >> _______________________________________________ >> 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 > > > > -- > > 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 > unsubscribe: http://mail.python.org/mailman/options/Pythonmac-SIG From michael.mccracken at gmail.com Tue Jul 31 23:32:24 2012 From: michael.mccracken at gmail.com (Michael McCracken) Date: Tue, 31 Jul 2012 14:32:24 -0700 Subject: [Pythonmac-SIG] py2app: works for me on 10.6, not 10.7 In-Reply-To: References: Message-ID: On Tue, Jul 31, 2012 at 2:28 PM, Michael McCracken wrote: > Thanks, Chris - you gave me an important clue. > > We are using homebrew to install python 2.7.3, so I assumed we were OK > there, but we are also using zope's buildout to download dependencies, > and it creates a python wrapper script with #!/usr/bin/python . That is, *if you're not careful*, it can create a python wrapper script with the wrong python. It can also do the right thing. > So indeed, I was using the wrong python. Thanks for getting me to look again. > > Cheers, > -mike > > On Tue, Jul 31, 2012 at 11:56 AM, Chris Barker wrote: >> On Tue, Jul 31, 2012 at 7:47 AM, Michael McCracken >> wrote: >>> Hi, my py2app setup script is working fine if I run it on 10.6, but on >>> 10.7 I've run into some problems. >>> >>> I want a standalone app, and on 10.6 I didn't specify semi_standalone: >>> False in the options, and it worked fine. >>> On 10.7, it appeared to be using the system python (loading old system >>> versions of some dependencies), >> >> I'm not totally sure, but 10.7 probably has a version of python out of >> the box that 10.6 doesn't. But anyway, if you want it standalone, you >> need to make sure that you DONT'T use Apple's Python: >> >> Did you install the same python.org versions on 10.7 as you did on 10.6? >> >> Are you sure you're running py2app (i.e. setup.py py2app) with that Python? >> >> If so, py2app should keep it all clear for you. >> >> (note: if any extensions need to be compiled, you need to make sure >> you use an older XCode, also, but if your app is running fine with the >> right pyton outside py2app, then you should be set.) >> >> HTH, >> -Chris >> >> >> and on a quick look through the py2app >>> code it seemed to be deciding it was semi-standalone, so I added >>> semi_standalone: False. >>> This solved results in a app wrapper without the Python.framework >>> copied in, giving me the "Python runtime could not be located" error. >>> >>> Is there something obvious I'm missing in moving builds to 10.7? >>> >>> Thanks, >>> -mike >>> _______________________________________________ >>> 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 >> >> >> >> -- >> >> 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 >> unsubscribe: http://mail.python.org/mailman/options/Pythonmac-SIG