From gherman at darwin.in-berlin.de Tue Jun 4 16:55:43 2013 From: gherman at darwin.in-berlin.de (Dinu Gherman) Date: Tue, 4 Jun 2013 16:55:43 +0200 Subject: [Pythonmac-SIG] Dependency between pyobjc and py2app? Message-ID: <6764E25B-12B4-415B-865A-3DE1FAD1C3F5@darwin.in-berlin.de> Hi, after a longer break I've been looking into PyObjC again, installed a fresh framework-built Python followed by the pyobjc package as de- scribed here: http://pythonhosted.org/pyobjc/install.html Then, running a few samples from this page: http://pythonhosted.org/pyobjc/examples/index.html revealed that py2app was missing which I had to install seperately as Ronald kindly pointed out. So ok, this could clearly be better indicated on the installation page above, but what I really wonder is if pyobjc and py2app can be useful as stand-alone packages or if they are not so much tied to each other that there should be a dependency in pyobjc on py2app, installing the latter automatically with the former? Regards, Dinu From ronaldoussoren at mac.com Tue Jun 4 18:27:27 2013 From: ronaldoussoren at mac.com (Ronald Oussoren) Date: Tue, 4 Jun 2013 18:27:27 +0200 Subject: [Pythonmac-SIG] Dependency between pyobjc and py2app? In-Reply-To: <6764E25B-12B4-415B-865A-3DE1FAD1C3F5@darwin.in-berlin.de> References: <6764E25B-12B4-415B-865A-3DE1FAD1C3F5@darwin.in-berlin.de> Message-ID: <9072A193-DEF8-469B-B782-7677EF7C7831@mac.com> On 4 Jun, 2013, at 16:55, Dinu Gherman wrote: > Hi, > > after a longer break I've been looking into PyObjC again, installed > a fresh framework-built Python followed by the pyobjc package as de- > scribed here: > > http://pythonhosted.org/pyobjc/install.html > > Then, running a few samples from this page: > > http://pythonhosted.org/pyobjc/examples/index.html > > revealed that py2app was missing which I had to install seperately as > Ronald kindly pointed out. > > So ok, this could clearly be better indicated on the installation page > above, but what I really wonder is if pyobjc and py2app can be useful > as stand-alone packages or if they are not so much tied to each other > that there should be a dependency in pyobjc on py2app, installing the > latter automatically with the former? I've created an issue for this . At the very least the installation of py2app should be mentioned in the installation manual for PyObjC and I agree that it would be better to just add py2app to the list of install_requires of the PyPI package "pyobjc". There is a usecase for not using py2app with pyobjc, for example folks using Xcode to build application bundles. However, py2app and its dependencies are very small and "forcing" users of pyobjc to install py2app as well isn't really a problem. If I get bored I'll probably create some Xcode templates that use py2app to do the work, but before I do that I need to finish pyobjc 3.0 :-) Ronald From cweisiger at msg.ucsf.edu Tue Jun 25 16:06:37 2013 From: cweisiger at msg.ucsf.edu (Chris Weisiger) Date: Tue, 25 Jun 2013 07:06:37 -0700 Subject: [Pythonmac-SIG] possible interaction between python In-Reply-To: <31DDE31C-2E16-4ED4-BC92-7E182883A089@mail.sdsu.edu> References: <31DDE31C-2E16-4ED4-BC92-7E182883A089@mail.sdsu.edu> Message-ID: That is bizarre; Python should not be touching /bin/ls at all (if you're at all familiar with POSIX, 'ls' is the "list contents of directory" command). I'd be more inclined to suspect that your XCode has been corrupted somehow; perhaps reinstalling that might help. I wouldn't expect LLDB to depend on Python either, but who knows. I don't think your installation of Python 3.3 is at fault here, since as you noted the error is dealing with Python 2.7. I believe that's simply the OS built-in Python. You might try opening up a commandline in Terminal and running this: /Library/Frameworks/Python.framework/Versions/2.7/bin/python which ought to run the 2.7 Python REPL (read-eval-print loop, a simple program that lets you test out Python code). If that fails, then your OS built-in Python has probably been damaged. Hope that helps. -Chris On Mon, Apr 8, 2013 at 12:06 PM, Boyd Collier wrote: > Hello All, > > In late February, I thought I'd give python a try, so I took steps to run > it on my Mac. Unfortunately, I didn't keep a good record of what those > steps were, but the installation seemed to be successful, in that I was > able to run a few simple python programs. > > However, I now suspect that installing python may have messed up something > needed to work with my objective-c programs with Xcode. The symptom of a > problem in Xcode is that when I set an Xcode project to use LLDB as the > debugger (this is the default debugger), Xcode immediately crashes when the > run button in the project window is hit. However, projects run properly > when I change the debugger to be used to GDB. At least initially, there > was no indication that this problem had anything to do with python. I > filed an Xcode bug report with Apple and have been following the steps > suggested by Apple engineers to try to track down the problem. This > morning, they asked me to run the command > /Applications/Xcode.app/Contents/Developer/usr/bin/lldb /bin/ls from the > terminal, which I did. Here is the result: > > > Macintosh:~ bcollier$ > /Applications/Xcode.app/Contents/Developer/usr/bin/lldb /bin/ls > > dyld: Library not loaded: > /System/Library/Frameworks/Python.framework/Versions/2.7/Python > > Referenced from: > /Applications/Xcode.app/Contents/Developer/usr/bin/../../../SharedFrameworks/LLDB.framework/LLDB > > Reason: image not found > > Trace/BPT trap: 5 > > My (perhaps erroneous) recollection is that I installed python 3.3, and I > see that what is not being loaded is 2.7. I've sent this result to Apple, > but perhaps those of you who have been working with python on the Mac and > using Xcode might have experienced a similar problem and might be able to > suggest what is going on. I'm running OSX 10.7.5 and Xcode 4.6 (but first > had the problem with Xcode 4.2). > > Thanks very much, > Boyd Collier > Prof. of Biology, Emeritus > San Diego State University > _______________________________________________ > 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 ronaldoussoren at mac.com Tue Jun 25 16:14:07 2013 From: ronaldoussoren at mac.com (Ronald Oussoren) Date: Tue, 25 Jun 2013 16:14:07 +0200 Subject: [Pythonmac-SIG] possible interaction between python In-Reply-To: <31DDE31C-2E16-4ED4-BC92-7E182883A089@mail.sdsu.edu> References: <31DDE31C-2E16-4ED4-BC92-7E182883A089@mail.sdsu.edu> Message-ID: <57C059C7-D208-4EA5-8071-EE724DE64922@mac.com> On 8 Apr, 2013, at 21:06, Boyd Collier wrote: > Hello All, > > In late February, I thought I'd give python a try, so I took steps to run it on my Mac. Unfortunately, I didn't keep a good record of what those steps were, but the installation seemed to be successful, in that I was able to run a few simple python programs. > > However, I now suspect that installing python may have messed up something needed to work with my objective-c programs with Xcode. The symptom of a problem in Xcode is that when I set an Xcode project to use LLDB as the debugger (this is the default debugger), Xcode immediately crashes when the run button in the project window is hit. However, projects run properly when I change the debugger to be used to GDB. At least initially, there was no indication that this problem had anything to do with python. I filed an Xcode bug report with Apple and have been following the steps suggested by Apple engineers to try to track down the problem. This morning, they asked me to run the command /Applications/Xcode.app/Contents/Developer/usr/bin/lldb /bin/ls from the terminal, which I did. Here is the result: > >> Macintosh:~ bcollier$ /Applications/Xcode.app/Contents/Developer/usr/bin/lldb /bin/ls >> dyld: Library not loaded: /System/Library/Frameworks/Python.framework/Versions/2.7/Python >> Referenced from: /Applications/Xcode.app/Contents/Developer/usr/bin/../../../SharedFrameworks/LLDB.framework/LLDB >> Reason: image not found >> Trace/BPT trap: 5 > > My (perhaps erroneous) recollection is that I installed python 3.3, and I see that what is not being loaded is 2.7. I've sent this result to Apple, but perhaps those of you who have been working with python on the Mac and using Xcode might have experienced a similar problem and might be able to suggest what is going on. I'm running OSX 10.7.5 and Xcode 4.6 (but first had the problem with Xcode 4.2). Does "/System/Library/Frameworks/Python.framework/Versions/2.7/Python" still exist? The error message appears to indicate that this file no longer exists, which would be bad. Ronald > > Thanks very much, > Boyd Collier > Prof. of Biology, Emeritus > San Diego State University > _______________________________________________ > 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 chris.barker at noaa.gov Tue Jun 25 16:26:24 2013 From: chris.barker at noaa.gov (Chris Barker - NOAA Federal) Date: Tue, 25 Jun 2013 07:26:24 -0700 Subject: [Pythonmac-SIG] py2app questions.. In-Reply-To: <83C73718-8A7A-4900-A3C7-950F10D5E0AB@mac.com> References: <83C73718-8A7A-4900-A3C7-950F10D5E0AB@mac.com> Message-ID: Ronald, Did you mean this to go to the list? I've forwarded it on... Anyway, thanks for the notes -- I'll keep all this in mind when I build that app again. >> I've learned a few things from this. >> >> 1) this is odd: >> right near the top, I see: >> prescript.py >> imports: Image >> that's the prescript for the PIL recipe -- I"m not using PIL, it >> seems it's runnign nthe recipe, and using what the recipe imported -- >> not good. > > Are you sure about not using PIL (if even indirectly)? Now that i think about it again, I think MPL makes some optional use of PIL -- that's probably it. >> An idea how to tweak the MPL recipe to only pull in the backend we >> need? is there a way to pass options to he recipes? > > I hope Guido doesn't mind that I've borrowed his time machine. Support for this was added in py2app 0.7: > > - Smarter matplotlib recipe, it is now possible to specify which backends should > be included. Issue #44, reported by Adam Kovics. this is nice -- thanks! >> 4) Ipython is getting pulled in my Matplotlib too: > That should be fixable by excluding iPython. I'll give that a shot. thanks, -Chris -- Christopher Barker, Ph.D. Oceanographer Emergency Response Division NOAA/NOS/OR&R (206) 526-6959 voice 7600 Sand Point Way NE (206) 526-6329 fax Seattle, WA 98115 (206) 526-6317 main reception Chris.Barker at noaa.gov From ronaldoussoren at mac.com Tue Jun 25 16:58:40 2013 From: ronaldoussoren at mac.com (Ronald Oussoren) Date: Tue, 25 Jun 2013 16:58:40 +0200 Subject: [Pythonmac-SIG] py2app questions.. In-Reply-To: References: <83C73718-8A7A-4900-A3C7-950F10D5E0AB@mac.com> Message-ID: On 25 Jun, 2013, at 16:26, Chris Barker - NOAA Federal wrote: > Ronald, > > Did you mean this to go to the list? I've forwarded it on... I did probably use the wrong reply button :-( > > Anyway, thanks for the notes -- I'll keep all this in mind when I > build that app again. > >>> I've learned a few things from this. >>> >>> 1) this is odd: >>> right near the top, I see: >>> prescript.py >>> imports: Image >>> that's the prescript for the PIL recipe -- I"m not using PIL, it >>> seems it's runnign nthe recipe, and using what the recipe imported -- >>> not good. >> >> Are you sure about not using PIL (if even indirectly)? > > Now that i think about it again, I think MPL makes some optional use > of PIL -- that's probably it. Working with the dependency graph is currently too hard for humans, amongst other because there is too much detail. A number of people have started to use modulegraph outside of py2app and based on interactions on modulegraph's issue tracker I have some ideas to improve the situation. In the long run there probably should be a GUI tool for py2app that makes this a lot easier, but that's not going to happen anytime soon. Ronald From fsteele at mindspring.com Tue Jun 25 22:05:32 2013 From: fsteele at mindspring.com (fsteele at mindspring.com) Date: Tue, 25 Jun 2013 16:05:32 -0400 (EDT) Subject: [Pythonmac-SIG] OSAscript from python doesn't trigger privileges prompt Message-ID: <30380012.1372190732719.JavaMail.root@elwamui-muscovy.atl.sa.earthlink.net> I'm writing a Python application that looks for a pkg file in a particular location, downloads it, and installs it. Using osascript -e and Python's subprocess.Popen(), I can embed: do shell script "sudo /usr/sbin/installer -pkg /path/to/file/filename.pkg -target /" with administrator privileges When run interactively, this works fine. When the script hits the above line, it prompts me to enter my admin privileges and successfully runs installer. When triggered by a launchd agent (in /Library/LaunchAgents/), the script runs and does everything except successfully install the package. Any ideas what I'm doing wrong? Thanks! Frank