From bentbakwards at gmail.com Sun Mar 17 07:16:24 2013 From: bentbakwards at gmail.com (spangled spanner) Date: Sun, 17 Mar 2013 14:16:24 +0800 Subject: [Pythonmac-SIG] cannot run python agent using launchd (Mountain Lion) Message-ID: G'day, I am a noob dummy learner and do not mind being treated as such... I have a python script in a vritualenv (venv) that I am trying to launch using launchd. The script calls a few modules, all of which are in the venv, one of which I also wrote. By way of 'testing' I have created a bash script that starts the python script, to ensure that it is the venv python that is running my script. I have written a .plist and saved it in ~/Library/LaunchAgents and loaded it using: launchctl load -wF /path/to/.plist The script will not execute and console log shows me the following: Mar 17 11:53:37 my-MacBook-Pro kernel[0]: CODE SIGNING: cs_invalid_page(0x1048fe000): p=1134[python] clearing CS_VALID Does one have to code sign a python script to have it run by launchd? Is my problem related to environment.plist? Is it something else altogether ?! I've googled for a couple of days and I have got nowhere really. Any help is greatly appreciated, css -------------- next part -------------- An HTML attachment was scrubbed... URL: From sameer at falkorsystems.com Sun Mar 31 00:37:15 2013 From: sameer at falkorsystems.com (sameer) Date: Sat, 30 Mar 2013 16:37:15 -0700 (PDT) Subject: [Pythonmac-SIG] How to make py2app app stub link to Cocoa framework? In-Reply-To: <4EBBD8D4.30808@codebykevin.com> References: <4EBA0478.9090106@codebykevin.com> <83E3A3C9-C1AB-498E-84E7-89E7A9C675E9@mac.com> <4EBBD8D4.30808@codebykevin.com> Message-ID: <1364686635536-5012541.post@n6.nabble.com> Hello all. I'm trying to make a Mac App using py2app that will go on the Mac App store. I enabled sandboxing and now my app crashes. I noticed on the py2app bitbucket issue #85 https://bitbucket.org/ronaldoussoren/py2app/issue/85/sandboxing-interaction-issue which led me to find this thread about linking Cocoa. I applied the following patch to my py2app And now when I launch my app it still crashes with the following errors (which is the same as before I did the LDFLAGS change): Does anyone have any hints about how I can make this work? I am new to Mac Apps and sandboxing. Thanks, -s -- View this message in context: http://python.6.n6.nabble.com/How-to-make-py2app-app-stub-link-to-Cocoa-framework-tp2157525p5012541.html Sent from the Python - pythonmac-sig mailing list archive at Nabble.com. From kw at codebykevin.com Sun Mar 31 03:28:05 2013 From: kw at codebykevin.com (Kevin Walzer) Date: Sat, 30 Mar 2013 21:28:05 -0400 Subject: [Pythonmac-SIG] How to make py2app app stub link to Cocoa framework? In-Reply-To: <1364686635536-5012541.post@n6.nabble.com> References: <4EBA0478.9090106@codebykevin.com> <83E3A3C9-C1AB-498E-84E7-89E7A9C675E9@mac.com> <4EBBD8D4.30808@codebykevin.com> <1364686635536-5012541.post@n6.nabble.com> Message-ID: <51579125.80101@codebykevin.com> On 3/30/13 7:37 PM, sameer wrote: > Does anyone have any hints about how I can make this work? I am new to Mac > Apps and sandboxing. This appears to be the error: 3/30/13 7:04:02.050 PM [0x0-0xb15b15].com.falkorsystems.defisheye: ImportError: dlopen(/Users/sameer/Documents/Falkor Systems/gopro_calibration/DeFisheye/dist/DeFisheye.app/Contents/Resources/lib/python2.7/lib-dynload/cv2.so, 2): Library not loaded: /usr/X11/lib/libpng15.15.dylib 3/30/13 7:04:02.050 PM [0x0-0xb15b15].com.falkorsystems.defisheye: Referenced from: /Users/sameer/Documents/Falkor Systems/gopro_calibration/DeFisheye/dist/DeFisheye.app/Contents/MacOS/../Frameworks/libopencv_highgui.2.4.4.dylib 3/30/13 7:04:02.050 PM [0x0-0xb15b15].com.falkorsystems.defisheye: Reason: no suitable image found. Did find: 3/30/13 7:04:02.050 PM [0x0-0xb15b15].com.falkorsystems.defisheye: /usr/X11/lib/libpng15.15.dylib: open() failed with errno=1 3/30/13 7:04:02.119 PM DeFisheye: DeFisheye Error Some linking error to libpng, apparently. This wouldn't seem to have anything to do with the Cocoa linking issue in py2app. --Kevin -- Kevin Walzer Code by Kevin/Mobile Code by Kevin http://www.codebykevin.com http://www.wtmobilesoftware.com From ronaldoussoren at mac.com Sun Mar 31 13:59:46 2013 From: ronaldoussoren at mac.com (Ronald Oussoren) Date: Sun, 31 Mar 2013 13:59:46 +0200 Subject: [Pythonmac-SIG] How to make py2app app stub link to Cocoa framework? In-Reply-To: <51579125.80101@codebykevin.com> References: <4EBA0478.9090106@codebykevin.com> <83E3A3C9-C1AB-498E-84E7-89E7A9C675E9@mac.com> <4EBBD8D4.30808@codebykevin.com> <1364686635536-5012541.post@n6.nabble.com> <51579125.80101@codebykevin.com> Message-ID: <6FA391AF-6EDB-4F56-A7E9-C07869B6E8E1@mac.com> On 31 Mar, 2013, at 3:28, Kevin Walzer wrote: > On 3/30/13 7:37 PM, sameer wrote: >> Does anyone have any hints about how I can make this work? I am new to Mac >> Apps and sandboxing. > > This appears to be the error: > > 3/30/13 7:04:02.050 PM [0x0-0xb15b15].com.falkorsystems.defisheye: ImportError: dlopen(/Users/sameer/Documents/Falkor Systems/gopro_calibration/DeFisheye/dist/DeFisheye.app/Contents/Resources/lib/python2.7/lib-dynload/cv2.so, 2): Library not loaded: /usr/X11/lib/libpng15.15.dylib > 3/30/13 7:04:02.050 PM [0x0-0xb15b15].com.falkorsystems.defisheye: Referenced from: /Users/sameer/Documents/Falkor Systems/gopro_calibration/DeFisheye/dist/DeFisheye.app/Contents/MacOS/../Frameworks/libopencv_highgui.2.4.4.dylib > 3/30/13 7:04:02.050 PM [0x0-0xb15b15].com.falkorsystems.defisheye: Reason: no suitable image found. Did find: > 3/30/13 7:04:02.050 PM [0x0-0xb15b15].com.falkorsystems.defisheye: /usr/X11/lib/libpng15.15.dylib: open() failed with errno=1 > 3/30/13 7:04:02.119 PM DeFisheye: DeFisheye Error > > Some linking error to libpng, apparently. This wouldn't seem to have anything to do with the Cocoa linking issue in py2app. Right. This appears to be an issue with copying shared libraries into the application bundle, py2app is supposed to recursively copy all libraries used into the bundle and rewrite the load commands, but for some reason han't done so for the dependencies of libopencv_highgui.2.4.4.dylib. There is little I can do about this without a script to reproduce the problem. Ronald > > --Kevin > > -- > Kevin Walzer > Code by Kevin/Mobile Code by Kevin > http://www.codebykevin.com > http://www.wtmobilesoftware.com > _______________________________________________ > 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 yaser.f.ahmed at gmail.com Tue Mar 12 18:27:41 2013 From: yaser.f.ahmed at gmail.com (Yaser Ahmed) Date: Tue, 12 Mar 2013 17:27:41 -0000 Subject: [Pythonmac-SIG] site-packages.zip Message-ID: Is it possible to have py2app exclude the site-packages.zip. I have tried no_zip = 1. Thanks; Yaser -------------- next part -------------- An HTML attachment was scrubbed... URL: From samueljohn.de at gmail.com Tue Mar 19 10:27:20 2013 From: samueljohn.de at gmail.com (Samuel John) Date: Tue, 19 Mar 2013 09:27:20 -0000 Subject: [Pythonmac-SIG] cannot run python agent using launchd (Mountain Lion) In-Reply-To: References: Message-ID: Hi css aka. bakwards-bent spangled spanner :-) On 17.03.2013, at 07:16, spangled spanner wrote: > The script will not execute and console log shows me the following: > > Mar 17 11:53:37 my-MacBook-Pro kernel[0]: CODE SIGNING: > cs_invalid_page(0x1048fe000): p=1134[python] clearing CS_VALID This code sign error is perhaps related to using a hackintosh. luanchd does not require code signing, as far as I know. So perhaps that is not the problem. I recommend to read the [Daemons and Services Programming Guide][1] in the Mac Developer Library. Instead of a shell script, I would make an executable python script. Use the syslog module to debug (and print) from python. You'll find the messages in the Console.app. Check the access rights (and executable bit) and then you can add which python binary to use via the she-bang line (`#!/path/to/my/venv/bin/python` atop). Inside of your python check the `sys.path`. Start with a simple hello-word. Or perhaps even without a venv first... [1]: https://developer.apple.com/library/mac/#documentation/MacOSX/Conceptual/BPSystemStartup/Chapters/Introduction.html bests Samuel