From wrw at mac.com Tue Sep 4 20:19:13 2012 From: wrw at mac.com (William R. Wing (Bill Wing)) Date: Tue, 04 Sep 2012 14:19:13 -0400 Subject: [Pythonmac-SIG] Matplotlib-animation problem Message-ID: <67DE0FD9-AD6F-4470-AEA2-7FEF70DC609E@mac.com> I'm running Mac OS-X 10.8.1, with python 2.7.3, numpy 1.8.0, matplotlib 1.2, and wxPython 2.9.3.1 (although wx isn't involved here, at least I don't think so). I'm running on a dual-quad processor Xeon Mac Pro. I decided to learn something about animated matplotlib graphics, so started to look at the examples in http://matplotlib.sourceforge.net/examples/animation/... I consistently run into a problem, illustrated below. Starting from the animate_decay.py code, copied and pasted into an editor as here: #!/usr/bin/env python """ http://matplotlib.sourceforge.net/examples/animation/animate_decay.html """ import numpy as np import matplotlib.pyplot as plt import matplotlib.animation as animation def data_gen(): t = data_gen.t cnt = 0 while cnt < 1000: cnt+=1 t += 0.05 yield t, np.sin(2*np.pi*t) * np.exp(-t/10.) data_gen.t = 0 fig = plt.figure() ax = fig.add_subplot(111) line, = ax.plot([], [], lw=2) ax.set_ylim(-1.1, 1.1) ax.set_xlim(0, 5) ax.grid() xdata, ydata = [], [] def run(data): # update the data t,y = data xdata.append(t) ydata.append(y) xmin, xmax = ax.get_xlim() if t >= xmax: ax.set_xlim(xmin, 2*xmax) ax.figure.canvas.draw() line.set_data(xdata, ydata) return line, ani = animation.FuncAnimation(fig, run, data_gen, blit=True, interval=10, repeat=False) plt.show() If I attempt to run this script (or any of several others), I get: StraylightPro:Matplotlib_stuff wrw$ ./animate_decay.py Traceback (most recent call last): File "/Library/Python/2.7/site-packages/matplotlib-1.2.x-py2.7-macosx-10.8-intel.egg/matplotlib/backend_bases.py", line 1117, in _on_timer ret = func(*args, **kwargs) File "/Library/Python/2.7/site-packages/matplotlib-1.2.x-py2.7-macosx-10.8-intel.egg/matplotlib/animation.py", line 763, in _step still_going = Animation._step(self, *args) File "/Library/Python/2.7/site-packages/matplotlib-1.2.x-py2.7-macosx-10.8-intel.egg/matplotlib/animation.py", line 625, in _step self._draw_next_frame(framedata, self._blit) File "/Library/Python/2.7/site-packages/matplotlib-1.2.x-py2.7-macosx-10.8-intel.egg/matplotlib/animation.py", line 645, in _draw_next_frame self._post_draw(framedata, blit) File "/Library/Python/2.7/site-packages/matplotlib-1.2.x-py2.7-macosx-10.8-intel.egg/matplotlib/animation.py", line 668, in _post_draw self._blit_draw(self._drawn_artists, self._blit_cache) File "/Library/Python/2.7/site-packages/matplotlib-1.2.x-py2.7-macosx-10.8-intel.egg/matplotlib/animation.py", line 682, in _blit_draw bg_cache[a.axes] = a.figure.canvas.copy_from_bbox(a.axes.bbox) AttributeError: 'FigureCanvasMac' object has no attribute 'copy_from_bbox' Traceback (most recent call last): File "/Library/Python/2.7/site-packages/matplotlib-1.2.x-py2.7-macosx-10.8-intel.egg/matplotlib/backend_bases.py", line 1117, in _on_timer ret = func(*args, **kwargs) File "/Library/Python/2.7/site-packages/matplotlib-1.2.x-py2.7-macosx-10.8-intel.egg/matplotlib/animation.py", line 763, in _step still_going = Animation._step(self, *args) File "/Library/Python/2.7/site-packages/matplotlib-1.2.x-py2.7-macosx-10.8-intel.egg/matplotlib/animation.py", line 625, in _step self._draw_next_frame(framedata, self._blit) File "/Library/Python/2.7/site-packages/matplotlib-1.2.x-py2.7-macosx-10.8-intel.egg/matplotlib/animation.py", line 643, in _draw_next_frame self._pre_draw(framedata, blit) File "/Library/Python/2.7/site-packages/matplotlib-1.2.x-py2.7-macosx-10.8-intel.egg/matplotlib/animation.py", line 656, in _pre_draw self._blit_clear(self._drawn_artists, self._blit_cache) File "/Library/Python/2.7/site-packages/matplotlib-1.2.x-py2.7-macosx-10.8-intel.egg/matplotlib/animation.py", line 696, in _blit_clear a.figure.canvas.restore_region(bg_cache[a]) AttributeError: 'FigureCanvasMac' object has no attribute 'restore_region' ?and the 'restore-region' error sequence then repeats endlessly. I'm hoping this is all caused by my not quite having the right library installed someplace along the line. If anyone could point it out, I'd sure appreciate it. Thanks, Bill -------------- next part -------------- An HTML attachment was scrubbed... URL: From nad at acm.org Tue Sep 4 23:41:24 2012 From: nad at acm.org (Ned Deily) Date: Tue, 04 Sep 2012 14:41:24 -0700 Subject: [Pythonmac-SIG] Matplotlib-animation problem References: <67DE0FD9-AD6F-4470-AEA2-7FEF70DC609E@mac.com> Message-ID: In article <67DE0FD9-AD6F-4470-AEA2-7FEF70DC609E at mac.com>, "William R. Wing (Bill Wing)" wrote: > I'm running Mac OS-X 10.8.1, with python 2.7.3, numpy 1.8.0, matplotlib 1.2, > and wxPython 2.9.3.1 (although wx isn't involved here, at least I don't think > so). I'm running on a dual-quad processor Xeon Mac Pro. > > I decided to learn something about animated matplotlib graphics, so started > to look at the examples in > http://matplotlib.sourceforge.net/examples/animation/... > > I consistently run into a problem, illustrated below. Starting from the > animate_decay.py code, copied and pasted into an editor as here: [...]> > ...and the 'restore-region' error sequence then repeats endlessly. > > I'm hoping this is all caused by my not quite having the right library > installed someplace along the line. If anyone could point it out, I'd sure > appreciate it. I have no experience with matplotlib other than having played with a few of the examples. I have the current versions from MacPorts installed (1.1.1 with MacPorts numpy 1.6.2 and MacPorts python 2.7.3, no wxPython, all on 10.8.1) and, FWIW, I see the same behavior running your example as you report. -- Ned Deily, nad at acm.org From thomas.robitaille at gmail.com Wed Sep 5 21:51:50 2012 From: thomas.robitaille at gmail.com (Thomas Robitaille) Date: Wed, 5 Sep 2012 21:51:50 +0200 Subject: [Pythonmac-SIG] Matplotlib-animation problem In-Reply-To: <67DE0FD9-AD6F-4470-AEA2-7FEF70DC609E@mac.com> References: <67DE0FD9-AD6F-4470-AEA2-7FEF70DC609E@mac.com> Message-ID: It's a known problem with the MacOS X backend: http://matplotlib.1069221.n5.nabble.com/Animation-example-error-on-Mac-after-installation-td26960.html Try changing backend - for example, add import matplotlib matplotlib.use('TkAgg') just *before* import numpy as np import matplotlib.pyplot as plt import matplotlib.animation as animation This works for me. Cheers, Tom On 4 September 2012 20:19, William R. Wing (Bill Wing) wrote: > I'm running Mac OS-X 10.8.1, with python 2.7.3, numpy 1.8.0, matplotlib 1.2, > and wxPython 2.9.3.1 (although wx isn't involved here, at least I don't > think so). I'm running on a dual-quad processor Xeon Mac Pro. > > I decided to learn something about animated matplotlib graphics, so started > to look at the examples in > http://matplotlib.sourceforge.net/examples/animation/... > > I consistently run into a problem, illustrated below. Starting from the > animate_decay.py code, copied and pasted into an editor as here: > > #!/usr/bin/env python > """ > http://matplotlib.sourceforge.net/examples/animation/animate_decay.html > """ > > import numpy as np > import matplotlib.pyplot as plt > import matplotlib.animation as animation > > def data_gen(): > t = data_gen.t > cnt = 0 > while cnt < 1000: > cnt+=1 > t += 0.05 > yield t, np.sin(2*np.pi*t) * np.exp(-t/10.) > data_gen.t = 0 > > fig = plt.figure() > ax = fig.add_subplot(111) > line, = ax.plot([], [], lw=2) > ax.set_ylim(-1.1, 1.1) > ax.set_xlim(0, 5) > ax.grid() > xdata, ydata = [], [] > def run(data): > # update the data > t,y = data > xdata.append(t) > ydata.append(y) > xmin, xmax = ax.get_xlim() > > if t >= xmax: > ax.set_xlim(xmin, 2*xmax) > ax.figure.canvas.draw() > line.set_data(xdata, ydata) > > return line, > > ani = animation.FuncAnimation(fig, run, data_gen, blit=True, interval=10, > repeat=False) > plt.show() > > > If I attempt to run this script (or any of several others), I get: > > StraylightPro:Matplotlib_stuff wrw$ ./animate_decay.py > Traceback (most recent call last): > File > "/Library/Python/2.7/site-packages/matplotlib-1.2.x-py2.7-macosx-10.8-intel.egg/matplotlib/backend_bases.py", > line 1117, in _on_timer > ret = func(*args, **kwargs) > File > "/Library/Python/2.7/site-packages/matplotlib-1.2.x-py2.7-macosx-10.8-intel.egg/matplotlib/animation.py", > line 763, in _step > still_going = Animation._step(self, *args) > File > "/Library/Python/2.7/site-packages/matplotlib-1.2.x-py2.7-macosx-10.8-intel.egg/matplotlib/animation.py", > line 625, in _step > self._draw_next_frame(framedata, self._blit) > File > "/Library/Python/2.7/site-packages/matplotlib-1.2.x-py2.7-macosx-10.8-intel.egg/matplotlib/animation.py", > line 645, in _draw_next_frame > self._post_draw(framedata, blit) > File > "/Library/Python/2.7/site-packages/matplotlib-1.2.x-py2.7-macosx-10.8-intel.egg/matplotlib/animation.py", > line 668, in _post_draw > self._blit_draw(self._drawn_artists, self._blit_cache) > File > "/Library/Python/2.7/site-packages/matplotlib-1.2.x-py2.7-macosx-10.8-intel.egg/matplotlib/animation.py", > line 682, in _blit_draw > bg_cache[a.axes] = a.figure.canvas.copy_from_bbox(a.axes.bbox) > AttributeError: 'FigureCanvasMac' object has no attribute 'copy_from_bbox' > Traceback (most recent call last): > File > "/Library/Python/2.7/site-packages/matplotlib-1.2.x-py2.7-macosx-10.8-intel.egg/matplotlib/backend_bases.py", > line 1117, in _on_timer > ret = func(*args, **kwargs) > File > "/Library/Python/2.7/site-packages/matplotlib-1.2.x-py2.7-macosx-10.8-intel.egg/matplotlib/animation.py", > line 763, in _step > still_going = Animation._step(self, *args) > File > "/Library/Python/2.7/site-packages/matplotlib-1.2.x-py2.7-macosx-10.8-intel.egg/matplotlib/animation.py", > line 625, in _step > self._draw_next_frame(framedata, self._blit) > File > "/Library/Python/2.7/site-packages/matplotlib-1.2.x-py2.7-macosx-10.8-intel.egg/matplotlib/animation.py", > line 643, in _draw_next_frame > self._pre_draw(framedata, blit) > File > "/Library/Python/2.7/site-packages/matplotlib-1.2.x-py2.7-macosx-10.8-intel.egg/matplotlib/animation.py", > line 656, in _pre_draw > self._blit_clear(self._drawn_artists, self._blit_cache) > File > "/Library/Python/2.7/site-packages/matplotlib-1.2.x-py2.7-macosx-10.8-intel.egg/matplotlib/animation.py", > line 696, in _blit_clear > a.figure.canvas.restore_region(bg_cache[a]) > AttributeError: 'FigureCanvasMac' object has no attribute 'restore_region' > > > ?and the 'restore-region' error sequence then repeats endlessly. > > I'm hoping this is all caused by my not quite having the right library > installed someplace along the line. If anyone could point it out, I'd sure > appreciate it. > > Thanks, > Bill > > _______________________________________________ > Pythonmac-SIG maillist - Pythonmac-SIG at python.org > http://mail.python.org/mailman/listinfo/pythonmac-sig > unsubscribe: http://mail.python.org/mailman/options/Pythonmac-SIG > From poalman at gmail.com Sun Sep 9 20:34:00 2012 From: poalman at gmail.com (Paul Wiseman) Date: Sun, 9 Sep 2012 19:34:00 +0100 Subject: [Pythonmac-SIG] py2app unable to find cprocessors.so Message-ID: Hey, When building an app that is using sqlalchemy I get this error: creating python loader for extension 'sqlalchemy.cprocessors' error: /Users/paul/Source/Python/build/bdist.macosx-10.6-intel/python2.7-standalone/app/temp/sqlalchemy/cprocessors.py: No such file or directory I took a look in site packages and there is no cprocessors.py, but a cprocessors.so - so maybe it is just looking for the wrong extension I tried adding "sqlalchemy.cprocessors" to the includes list in py2app but that hasn't helped. I was wondering if I can fool it by dropping an empty cprocessors.py so it will build, then swap it out afterwards for the so, but I'm sure there's a better way and I'm not convinced that could even work. Surely py2app doesn't assume every extension is .py, or if it does can it be changed? -------------- next part -------------- An HTML attachment was scrubbed... URL: From ronaldoussoren at mac.com Mon Sep 10 14:18:21 2012 From: ronaldoussoren at mac.com (Ronald Oussoren) Date: Mon, 10 Sep 2012 14:18:21 +0200 Subject: [Pythonmac-SIG] py2app unable to find cprocessors.so In-Reply-To: References: Message-ID: On 9 Sep, 2012, at 20:34, Paul Wiseman wrote: > Hey, > > When building an app that is using sqlalchemy I get this error: > > creating python loader for extension 'sqlalchemy.cprocessors' > error: /Users/paul/Source/Python/build/bdist.macosx-10.6-intel/python2.7-standalone/app/temp/sqlalchemy/cprocessors.py: No such file or directory > > I took a look in site packages and there is no cprocessors.py, but a cprocessors.so - so maybe it is just looking for the wrong extension > > I tried adding "sqlalchemy.cprocessors" to the includes list in py2app but that hasn't helped. > > I was wondering if I can fool it by dropping an empty cprocessors.py so it will build, then swap it out afterwards for the so, but I'm sure there's a better way and I'm not convinced that could even work. > > Surely py2app doesn't assume every extension is .py, or if it does can it be changed? Py2app does not assume that every extension is a python file. Given the messasge I'd say that the error occurs in the code path that creates a helper python file that actually loads the exention. A little background information: when py2app creates the application bundle all modules are stored in a zipfile and loaded using python's zipimporter. Extensions cannot be stored in the zipfiles because the zipimporter doesn't support that. Py2app therefore creates a placeholder python module in the zipfile that loads the extensions from a directory in the application bundle. BTW. could you please create a sample project that demonstrates the problem? I've tried to reproduce your problem on my machine and failed to do so. I did run into another problem, py2app generated an incomplete bundle due to confusion between a _collections submodule in SQLAlchemy and the _collections extension in the stdlib; that's something I'm currently trying to fix. 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 wrw at mac.com Tue Sep 11 18:53:43 2012 From: wrw at mac.com (William R. Wing (Bill Wing)) Date: Tue, 11 Sep 2012 12:53:43 -0400 Subject: [Pythonmac-SIG] Tkinter/Mac newbie query Message-ID: <28B23F5B-15F4-49CC-BC2D-7DDD0639FC3C@mac.com> Mac OSX 10.8.1, 2 x quad processor Intel MacPro, Python 2.7.3 from python.org. I've been programming in python for a couple of years (off and on), and I'm getting more and more comfortable with it. I'd like to start putting GUIs in front of some of my code, and have been looking at wx, Tkinter, and PyQt. Everything I read says that starting with Tkinter version 8.2 (or something like that) it is "themed" and Tkinter applications should look native on the various platforms. The version of Tkinter I have is 8.5, but when I code up some of the Tkinter demos, they all come out looking more like X11 applications than like native Mac apps. I assume the problem is because I'm not doing SOMETHING right in the initialization, but I'm scratching my head over what. Does anyone have any thoughts as to what I might be doing wrong? I've pasted a typical bit of code in below. #!/usr/bin/env python from Tkinter import * class App: def __init__(self, master): frame = Frame(master) frame.pack() self.button = Button(frame, text="QUIT", fg="red", command=frame.quit) self.button.pack(side=LEFT) self.hi_there = Button(frame, text="Hello", command=self.say_hi) self.hi_there.pack(side=LEFT) def say_hi(self): print "hi there, everyone!" root = Tk() app = App(root) root.mainloop() And yes, the version of python I get via !usr/bin/env is the same one I get at the terminal prompt. Thanks, Bill From kw at codebykevin.com Tue Sep 11 23:12:51 2012 From: kw at codebykevin.com (Kevin Walzer) Date: Tue, 11 Sep 2012 17:12:51 -0400 Subject: [Pythonmac-SIG] Tkinter/Mac newbie query In-Reply-To: <28B23F5B-15F4-49CC-BC2D-7DDD0639FC3C@mac.com> References: <28B23F5B-15F4-49CC-BC2D-7DDD0639FC3C@mac.com> Message-ID: <504FA953.6010303@codebykevin.com> On 9/11/12 12:53 PM, William R. Wing (Bill Wing) wrote: > Mac OSX 10.8.1, 2 x quad processor Intel MacPro, Python 2.7.3 from python.org. > > I've been programming in python for a couple of years (off and on), and I'm getting more and more comfortable with it. > I'd like to start putting GUIs in front of some of my code, and have been looking at wx, Tkinter, and PyQt. > > Everything I read says that starting with Tkinter version 8.2 (or something like that) it is "themed" and Tkinter applications should look native on the various platforms. The version of Tkinter I have is 8.5, but when I code up some of the Tkinter demos, they all come out looking more like X11 applications than like native Mac apps. > > I assume the problem is because I'm not doing SOMETHING right in the initialization, but I'm scratching my head over what. The themed widgets use the ttk prefix, so you'll need to include an "import ttk" statement early on, and then (to avoid collisions with the standard Tk widgets) I suggest using dot notation, cf. ttk.Button. Also, remember that the ttk widgets are not drop-in replacements for the traditional Tk widgets; they have a similar API, but they are not identicial (cf. you can't set the foreground for them without creating an entirely custom stule; they pick up platform defaults much better, though). -- Kevin Walzer Code by Kevin http://www.codebykevin.com From poalman at gmail.com Wed Sep 12 13:08:47 2012 From: poalman at gmail.com (Paul Wiseman) Date: Wed, 12 Sep 2012 12:08:47 +0100 Subject: [Pythonmac-SIG] py2app unable to find cprocessors.so In-Reply-To: References: Message-ID: On 10 September 2012 13:18, Ronald Oussoren wrote: > > On 9 Sep, 2012, at 20:34, Paul Wiseman wrote: > > Hey, > > When building an app that is using sqlalchemy I get this error: > > creating python loader for extension 'sqlalchemy.cprocessors' > error: > /Users/paul/Source/Python/build/bdist.macosx-10.6-intel/python2.7-standalone/app/temp/sqlalchemy/cprocessors.py: > No such file or directory > > I took a look in site packages and there is no cprocessors.py, but a > cprocessors.so - so maybe it is just looking for the wrong extension > > I tried adding "sqlalchemy.cprocessors" to the includes list in py2app but > that hasn't helped. > > I was wondering if I can fool it by dropping an empty cprocessors.py so it > will build, then swap it out afterwards for the so, but I'm sure there's a > better way and I'm not convinced that could even work. > > Surely py2app doesn't assume every extension is .py, or if it does can it > be changed? > > > Py2app does not assume that every extension is a python file. Given the > messasge I'd say that the error occurs in the code path that creates a > helper python file that actually loads the exention. > > A little background information: when py2app creates the application > bundle all modules are stored in a zipfile and loaded using python's > zipimporter. Extensions cannot be stored in the zipfiles because the > zipimporter doesn't support that. Py2app therefore creates a placeholder > python module in the zipfile that loads the extensions from a directory in > the application bundle. > > BTW. could you please create a sample project that demonstrates the > problem? I've tried to reproduce your problem on my machine and failed to > do so. I did run into another problem, py2app generated an incomplete > bundle due to confusion between a _collections submodule in SQLAlchemy and > the _collections extension in the stdlib; that's something I'm currently > trying to fix. > > Ronald > (Oops just realised I didn't reply to the mailing list before) Ah, I've found out how to recreate the error If I create a main.py with nothing but 'import sqlalchemy' then use the following setup.py: from setuptools import setup setup( version="1", name="TestApp1", app=["main.py"], setup_requires=["py2app"] ) setup( version="1", name="TestApp2", app=["main.py"], setup_requires=["py2app"] ) If it doesn't produce the error it's probably because of this: "The "cprocessors" module in SQLAlchemy is written in C and compiles conditionally, based on if the current platform supports compiling it. If not present, SQLAlchemy continues to work perfectly well as the hooks which attempt to import it will fall back to pure-Python functions instead." So you may have a cprocessors.py which I dont think you'd get the problem, only if it compiled the .so when sqlalchemy installed. I get the error, but only when it builds the second app. In my main build script I make a few apps in the same script (I make 3 apps which get moved into the main app, any additional code in their site-packages.zip is moved into the main apps zip, I remove the "sub-apps" Contents/Resources/lib folder and symlink it at run time to the main apps lib folder.) Is this a bug or are you never supposed to run multiple setups in the same build? If not how can I achieve the above? > _______________________________________________ > 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 michael.mccracken at gmail.com Wed Sep 12 19:13:50 2012 From: michael.mccracken at gmail.com (Michael McCracken) Date: Wed, 12 Sep 2012 10:13:50 -0700 Subject: [Pythonmac-SIG] py2app unable to find cprocessors.so In-Reply-To: References: Message-ID: On Wed, Sep 12, 2012 at 4:08 AM, Paul Wiseman wrote: > On 10 September 2012 13:18, Ronald Oussoren wrote: >> >> >> On 9 Sep, 2012, at 20:34, Paul Wiseman wrote: >> >> Hey, >> >> When building an app that is using sqlalchemy I get this error: >> >> creating python loader for extension 'sqlalchemy.cprocessors' >> error: >> /Users/paul/Source/Python/build/bdist.macosx-10.6-intel/python2.7-standalone/app/temp/sqlalchemy/cprocessors.py: >> No such file or directory >> >> I took a look in site packages and there is no cprocessors.py, but a >> cprocessors.so - so maybe it is just looking for the wrong extension >> >> I tried adding "sqlalchemy.cprocessors" to the includes list in py2app but >> that hasn't helped. >> >> I was wondering if I can fool it by dropping an empty cprocessors.py so it >> will build, then swap it out afterwards for the so, but I'm sure there's a >> better way and I'm not convinced that could even work. >> >> Surely py2app doesn't assume every extension is .py, or if it does can it >> be changed? >> >> >> Py2app does not assume that every extension is a python file. Given the >> messasge I'd say that the error occurs in the code path that creates a >> helper python file that actually loads the exention. >> >> A little background information: when py2app creates the application >> bundle all modules are stored in a zipfile and loaded using python's >> zipimporter. Extensions cannot be stored in the zipfiles because the >> zipimporter doesn't support that. Py2app therefore creates a placeholder >> python module in the zipfile that loads the extensions from a directory in >> the application bundle. >> >> BTW. could you please create a sample project that demonstrates the >> problem? I've tried to reproduce your problem on my machine and failed to do >> so. I did run into another problem, py2app generated an incomplete bundle >> due to confusion between a _collections submodule in SQLAlchemy and the >> _collections extension in the stdlib; that's something I'm currently trying >> to fix. >> >> Ronald > > > (Oops just realised I didn't reply to the mailing list before) > > Ah, > > I've found out how to recreate the error > > If I create a main.py with nothing but 'import sqlalchemy' > > then use the following setup.py: > > from setuptools import setup > > setup( > version="1", > name="TestApp1", > app=["main.py"], > setup_requires=["py2app"] > ) > > setup( > version="1", > name="TestApp2", > app=["main.py"], > setup_requires=["py2app"] > ) > > If it doesn't produce the error it's probably because of this: "The > "cprocessors" module in SQLAlchemy is written in C and compiles > conditionally, based on if the current platform supports compiling it. If > not present, SQLAlchemy continues to work perfectly well as the hooks which > attempt to import it will fall back to pure-Python functions instead." So > you may have a cprocessors.py which I dont think you'd get the problem, only > if it compiled the .so when sqlalchemy installed. > > I get the error, but only when it builds the second app. In my main build > script I make a few apps in the same script (I make 3 apps which get moved > into the main app, any additional code in their site-packages.zip is moved > into the main apps zip, I remove the "sub-apps" Contents/Resources/lib > folder and symlink it at run time to the main apps lib folder.) > > Is this a bug or are you never supposed to run multiple setups in the same > build? If not how can I achieve the above? Paul, I'm also doing multiple calls to setup and it works. Does the main app import sqlalchemy? I ask because just removing SubApp.app/Contents/Resources/lib and symlinking that whole thing will remove anything in SubApp.app/Contents/Resources/lib/pythonx.y/lib-dynload/ , and if the sub app needs something in there that isn't in the lib-dynload path of the main app, then you won't have it in the final package. In my case I have a step that copies files from sub-app lib-dynload folders into the main app's folder before replacing the whole /lib dir with a symlink. Sounds like you might have to do the same thing. Hope this helps, -mike From poalman at gmail.com Wed Sep 12 19:54:59 2012 From: poalman at gmail.com (Paul Wiseman) Date: Wed, 12 Sep 2012 18:54:59 +0100 Subject: [Pythonmac-SIG] py2app unable to find cprocessors.so In-Reply-To: References: Message-ID: On 12 September 2012 18:13, Michael McCracken wrote: > On Wed, Sep 12, 2012 at 4:08 AM, Paul Wiseman wrote: > > On 10 September 2012 13:18, Ronald Oussoren > wrote: > >> > >> > >> On 9 Sep, 2012, at 20:34, Paul Wiseman wrote: > >> > >> Hey, > >> > >> When building an app that is using sqlalchemy I get this error: > >> > >> creating python loader for extension 'sqlalchemy.cprocessors' > >> error: > >> > /Users/paul/Source/Python/build/bdist.macosx-10.6-intel/python2.7-standalone/app/temp/sqlalchemy/cprocessors.py: > >> No such file or directory > >> > >> I took a look in site packages and there is no cprocessors.py, but a > >> cprocessors.so - so maybe it is just looking for the wrong extension > >> > >> I tried adding "sqlalchemy.cprocessors" to the includes list in py2app > but > >> that hasn't helped. > >> > >> I was wondering if I can fool it by dropping an empty cprocessors.py so > it > >> will build, then swap it out afterwards for the so, but I'm sure > there's a > >> better way and I'm not convinced that could even work. > >> > >> Surely py2app doesn't assume every extension is .py, or if it does can > it > >> be changed? > >> > >> > >> Py2app does not assume that every extension is a python file. Given the > >> messasge I'd say that the error occurs in the code path that creates a > >> helper python file that actually loads the exention. > >> > >> A little background information: when py2app creates the application > >> bundle all modules are stored in a zipfile and loaded using python's > >> zipimporter. Extensions cannot be stored in the zipfiles because the > >> zipimporter doesn't support that. Py2app therefore creates a placeholder > >> python module in the zipfile that loads the extensions from a directory > in > >> the application bundle. > >> > >> BTW. could you please create a sample project that demonstrates the > >> problem? I've tried to reproduce your problem on my machine and failed > to do > >> so. I did run into another problem, py2app generated an incomplete > bundle > >> due to confusion between a _collections submodule in SQLAlchemy and the > >> _collections extension in the stdlib; that's something I'm currently > trying > >> to fix. > >> > >> Ronald > > > > > > (Oops just realised I didn't reply to the mailing list before) > > > > Ah, > > > > I've found out how to recreate the error > > > > If I create a main.py with nothing but 'import sqlalchemy' > > > > then use the following setup.py: > > > > from setuptools import setup > > > > setup( > > version="1", > > name="TestApp1", > > app=["main.py"], > > setup_requires=["py2app"] > > ) > > > > setup( > > version="1", > > name="TestApp2", > > app=["main.py"], > > setup_requires=["py2app"] > > ) > > > > If it doesn't produce the error it's probably because of this: "The > > "cprocessors" module in SQLAlchemy is written in C and compiles > > conditionally, based on if the current platform supports compiling it. > If > > not present, SQLAlchemy continues to work perfectly well as the hooks > which > > attempt to import it will fall back to pure-Python functions instead." So > > you may have a cprocessors.py which I dont think you'd get the problem, > only > > if it compiled the .so when sqlalchemy installed. > > > > I get the error, but only when it builds the second app. In my main build > > script I make a few apps in the same script (I make 3 apps which get > moved > > into the main app, any additional code in their site-packages.zip is > moved > > into the main apps zip, I remove the "sub-apps" Contents/Resources/lib > > folder and symlink it at run time to the main apps lib folder.) > > > > Is this a bug or are you never supposed to run multiple setups in the > same > > build? If not how can I achieve the above? > > Paul, I'm also doing multiple calls to setup and it works. > Does the main app import sqlalchemy? > I ask because just removing SubApp.app/Contents/Resources/lib and > symlinking that whole thing will remove anything in > SubApp.app/Contents/Resources/lib/pythonx.y/lib-dynload/ , and if the > sub app needs something in there that isn't in the lib-dynload path of > the main app, then you won't have it in the final package. > > In my case I have a step that copies files from sub-app lib-dynload > folders into the main app's folder before replacing the whole /lib dir > with a symlink. > Sounds like you might have to do the same thing. > > Hope this helps, > -mike > Ah I think I do need that step you're right. my sub apps are a subset of the main app, so I think I've gotten away with not copying anything over. I'll definitely add that into my build script though. The error isn't related to the fact I symlink the lib folders together, though, this is failing while building the second app. I just mentioned it to explain why I want to call setup multiple times, I didn't know if it was a common practice or not. Yea the main.py is just "import sqlalchemy" in my example, so the first and second app will be the same in the example (both import sqlalchemy). Could you check if you have "cprocessors.so" or "cprocessors.py" in your site-packages/sqlalchemy folder? I think the above error only occurs if you have the .so -------------- next part -------------- An HTML attachment was scrubbed... URL: From michael.mccracken at gmail.com Wed Sep 12 20:27:57 2012 From: michael.mccracken at gmail.com (Michael McCracken) Date: Wed, 12 Sep 2012 11:27:57 -0700 Subject: [Pythonmac-SIG] py2app unable to find cprocessors.so In-Reply-To: References: Message-ID: On Wed, Sep 12, 2012 at 10:54 AM, Paul Wiseman wrote: > On 12 September 2012 18:13, Michael McCracken > wrote: >> >> On Wed, Sep 12, 2012 at 4:08 AM, Paul Wiseman wrote: >> > On 10 September 2012 13:18, Ronald Oussoren >> > wrote: >> >> >> >> >> >> On 9 Sep, 2012, at 20:34, Paul Wiseman wrote: >> >> >> >> Hey, >> >> >> >> When building an app that is using sqlalchemy I get this error: >> >> >> >> creating python loader for extension 'sqlalchemy.cprocessors' >> >> error: >> >> >> >> /Users/paul/Source/Python/build/bdist.macosx-10.6-intel/python2.7-standalone/app/temp/sqlalchemy/cprocessors.py: >> >> No such file or directory >> >> >> >> I took a look in site packages and there is no cprocessors.py, but a >> >> cprocessors.so - so maybe it is just looking for the wrong extension >> >> >> >> I tried adding "sqlalchemy.cprocessors" to the includes list in py2app >> >> but >> >> that hasn't helped. >> >> >> >> I was wondering if I can fool it by dropping an empty cprocessors.py so >> >> it >> >> will build, then swap it out afterwards for the so, but I'm sure >> >> there's a >> >> better way and I'm not convinced that could even work. >> >> >> >> Surely py2app doesn't assume every extension is .py, or if it does can >> >> it >> >> be changed? >> >> >> >> >> >> Py2app does not assume that every extension is a python file. Given the >> >> messasge I'd say that the error occurs in the code path that creates a >> >> helper python file that actually loads the exention. >> >> >> >> A little background information: when py2app creates the application >> >> bundle all modules are stored in a zipfile and loaded using python's >> >> zipimporter. Extensions cannot be stored in the zipfiles because the >> >> zipimporter doesn't support that. Py2app therefore creates a >> >> placeholder >> >> python module in the zipfile that loads the extensions from a directory >> >> in >> >> the application bundle. >> >> >> >> BTW. could you please create a sample project that demonstrates the >> >> problem? I've tried to reproduce your problem on my machine and failed >> >> to do >> >> so. I did run into another problem, py2app generated an incomplete >> >> bundle >> >> due to confusion between a _collections submodule in SQLAlchemy and the >> >> _collections extension in the stdlib; that's something I'm currently >> >> trying >> >> to fix. >> >> >> >> Ronald >> > >> > >> > (Oops just realised I didn't reply to the mailing list before) >> > >> > Ah, >> > >> > I've found out how to recreate the error >> > >> > If I create a main.py with nothing but 'import sqlalchemy' >> > >> > then use the following setup.py: >> > >> > from setuptools import setup >> > >> > setup( >> > version="1", >> > name="TestApp1", >> > app=["main.py"], >> > setup_requires=["py2app"] >> > ) >> > >> > setup( >> > version="1", >> > name="TestApp2", >> > app=["main.py"], >> > setup_requires=["py2app"] >> > ) >> > >> > If it doesn't produce the error it's probably because of this: "The >> > "cprocessors" module in SQLAlchemy is written in C and compiles >> > conditionally, based on if the current platform supports compiling it. >> > If >> > not present, SQLAlchemy continues to work perfectly well as the hooks >> > which >> > attempt to import it will fall back to pure-Python functions instead." >> > So >> > you may have a cprocessors.py which I dont think you'd get the problem, >> > only >> > if it compiled the .so when sqlalchemy installed. >> > >> > I get the error, but only when it builds the second app. In my main >> > build >> > script I make a few apps in the same script (I make 3 apps which get >> > moved >> > into the main app, any additional code in their site-packages.zip is >> > moved >> > into the main apps zip, I remove the "sub-apps" Contents/Resources/lib >> > folder and symlink it at run time to the main apps lib folder.) >> > >> > Is this a bug or are you never supposed to run multiple setups in the >> > same >> > build? If not how can I achieve the above? >> >> Paul, I'm also doing multiple calls to setup and it works. >> Does the main app import sqlalchemy? >> I ask because just removing SubApp.app/Contents/Resources/lib and >> symlinking that whole thing will remove anything in >> SubApp.app/Contents/Resources/lib/pythonx.y/lib-dynload/ , and if the >> sub app needs something in there that isn't in the lib-dynload path of >> the main app, then you won't have it in the final package. >> >> In my case I have a step that copies files from sub-app lib-dynload >> folders into the main app's folder before replacing the whole /lib dir >> with a symlink. >> Sounds like you might have to do the same thing. >> >> Hope this helps, >> -mike > > > Ah I think I do need that step you're right. my sub apps are a subset of the > main app, so I think I've gotten away with not copying anything over. I'll > definitely add that into my build script though. > > The error isn't related to the fact I symlink the lib folders together, > though, this is failing while building the second app. I just mentioned it > to explain why I want to call setup multiple times, I didn't know if it was > a common practice or not. > > Yea the main.py is just "import sqlalchemy" in my example, so the first and > second app will be the same in the example (both import sqlalchemy). Could > you check if you have "cprocessors.so" or "cprocessors.py" in your > site-packages/sqlalchemy folder? I think the above error only occurs if you > have the .so Ah, right - good point, the example wouldn't have the issue I mentioned. I can't reproduce your issue on OS X 10.7, with a recent trunk version of py2app. With a freshly installed sqlalchemy, building your sample runs fine, and I get dist/TestApp2.app/Contents/Resources/lib/python2.7/lib-dynload/sqlalchemy: total used in directory 144 available 41745048 drwxr-xr-x 4 mmccrack staff 136 Sep 12 11:11 . drwxr-xr-x 49 mmccrack staff 1666 Sep 12 11:11 .. -rw-r--r-- 1 mmccrack staff 34716 Sep 12 11:11 cprocessors.so -rw-r--r-- 1 mmccrack staff 35960 Sep 12 11:11 cresultproxy.so There is a sqlalchemy/cprocessors.py in the site-packages.zip. This appears correct to me, and if I add these lines to the main.py: from sqlalchemy import cprocessors print cprocessors.__file__ I get this: 9/12/12 11:25:37.274 AM [0x0-0x317c179].org.pythonmac.unspecified.TestApp2: /Users/mmccrack/Documents/Canonical/Source/spikes/test-sqlalchemy-app/dist/TestApp2.app/Contents/Resources/lib/python2.7/lib-dynload/sqlalchemy/cprocessors.so So that seems to be working too... Not sure if this is helpful or not, I'm now wondering if there's a 10.6 issue lurking. -mike From poalman at gmail.com Thu Sep 13 10:47:15 2012 From: poalman at gmail.com (Paul Wiseman) Date: Thu, 13 Sep 2012 09:47:15 +0100 Subject: [Pythonmac-SIG] py2app unable to find cprocessors.so In-Reply-To: <4FAEB541-D6C5-48E6-8F1A-17A6C240D10F@mac.com> References: <4FAEB541-D6C5-48E6-8F1A-17A6C240D10F@mac.com> Message-ID: On 13 September 2012 07:18, Ronald Oussoren wrote: > > On 10 Sep, 2012, at 16:37, Paul Wiseman wrote: > > Ah, > > I've found out how to recreate the error > > If I create a main.py with nothing but 'import sqlalchemy' > > then use the following setup.py: > > from setuptools import setup > > setup( > version="1", > name="TestApp1", > app=["main.py"], > setup_requires=["py2app"] > ) > > setup( > version="1", > name="TestApp2", > app=["main.py"], > setup_requires=["py2app"] > ) > > If it doesn't produce the error it's probably because of this: "The > "cprocessors" module in SQLAlchemy is written in C and compiles > conditionally, based on if the current platform supports compiling it. If > not present, SQLAlchemy continues to work perfectly well as the hooks which > attempt to import it will fall back to pure-Python functions instead." So > you may have a cprocessors.py which I dont think you'd get the problem, > only if it compiled the .so when sqlalchemy installed. > > > I had the cprocessors extension in my build (that is, py2app mentioned in > copied the extension) > > > I get the error, but only when it builds the second app. In my main build > script I make a few apps in the same script (I make 3 apps which get moved > into the main app, any additional code in their site-packages.zip is moved > into the main apps zip, I remove the "sub-apps" Contents/Resources/lib > folder and symlink it at run time to the main apps lib folder.) > > Is this a bug or are you never supposed to run multiple setups in the same > build? If not how can I achieve the above? > > > Calling distutils.setup multiple times is at best untested with py2app, > and I wouldn't be surprised if it causes problems due to state leaking from > one build into the next. A workaround would be to use the subprocess > module to run the setup jobs in separate processes. > > Isn't the problem that they share dist folders, not a process? if not where does the state exist? Would I need to subprocess them from different directories? > BTW. I don't quite understand what you are trying to do with these 3 apps. > Are you building 3 apps that share a lot of code/resources and where you > want two of the apps to link to the 3th one to reduce the amount of > disk-space used? > > Yea exactly, I have some smaller apps which are used for specific separate jobs (one has a simple gui and generates and gathers log files from the main app and zips them up should the main app ever fail to open for instance), the jobs are all to do with the main app and all use a sub set of code to the main app, so I put the apps in the Resources folder and symlink the lib folder so I can include them with only using a little extra disk space, but more importantly keeping the installer size down. > Ronald > > On 10 September 2012 13:18, Ronald Oussoren wrote: > >> >> On 9 Sep, 2012, at 20:34, Paul Wiseman wrote: >> >> Hey, >> >> When building an app that is using sqlalchemy I get this error: >> >> creating python loader for extension 'sqlalchemy.cprocessors' >> error: >> /Users/paul/Source/Python/build/bdist.macosx-10.6-intel/python2.7-standalone/app/temp/sqlalchemy/cprocessors.py: >> No such file or directory >> >> I took a look in site packages and there is no cprocessors.py, but a >> cprocessors.so - so maybe it is just looking for the wrong extension >> >> I tried adding "sqlalchemy.cprocessors" to the includes list in py2app >> but that hasn't helped. >> >> I was wondering if I can fool it by dropping an empty cprocessors.py so >> it will build, then swap it out afterwards for the so, but I'm sure there's >> a better way and I'm not convinced that could even work. >> >> Surely py2app doesn't assume every extension is .py, or if it does can it >> be changed? >> >> >> Py2app does not assume that every extension is a python file. Given the >> messasge I'd say that the error occurs in the code path that creates a >> helper python file that actually loads the exention. >> >> A little background information: when py2app creates the application >> bundle all modules are stored in a zipfile and loaded using python's >> zipimporter. Extensions cannot be stored in the zipfiles because the >> zipimporter doesn't support that. Py2app therefore creates a placeholder >> python module in the zipfile that loads the extensions from a directory in >> the application bundle. >> >> BTW. could you please create a sample project that demonstrates the >> problem? I've tried to reproduce your problem on my machine and failed to >> do so. I did run into another problem, py2app generated an incomplete >> bundle due to confusion between a _collections submodule in SQLAlchemy and >> the _collections extension in the stdlib; that's something I'm currently >> trying to fix. >> >> 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: From ronaldoussoren at mac.com Thu Sep 13 10:53:58 2012 From: ronaldoussoren at mac.com (Ronald Oussoren) Date: Thu, 13 Sep 2012 10:53:58 +0200 Subject: [Pythonmac-SIG] py2app unable to find cprocessors.so In-Reply-To: References: <4FAEB541-D6C5-48E6-8F1A-17A6C240D10F@mac.com> Message-ID: <0498BE1F-2079-454F-8B2D-E97D88F880C3@mac.com> On 13 Sep, 2012, at 10:47, Paul Wiseman wrote: > On 13 September 2012 07:18, Ronald Oussoren wrote: > > On 10 Sep, 2012, at 16:37, Paul Wiseman wrote: > >> Ah, >> >> I've found out how to recreate the error >> >> If I create a main.py with nothing but 'import sqlalchemy' >> >> then use the following setup.py: >> >> from setuptools import setup >> >> setup( >> version="1", >> name="TestApp1", >> app=["main.py"], >> setup_requires=["py2app"] >> ) >> >> setup( >> version="1", >> name="TestApp2", >> app=["main.py"], >> setup_requires=["py2app"] >> ) >> >> If it doesn't produce the error it's probably because of this: "The "cprocessors" module in SQLAlchemy is written in C and compiles conditionally, based on if the current platform supports compiling it. If not present, SQLAlchemy continues to work perfectly well as the hooks which attempt to import it will fall back to pure-Python functions instead." So you may have a cprocessors.py which I dont think you'd get the problem, only if it compiled the .so when sqlalchemy installed. > > I had the cprocessors extension in my build (that is, py2app mentioned in copied the extension) > >> >> I get the error, but only when it builds the second app. In my main build script I make a few apps in the same script (I make 3 apps which get moved into the main app, any additional code in their site-packages.zip is moved into the main apps zip, I remove the "sub-apps" Contents/Resources/lib folder and symlink it at run time to the main apps lib folder.) >> >> Is this a bug or are you never supposed to run multiple setups in the same build? If not how can I achieve the above? > > Calling distutils.setup multiple times is at best untested with py2app, and I wouldn't be surprised if it causes problems due to state leaking from one build into the next. A workaround would be to use the subprocess module to run the setup jobs in separate processes. > > > Isn't the problem that they share dist folders, not a process? if not where does the state exist? Would I need to subprocess them from different directories? The py2app command itself has state and I haven't reviewed the code to know for sure that all state is cleaned up when the command is used twice in the same process. BTW. I also don't know if distutils.setup creates a new py2app command object every time it is called, if the second call to distutils.setup creates a new py2app command object there is no information leakage. > > BTW. I don't quite understand what you are trying to do with these 3 apps. Are you building 3 apps that share a lot of code/resources and where you want two of the apps to link to the 3th one to reduce the amount of disk-space used? > > > Yea exactly, I have some smaller apps which are used for specific separate jobs (one has a simple gui and generates and gathers log files from the main app and zips them up should the main app ever fail to open for instance), the jobs are all to do with the main app and all use a sub set of code to the main app, so I put the apps in the Resources folder and symlink the lib folder so I can include them with only using a little extra disk space, but more importantly keeping the installer size down. That sounds like something that would be useful to support directly. I'll add it to the list of nice-to-have featuers, but don't know when I'll get around to looking into this. Ronald > > Ronald >> >> On 10 September 2012 13:18, Ronald Oussoren wrote: >> >> On 9 Sep, 2012, at 20:34, Paul Wiseman wrote: >> >>> Hey, >>> >>> When building an app that is using sqlalchemy I get this error: >>> >>> creating python loader for extension 'sqlalchemy.cprocessors' >>> error: /Users/paul/Source/Python/build/bdist.macosx-10.6-intel/python2.7-standalone/app/temp/sqlalchemy/cprocessors.py: No such file or directory >>> >>> I took a look in site packages and there is no cprocessors.py, but a cprocessors.so - so maybe it is just looking for the wrong extension >>> >>> I tried adding "sqlalchemy.cprocessors" to the includes list in py2app but that hasn't helped. >>> >>> I was wondering if I can fool it by dropping an empty cprocessors.py so it will build, then swap it out afterwards for the so, but I'm sure there's a better way and I'm not convinced that could even work. >>> >>> Surely py2app doesn't assume every extension is .py, or if it does can it be changed? >> >> Py2app does not assume that every extension is a python file. Given the messasge I'd say that the error occurs in the code path that creates a helper python file that actually loads the exention. >> >> A little background information: when py2app creates the application bundle all modules are stored in a zipfile and loaded using python's zipimporter. Extensions cannot be stored in the zipfiles because the zipimporter doesn't support that. Py2app therefore creates a placeholder python module in the zipfile that loads the extensions from a directory in the application bundle. >> >> BTW. could you please create a sample project that demonstrates the problem? I've tried to reproduce your problem on my machine and failed to do so. I did run into another problem, py2app generated an incomplete bundle due to confusion between a _collections submodule in SQLAlchemy and the _collections extension in the stdlib; that's something I'm currently trying to fix. >> >> 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 poalman at gmail.com Thu Sep 13 11:33:34 2012 From: poalman at gmail.com (Paul Wiseman) Date: Thu, 13 Sep 2012 10:33:34 +0100 Subject: [Pythonmac-SIG] py2app unable to find cprocessors.so In-Reply-To: References: Message-ID: On 12 September 2012 19:27, Michael McCracken wrote: > On Wed, Sep 12, 2012 at 10:54 AM, Paul Wiseman wrote: > > On 12 September 2012 18:13, Michael McCracken < > michael.mccracken at gmail.com> > > wrote: > >> > >> On Wed, Sep 12, 2012 at 4:08 AM, Paul Wiseman > wrote: > >> > On 10 September 2012 13:18, Ronald Oussoren > >> > wrote: > >> >> > >> >> > >> >> On 9 Sep, 2012, at 20:34, Paul Wiseman wrote: > >> >> > >> >> Hey, > >> >> > >> >> When building an app that is using sqlalchemy I get this error: > >> >> > >> >> creating python loader for extension 'sqlalchemy.cprocessors' > >> >> error: > >> >> > >> >> > /Users/paul/Source/Python/build/bdist.macosx-10.6-intel/python2.7-standalone/app/temp/sqlalchemy/cprocessors.py: > >> >> No such file or directory > >> >> > >> >> I took a look in site packages and there is no cprocessors.py, but a > >> >> cprocessors.so - so maybe it is just looking for the wrong extension > >> >> > >> >> I tried adding "sqlalchemy.cprocessors" to the includes list in > py2app > >> >> but > >> >> that hasn't helped. > >> >> > >> >> I was wondering if I can fool it by dropping an empty cprocessors.py > so > >> >> it > >> >> will build, then swap it out afterwards for the so, but I'm sure > >> >> there's a > >> >> better way and I'm not convinced that could even work. > >> >> > >> >> Surely py2app doesn't assume every extension is .py, or if it does > can > >> >> it > >> >> be changed? > >> >> > >> >> > >> >> Py2app does not assume that every extension is a python file. Given > the > >> >> messasge I'd say that the error occurs in the code path that creates > a > >> >> helper python file that actually loads the exention. > >> >> > >> >> A little background information: when py2app creates the application > >> >> bundle all modules are stored in a zipfile and loaded using python's > >> >> zipimporter. Extensions cannot be stored in the zipfiles because the > >> >> zipimporter doesn't support that. Py2app therefore creates a > >> >> placeholder > >> >> python module in the zipfile that loads the extensions from a > directory > >> >> in > >> >> the application bundle. > >> >> > >> >> BTW. could you please create a sample project that demonstrates the > >> >> problem? I've tried to reproduce your problem on my machine and > failed > >> >> to do > >> >> so. I did run into another problem, py2app generated an incomplete > >> >> bundle > >> >> due to confusion between a _collections submodule in SQLAlchemy and > the > >> >> _collections extension in the stdlib; that's something I'm currently > >> >> trying > >> >> to fix. > >> >> > >> >> Ronald > >> > > >> > > >> > (Oops just realised I didn't reply to the mailing list before) > >> > > >> > Ah, > >> > > >> > I've found out how to recreate the error > >> > > >> > If I create a main.py with nothing but 'import sqlalchemy' > >> > > >> > then use the following setup.py: > >> > > >> > from setuptools import setup > >> > > >> > setup( > >> > version="1", > >> > name="TestApp1", > >> > app=["main.py"], > >> > setup_requires=["py2app"] > >> > ) > >> > > >> > setup( > >> > version="1", > >> > name="TestApp2", > >> > app=["main.py"], > >> > setup_requires=["py2app"] > >> > ) > >> > > >> > If it doesn't produce the error it's probably because of this: "The > >> > "cprocessors" module in SQLAlchemy is written in C and compiles > >> > conditionally, based on if the current platform supports compiling it. > >> > If > >> > not present, SQLAlchemy continues to work perfectly well as the hooks > >> > which > >> > attempt to import it will fall back to pure-Python functions instead." > >> > So > >> > you may have a cprocessors.py which I dont think you'd get the > problem, > >> > only > >> > if it compiled the .so when sqlalchemy installed. > >> > > >> > I get the error, but only when it builds the second app. In my main > >> > build > >> > script I make a few apps in the same script (I make 3 apps which get > >> > moved > >> > into the main app, any additional code in their site-packages.zip is > >> > moved > >> > into the main apps zip, I remove the "sub-apps" Contents/Resources/lib > >> > folder and symlink it at run time to the main apps lib folder.) > >> > > >> > Is this a bug or are you never supposed to run multiple setups in the > >> > same > >> > build? If not how can I achieve the above? > >> > >> Paul, I'm also doing multiple calls to setup and it works. > >> Does the main app import sqlalchemy? > >> I ask because just removing SubApp.app/Contents/Resources/lib and > >> symlinking that whole thing will remove anything in > >> SubApp.app/Contents/Resources/lib/pythonx.y/lib-dynload/ , and if the > >> sub app needs something in there that isn't in the lib-dynload path of > >> the main app, then you won't have it in the final package. > >> > >> In my case I have a step that copies files from sub-app lib-dynload > >> folders into the main app's folder before replacing the whole /lib dir > >> with a symlink. > >> Sounds like you might have to do the same thing. > >> > >> Hope this helps, > >> -mike > > > > > > Ah I think I do need that step you're right. my sub apps are a subset of > the > > main app, so I think I've gotten away with not copying anything over. > I'll > > definitely add that into my build script though. > > > > The error isn't related to the fact I symlink the lib folders together, > > though, this is failing while building the second app. I just mentioned > it > > to explain why I want to call setup multiple times, I didn't know if it > was > > a common practice or not. > > > > Yea the main.py is just "import sqlalchemy" in my example, so the first > and > > second app will be the same in the example (both import sqlalchemy). > Could > > you check if you have "cprocessors.so" or "cprocessors.py" in your > > site-packages/sqlalchemy folder? I think the above error only occurs if > you > > have the .so > > Ah, right - good point, the example wouldn't have the issue I mentioned. > > I can't reproduce your issue on OS X 10.7, with a recent trunk version > of py2app. > > With a freshly installed sqlalchemy, building your sample runs fine, and I > get > dist/TestApp2.app/Contents/Resources/lib/python2.7/lib-dynload/sqlalchemy: > total used in directory 144 available 41745048 > drwxr-xr-x 4 mmccrack staff 136 Sep 12 11:11 . > drwxr-xr-x 49 mmccrack staff 1666 Sep 12 11:11 .. > -rw-r--r-- 1 mmccrack staff 34716 Sep 12 11:11 cprocessors.so > -rw-r--r-- 1 mmccrack staff 35960 Sep 12 11:11 cresultproxy.so > > There is a sqlalchemy/cprocessors.py in the site-packages.zip. > > This appears correct to me, and if I add these lines to the main.py: > from sqlalchemy import cprocessors > print cprocessors.__file__ > > I get this: > 9/12/12 11:25:37.274 AM > [0x0-0x317c179].org.pythonmac.unspecified.TestApp2: > > /Users/mmccrack/Documents/Canonical/Source/spikes/test-sqlalchemy-app/dist/TestApp2.app/Contents/Resources/lib/python2.7/lib-dynload/sqlalchemy/cprocessors.so > > So that seems to be working too... > > Not sure if this is helpful or not, I'm now wondering if there's a > 10.6 issue lurking. > -mike > I checked out the latest trunk ( http://svn.pythonmac.org/py2app/py2app/trunk/), installed that and the problem has gone :) Not sure which version I had before, but I only built this mac a week ago or so, so think it's maybe the current version available for download -------------- next part -------------- An HTML attachment was scrubbed... URL: From poalman at gmail.com Thu Sep 13 13:07:14 2012 From: poalman at gmail.com (Paul Wiseman) Date: Thu, 13 Sep 2012 12:07:14 +0100 Subject: [Pythonmac-SIG] py2app unable to find cprocessors.so In-Reply-To: References: Message-ID: On 13 September 2012 10:33, Paul Wiseman wrote: > On 12 September 2012 19:27, Michael McCracken > wrote: > >> On Wed, Sep 12, 2012 at 10:54 AM, Paul Wiseman wrote: >> > On 12 September 2012 18:13, Michael McCracken < >> michael.mccracken at gmail.com> >> > wrote: >> >> >> >> On Wed, Sep 12, 2012 at 4:08 AM, Paul Wiseman >> wrote: >> >> > On 10 September 2012 13:18, Ronald Oussoren >> >> > wrote: >> >> >> >> >> >> >> >> >> On 9 Sep, 2012, at 20:34, Paul Wiseman wrote: >> >> >> >> >> >> Hey, >> >> >> >> >> >> When building an app that is using sqlalchemy I get this error: >> >> >> >> >> >> creating python loader for extension 'sqlalchemy.cprocessors' >> >> >> error: >> >> >> >> >> >> >> /Users/paul/Source/Python/build/bdist.macosx-10.6-intel/python2.7-standalone/app/temp/sqlalchemy/cprocessors.py: >> >> >> No such file or directory >> >> >> >> >> >> I took a look in site packages and there is no cprocessors.py, but a >> >> >> cprocessors.so - so maybe it is just looking for the wrong extension >> >> >> >> >> >> I tried adding "sqlalchemy.cprocessors" to the includes list in >> py2app >> >> >> but >> >> >> that hasn't helped. >> >> >> >> >> >> I was wondering if I can fool it by dropping an empty >> cprocessors.py so >> >> >> it >> >> >> will build, then swap it out afterwards for the so, but I'm sure >> >> >> there's a >> >> >> better way and I'm not convinced that could even work. >> >> >> >> >> >> Surely py2app doesn't assume every extension is .py, or if it does >> can >> >> >> it >> >> >> be changed? >> >> >> >> >> >> >> >> >> Py2app does not assume that every extension is a python file. Given >> the >> >> >> messasge I'd say that the error occurs in the code path that >> creates a >> >> >> helper python file that actually loads the exention. >> >> >> >> >> >> A little background information: when py2app creates the application >> >> >> bundle all modules are stored in a zipfile and loaded using python's >> >> >> zipimporter. Extensions cannot be stored in the zipfiles because the >> >> >> zipimporter doesn't support that. Py2app therefore creates a >> >> >> placeholder >> >> >> python module in the zipfile that loads the extensions from a >> directory >> >> >> in >> >> >> the application bundle. >> >> >> >> >> >> BTW. could you please create a sample project that demonstrates the >> >> >> problem? I've tried to reproduce your problem on my machine and >> failed >> >> >> to do >> >> >> so. I did run into another problem, py2app generated an incomplete >> >> >> bundle >> >> >> due to confusion between a _collections submodule in SQLAlchemy and >> the >> >> >> _collections extension in the stdlib; that's something I'm currently >> >> >> trying >> >> >> to fix. >> >> >> >> >> >> Ronald >> >> > >> >> > >> >> > (Oops just realised I didn't reply to the mailing list before) >> >> > >> >> > Ah, >> >> > >> >> > I've found out how to recreate the error >> >> > >> >> > If I create a main.py with nothing but 'import sqlalchemy' >> >> > >> >> > then use the following setup.py: >> >> > >> >> > from setuptools import setup >> >> > >> >> > setup( >> >> > version="1", >> >> > name="TestApp1", >> >> > app=["main.py"], >> >> > setup_requires=["py2app"] >> >> > ) >> >> > >> >> > setup( >> >> > version="1", >> >> > name="TestApp2", >> >> > app=["main.py"], >> >> > setup_requires=["py2app"] >> >> > ) >> >> > >> >> > If it doesn't produce the error it's probably because of this: "The >> >> > "cprocessors" module in SQLAlchemy is written in C and compiles >> >> > conditionally, based on if the current platform supports compiling >> it. >> >> > If >> >> > not present, SQLAlchemy continues to work perfectly well as the hooks >> >> > which >> >> > attempt to import it will fall back to pure-Python functions >> instead." >> >> > So >> >> > you may have a cprocessors.py which I dont think you'd get the >> problem, >> >> > only >> >> > if it compiled the .so when sqlalchemy installed. >> >> > >> >> > I get the error, but only when it builds the second app. In my main >> >> > build >> >> > script I make a few apps in the same script (I make 3 apps which get >> >> > moved >> >> > into the main app, any additional code in their site-packages.zip is >> >> > moved >> >> > into the main apps zip, I remove the "sub-apps" >> Contents/Resources/lib >> >> > folder and symlink it at run time to the main apps lib folder.) >> >> > >> >> > Is this a bug or are you never supposed to run multiple setups in the >> >> > same >> >> > build? If not how can I achieve the above? >> >> >> >> Paul, I'm also doing multiple calls to setup and it works. >> >> Does the main app import sqlalchemy? >> >> I ask because just removing SubApp.app/Contents/Resources/lib and >> >> symlinking that whole thing will remove anything in >> >> SubApp.app/Contents/Resources/lib/pythonx.y/lib-dynload/ , and if the >> >> sub app needs something in there that isn't in the lib-dynload path of >> >> the main app, then you won't have it in the final package. >> >> >> >> In my case I have a step that copies files from sub-app lib-dynload >> >> folders into the main app's folder before replacing the whole /lib dir >> >> with a symlink. >> >> Sounds like you might have to do the same thing. >> >> >> >> Hope this helps, >> >> -mike >> > >> > >> > Ah I think I do need that step you're right. my sub apps are a subset >> of the >> > main app, so I think I've gotten away with not copying anything over. >> I'll >> > definitely add that into my build script though. >> > >> > The error isn't related to the fact I symlink the lib folders together, >> > though, this is failing while building the second app. I just mentioned >> it >> > to explain why I want to call setup multiple times, I didn't know if it >> was >> > a common practice or not. >> > >> > Yea the main.py is just "import sqlalchemy" in my example, so the first >> and >> > second app will be the same in the example (both import sqlalchemy). >> Could >> > you check if you have "cprocessors.so" or "cprocessors.py" in your >> > site-packages/sqlalchemy folder? I think the above error only occurs if >> you >> > have the .so >> >> Ah, right - good point, the example wouldn't have the issue I mentioned. >> >> I can't reproduce your issue on OS X 10.7, with a recent trunk version >> of py2app. >> >> With a freshly installed sqlalchemy, building your sample runs fine, and >> I get >> dist/TestApp2.app/Contents/Resources/lib/python2.7/lib-dynload/sqlalchemy: >> total used in directory 144 available 41745048 >> drwxr-xr-x 4 mmccrack staff 136 Sep 12 11:11 . >> drwxr-xr-x 49 mmccrack staff 1666 Sep 12 11:11 .. >> -rw-r--r-- 1 mmccrack staff 34716 Sep 12 11:11 cprocessors.so >> -rw-r--r-- 1 mmccrack staff 35960 Sep 12 11:11 cresultproxy.so >> >> There is a sqlalchemy/cprocessors.py in the site-packages.zip. >> >> This appears correct to me, and if I add these lines to the main.py: >> from sqlalchemy import cprocessors >> print cprocessors.__file__ >> >> I get this: >> 9/12/12 11:25:37.274 AM >> [0x0-0x317c179].org.pythonmac.unspecified.TestApp2: >> >> /Users/mmccrack/Documents/Canonical/Source/spikes/test-sqlalchemy-app/dist/TestApp2.app/Contents/Resources/lib/python2.7/lib-dynload/sqlalchemy/cprocessors.so >> >> So that seems to be working too... >> >> Not sure if this is helpful or not, I'm now wondering if there's a >> 10.6 issue lurking. >> -mike >> > > I checked out the latest trunk ( > http://svn.pythonmac.org/py2app/py2app/trunk/), installed that and the > problem has gone :) > > Not sure which version I had before, but I only built this mac a week ago > or so, so think it's maybe the current version available for download > > Hm maybe I spoke too soon, it builds ok now but when I run the app I get a error dialog with Open console and Terminate options, and this stack trace in the console Traceback (most recent call last): File "/Applications/ZipCloud.app/Contents/Resources/__boot__.py", line 103, in _argv_emulation() File "/Applications/ZipCloud.app/Contents/Resources/__boot__.py", line 101, in _argv_emulation _get_argvemulator().mainloop() File "/Applications/ZipCloud.app/Contents/Resources/__boot__.py", line 40, in mainloop stoptime = Evt.TickCount() + timeout AttributeError: 'module' object has no attribute 'TickCount' -------------- next part -------------- An HTML attachment was scrubbed... URL: From ronaldoussoren at mac.com Thu Sep 13 13:13:20 2012 From: ronaldoussoren at mac.com (Ronald Oussoren) Date: Thu, 13 Sep 2012 13:13:20 +0200 Subject: [Pythonmac-SIG] py2app unable to find cprocessors.so In-Reply-To: References: Message-ID: <9E886771-9C0F-4DF2-9A20-DFA8C48E7C4A@mac.com> > > > I checked out the latest trunk (http://svn.pythonmac.org/py2app/py2app/trunk/), installed that and the problem has gone :) > > Not sure which version I had before, but I only built this mac a week ago or so, so think it's maybe the current version available for download > > > Hm maybe I spoke too soon, it builds ok now but when I run the app I get a error dialog with Open console and Terminate options, and this stack trace in the console > > Traceback (most recent call last): > File "/Applications/ZipCloud.app/Contents/Resources/__boot__.py", line 103, in > _argv_emulation() > File "/Applications/ZipCloud.app/Contents/Resources/__boot__.py", line 101, in _argv_emulation > _get_argvemulator().mainloop() > File "/Applications/ZipCloud.app/Contents/Resources/__boot__.py", line 40, in mainloop > stoptime = Evt.TickCount() + timeout > AttributeError: 'module' object has no attribute 'TickCount' > That's odd, that code is not present in the trunk. Have you removed the dist and build directories before testing the latest py2app? 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 poalman at gmail.com Thu Sep 13 14:17:19 2012 From: poalman at gmail.com (Paul Wiseman) Date: Thu, 13 Sep 2012 13:17:19 +0100 Subject: [Pythonmac-SIG] py2app unable to find cprocessors.so In-Reply-To: <9E886771-9C0F-4DF2-9A20-DFA8C48E7C4A@mac.com> References: <9E886771-9C0F-4DF2-9A20-DFA8C48E7C4A@mac.com> Message-ID: On 13 September 2012 12:13, Ronald Oussoren wrote: > >>> >> I checked out the latest trunk ( >> http://svn.pythonmac.org/py2app/py2app/trunk/), installed that and the >> problem has gone :) >> >> Not sure which version I had before, but I only built this mac a week ago >> or so, so think it's maybe the current version available for download >> >> > Hm maybe I spoke too soon, it builds ok now but when I run the app I get a > error dialog with Open console and Terminate options, and this stack trace > in the console > > Traceback (most recent call last): > File "/Applications/ZipCloud.app/Contents/Resources/__boot__.py", line > 103, in > _argv_emulation() > File "/Applications/ZipCloud.app/Contents/Resources/__boot__.py", line > 101, in _argv_emulation > _get_argvemulator().mainloop() > File "/Applications/ZipCloud.app/Contents/Resources/__boot__.py", line > 40, in mainloop > stoptime = Evt.TickCount() + timeout > AttributeError: 'module' object has no attribute 'TickCount' > > That's odd, that code is not present in the trunk. Have you removed the > dist and build directories before testing the latest py2app? > > Ronald > Yea definitely, I removed them at the start of the build script. I removed them myself and ran it again with the same outcome. How can I check which version I'm running? I guess installing the current trunk hasn't worked exactly -------------- next part -------------- An HTML attachment was scrubbed... URL: From ronaldoussoren at mac.com Thu Sep 13 14:26:06 2012 From: ronaldoussoren at mac.com (Ronald Oussoren) Date: Thu, 13 Sep 2012 14:26:06 +0200 Subject: [Pythonmac-SIG] py2app unable to find cprocessors.so In-Reply-To: References: <9E886771-9C0F-4DF2-9A20-DFA8C48E7C4A@mac.com> Message-ID: On 13 Sep, 2012, at 14:17, Paul Wiseman wrote: > On 13 September 2012 12:13, Ronald Oussoren wrote: >> >> >> I checked out the latest trunk (http://svn.pythonmac.org/py2app/py2app/trunk/), installed that and the problem has gone :) >> >> Not sure which version I had before, but I only built this mac a week ago or so, so think it's maybe the current version available for download >> >> >> Hm maybe I spoke too soon, it builds ok now but when I run the app I get a error dialog with Open console and Terminate options, and this stack trace in the console >> >> Traceback (most recent call last): >> File "/Applications/ZipCloud.app/Contents/Resources/__boot__.py", line 103, in >> _argv_emulation() >> File "/Applications/ZipCloud.app/Contents/Resources/__boot__.py", line 101, in _argv_emulation >> _get_argvemulator().mainloop() >> File "/Applications/ZipCloud.app/Contents/Resources/__boot__.py", line 40, in mainloop >> stoptime = Evt.TickCount() + timeout >> AttributeError: 'module' object has no attribute 'TickCount' >> > That's odd, that code is not present in the trunk. Have you removed the dist and build directories before testing the latest py2app? > > Ronald > > Yea definitely, I removed them at the start of the build script. I removed them myself and ran it again with the same outcome. How can I check which version I'm running? I guess installing the current trunk hasn't worked exactly > The easiest way to check the version is run "python -c 'import py2app; print(py2app.__version__)'". 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 poalman at gmail.com Thu Sep 13 15:17:33 2012 From: poalman at gmail.com (Paul Wiseman) Date: Thu, 13 Sep 2012 14:17:33 +0100 Subject: [Pythonmac-SIG] py2app unable to find cprocessors.so In-Reply-To: References: <9E886771-9C0F-4DF2-9A20-DFA8C48E7C4A@mac.com> Message-ID: On 13 September 2012 13:26, Ronald Oussoren wrote: > > On 13 Sep, 2012, at 14:17, Paul Wiseman wrote: > > On 13 September 2012 12:13, Ronald Oussoren wrote: > >> >>>> >>> I checked out the latest trunk ( >>> http://svn.pythonmac.org/py2app/py2app/trunk/), installed that and the >>> problem has gone :) >>> >>> Not sure which version I had before, but I only built this mac a week >>> ago or so, so think it's maybe the current version available for download >>> >>> >> Hm maybe I spoke too soon, it builds ok now but when I run the app I get >> a error dialog with Open console and Terminate options, and this stack >> trace in the console >> >> Traceback (most recent call last): >> File "/Applications/ZipCloud.app/Contents/Resources/__boot__.py", line >> 103, in >> _argv_emulation() >> File "/Applications/ZipCloud.app/Contents/Resources/__boot__.py", line >> 101, in _argv_emulation >> _get_argvemulator().mainloop() >> File "/Applications/ZipCloud.app/Contents/Resources/__boot__.py", line >> 40, in mainloop >> stoptime = Evt.TickCount() + timeout >> AttributeError: 'module' object has no attribute 'TickCount' >> >> That's odd, that code is not present in the trunk. Have you removed the >> dist and build directories before testing the latest py2app? >> >> Ronald >> > > Yea definitely, I removed them at the start of the build script. I removed > them myself and ran it again with the same outcome. How can I check which > version I'm running? I guess installing the current trunk hasn't worked > exactly > > > The easiest way to check the version is run "python -c 'import py2app; > print(py2app.__version__)'". > > Ronald > > I've got 0.5.3 which I'm a bit confused at as I can get 0.6.4 from pypi. I just looked in the one I checked out from svn, and in the readme it says 0.5.3 - whats the address I can checkout the latest version? -------------- next part -------------- An HTML attachment was scrubbed... URL: From poalman at gmail.com Thu Sep 13 15:25:24 2012 From: poalman at gmail.com (Paul Wiseman) Date: Thu, 13 Sep 2012 14:25:24 +0100 Subject: [Pythonmac-SIG] py2app unable to find cprocessors.so In-Reply-To: References: <9E886771-9C0F-4DF2-9A20-DFA8C48E7C4A@mac.com> Message-ID: On 13 September 2012 14:17, Paul Wiseman wrote: > On 13 September 2012 13:26, Ronald Oussoren wrote: > >> >> On 13 Sep, 2012, at 14:17, Paul Wiseman wrote: >> >> On 13 September 2012 12:13, Ronald Oussoren wrote: >> >>> >>>>> >>>> I checked out the latest trunk ( >>>> http://svn.pythonmac.org/py2app/py2app/trunk/), installed that and the >>>> problem has gone :) >>>> >>>> Not sure which version I had before, but I only built this mac a week >>>> ago or so, so think it's maybe the current version available for download >>>> >>>> >>> Hm maybe I spoke too soon, it builds ok now but when I run the app I get >>> a error dialog with Open console and Terminate options, and this stack >>> trace in the console >>> >>> Traceback (most recent call last): >>> File "/Applications/ZipCloud.app/Contents/Resources/__boot__.py", line >>> 103, in >>> _argv_emulation() >>> File "/Applications/ZipCloud.app/Contents/Resources/__boot__.py", line >>> 101, in _argv_emulation >>> _get_argvemulator().mainloop() >>> File "/Applications/ZipCloud.app/Contents/Resources/__boot__.py", line >>> 40, in mainloop >>> stoptime = Evt.TickCount() + timeout >>> AttributeError: 'module' object has no attribute 'TickCount' >>> >>> That's odd, that code is not present in the trunk. Have you removed the >>> dist and build directories before testing the latest py2app? >>> >>> Ronald >>> >> >> Yea definitely, I removed them at the start of the build script. I >> removed them myself and ran it again with the same outcome. How can I check >> which version I'm running? I guess installing the current trunk hasn't >> worked exactly >> >> >> The easiest way to check the version is run "python -c 'import py2app; >> print(py2app.__version__)'". >> >> Ronald >> >> > I've got 0.5.3 which I'm a bit confused at as I can get 0.6.4 from pypi. I > just looked in the one I checked out from svn, and in the readme it says > 0.5.3 - whats the address I can checkout the latest version? > > Ignore me while I try the actual latest trunk. I just realised I got the svn link from under the "Old subversion" heading on the macpython site -------------- next part -------------- An HTML attachment was scrubbed... URL: From poalman at gmail.com Thu Sep 13 15:35:05 2012 From: poalman at gmail.com (Paul Wiseman) Date: Thu, 13 Sep 2012 14:35:05 +0100 Subject: [Pythonmac-SIG] py2app unable to find cprocessors.so In-Reply-To: References: <9E886771-9C0F-4DF2-9A20-DFA8C48E7C4A@mac.com> Message-ID: On 13 September 2012 14:25, Paul Wiseman wrote: > On 13 September 2012 14:17, Paul Wiseman wrote: > >> On 13 September 2012 13:26, Ronald Oussoren wrote: >> >>> >>> On 13 Sep, 2012, at 14:17, Paul Wiseman wrote: >>> >>> On 13 September 2012 12:13, Ronald Oussoren wrote: >>> >>>> >>>>>> >>>>> I checked out the latest trunk ( >>>>> http://svn.pythonmac.org/py2app/py2app/trunk/), installed that and >>>>> the problem has gone :) >>>>> >>>>> Not sure which version I had before, but I only built this mac a week >>>>> ago or so, so think it's maybe the current version available for download >>>>> >>>>> >>>> Hm maybe I spoke too soon, it builds ok now but when I run the app I >>>> get a error dialog with Open console and Terminate options, and this stack >>>> trace in the console >>>> >>>> Traceback (most recent call last): >>>> File "/Applications/ZipCloud.app/Contents/Resources/__boot__.py", >>>> line 103, in >>>> _argv_emulation() >>>> File "/Applications/ZipCloud.app/Contents/Resources/__boot__.py", >>>> line 101, in _argv_emulation >>>> _get_argvemulator().mainloop() >>>> File "/Applications/ZipCloud.app/Contents/Resources/__boot__.py", >>>> line 40, in mainloop >>>> stoptime = Evt.TickCount() + timeout >>>> AttributeError: 'module' object has no attribute 'TickCount' >>>> >>>> That's odd, that code is not present in the trunk. Have you removed the >>>> dist and build directories before testing the latest py2app? >>>> >>>> Ronald >>>> >>> >>> Yea definitely, I removed them at the start of the build script. I >>> removed them myself and ran it again with the same outcome. How can I check >>> which version I'm running? I guess installing the current trunk hasn't >>> worked exactly >>> >>> >>> The easiest way to check the version is run "python -c 'import py2app; >>> print(py2app.__version__)'". >>> >>> Ronald >>> >>> >> I've got 0.5.3 which I'm a bit confused at as I can get 0.6.4 from pypi. >> I just looked in the one I checked out from svn, and in the readme it says >> 0.5.3 - whats the address I can checkout the latest version? >> >> > Ignore me while I try the actual latest trunk. I just realised I got the > svn link from under the "Old subversion" heading on the macpython site > I just got the latest altgraph, modulegraph, macholib and py2app (0.7) from the mercurial repos, installed them in order and now interestingly I'm hitting the same error as before creating python loader for extension 'sqlalchemy.cprocessors' error: /Users/paul/Source/Python/build/bdist.macosx-10.6-intel/python2.7-standalone/app/temp/sqlalchemy/cprocessors.py: No such file or directory I'll try building with subprocess and let you know if I have any joy -------------- next part -------------- An HTML attachment was scrubbed... URL: From ronaldoussoren at mac.com Thu Sep 13 15:36:15 2012 From: ronaldoussoren at mac.com (Ronald Oussoren) Date: Thu, 13 Sep 2012 15:36:15 +0200 Subject: [Pythonmac-SIG] py2app unable to find cprocessors.so In-Reply-To: References: <9E886771-9C0F-4DF2-9A20-DFA8C48E7C4A@mac.com> Message-ID: <4BBCFCA9-F2DF-45DC-B3CE-731E1A97C15F@mac.com> On 13 Sep, 2012, at 15:17, Paul Wiseman wrote: > On 13 September 2012 13:26, Ronald Oussoren wrote: > > On 13 Sep, 2012, at 14:17, Paul Wiseman wrote: > >> On 13 September 2012 12:13, Ronald Oussoren wrote: >>> >>> >>> I checked out the latest trunk (http://svn.pythonmac.org/py2app/py2app/trunk/), installed that and the problem has gone :) >>> >>> Not sure which version I had before, but I only built this mac a week ago or so, so think it's maybe the current version available for download >>> >>> >>> Hm maybe I spoke too soon, it builds ok now but when I run the app I get a error dialog with Open console and Terminate options, and this stack trace in the console >>> >>> Traceback (most recent call last): >>> File "/Applications/ZipCloud.app/Contents/Resources/__boot__.py", line 103, in >>> _argv_emulation() >>> File "/Applications/ZipCloud.app/Contents/Resources/__boot__.py", line 101, in _argv_emulation >>> _get_argvemulator().mainloop() >>> File "/Applications/ZipCloud.app/Contents/Resources/__boot__.py", line 40, in mainloop >>> stoptime = Evt.TickCount() + timeout >>> AttributeError: 'module' object has no attribute 'TickCount' >>> >> That's odd, that code is not present in the trunk. Have you removed the dist and build directories before testing the latest py2app? >> >> Ronald >> >> Yea definitely, I removed them at the start of the build script. I removed them myself and ran it again with the same outcome. How can I check which version I'm running? I guess installing the current trunk hasn't worked exactly >> > > The easiest way to check the version is run "python -c 'import py2app; print(py2app.__version__)'". > > Ronald > > > I've got 0.5.3 which I'm a bit confused at as I can get 0.6.4 from pypi. I just looked in the one I checked out from svn, and in the readme it says 0.5.3 - whats the address I can checkout the latest version? > I should have noticed this before, but the py2app sources aren't at svn.pythonmac.org anymore. Py2app is currently hosted at , and you'll also have to install the sibling projects altgraph, modulegraph and macholib. I hope to have some time this weekend to push out new releases of these projects, 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 chris.barker at noaa.gov Thu Sep 13 18:39:27 2012 From: chris.barker at noaa.gov (Chris Barker) Date: Thu, 13 Sep 2012 09:39:27 -0700 Subject: [Pythonmac-SIG] py2app unable to find cprocessors.so In-Reply-To: <0498BE1F-2079-454F-8B2D-E97D88F880C3@mac.com> References: <4FAEB541-D6C5-48E6-8F1A-17A6C240D10F@mac.com> <0498BE1F-2079-454F-8B2D-E97D88F880C3@mac.com> Message-ID: On Thu, Sep 13, 2012 at 1:53 AM, Ronald Oussoren wrote: > Yea exactly, I have some smaller apps which are used for specific separate > jobs (one has a simple gui and generates and gathers log files from the main > app and zips them up should the main app ever fail to open for instance), > the jobs are all to do with the main app and all use a sub set of code to > the main app, so I put the apps in the Resources folder and symlink the lib > folder so I can include them with only using a little extra disk space, but > more importantly keeping the installer size down. > > That sounds like something that would be useful to support directly. I'll > add it to the list of nice-to-have featuers, but don't know when I'll get > around to looking into this. That does sound cool -- What do you have in mind exactly? One thing I"d like to be able to do is use py2app to build a "Framework" (not sure if it would be a real OS-X framework" that would contain all the non-app-specific stuff, essentially a custom Python install, that I could then use for a number of small apps. For instance, a number of my apps use wxPython, numpy, scipy, matpotlib... These are pretty darn huge packages. So If I have a three or four small apps that ll use these, it would be great to have one bundle that they share. I'm imagining a multi-app kind of thing, you'd specify in setup.py the handful of apps you want to build, py2app would see what the shared dependencies were,a and build a bundle of those, then put the app specific stuff in each individual app bundle. So you'd get one small .app for each application, plus one bundle (of some form) that they all depended on. Similarly you could put the superset of everything that ll the apps need in teh master bundle, and the individual apps would be tiny stubbs. Call it an app_collection, maybe? Not that I'm volunteering to write it.... -Chris -- Christopher Barker, Ph.D. Oceanographer Emergency Response Division NOAA/NOS/OR&R (206) 526-6959 voice 7600 Sand Point Way NE (206) 526-6329 fax Seattle, WA 98115 (206) 526-6317 main reception Chris.Barker at noaa.gov From michael.mccracken at gmail.com Thu Sep 13 19:36:52 2012 From: michael.mccracken at gmail.com (Michael McCracken) Date: Thu, 13 Sep 2012 10:36:52 -0700 Subject: [Pythonmac-SIG] py2app unable to find cprocessors.so In-Reply-To: <0498BE1F-2079-454F-8B2D-E97D88F880C3@mac.com> References: <4FAEB541-D6C5-48E6-8F1A-17A6C240D10F@mac.com> <0498BE1F-2079-454F-8B2D-E97D88F880C3@mac.com> Message-ID: FWIW, here's how I do something similar now, to avoid having many copies of the Qt libraries. There is one master app, and several sub-apps. * call setup() for each of the apps, generating full separate apps with copies of the Qt libraries and other stuff -- each call has a unique directory sent in the setup options "bdist_base" and "dist_dir". This avoids sharing build state, as mentioned earlier in the thread. This seems to work fine, calling setup() multiple times in the same script. * inside main app Contents/Resources, create empty sub.app/ directory * for each sub app: ** copy sub.app/Contents/MacOS into main.app/Contents/Resources/sub.app/Contents/MacOS ** copy sub.app/Contents/Info.plist into main.app/Contents/Resources/sub.app/Contents/Info.plist ** copy everything in sub.app/Contents/Resources/ that isn't include or lib into main.app/Contents/Resources/sub.app/Contents/Resources/ ** create symlinks for sub.app/Contents/Resources/include -> main.app/Contents/Resources/include (do the same with Resources/lib) 3. merge the contents of sub.app/Contents/Resources/lib/python*/site-packages.zip into the main app's copy using zipfile 4. merge the contents of the sub.app/Contents/Resources/lib/python*/lib-dynload directory into the main app's directory NOTE: this will ignore any packages in sub.app/Contents/Resources/lib/python*/ that aren't in the site-packages.zip. That's fine for me, since I have the same "packages" option for all of the apps. -mike On Thu, Sep 13, 2012 at 1:53 AM, Ronald Oussoren wrote: > > On 13 Sep, 2012, at 10:47, Paul Wiseman wrote: > > On 13 September 2012 07:18, Ronald Oussoren wrote: >> >> >> On 10 Sep, 2012, at 16:37, Paul Wiseman wrote: >> >> Ah, >> >> I've found out how to recreate the error >> >> If I create a main.py with nothing but 'import sqlalchemy' >> >> then use the following setup.py: >> >> from setuptools import setup >> >> setup( >> version="1", >> name="TestApp1", >> app=["main.py"], >> setup_requires=["py2app"] >> ) >> >> setup( >> version="1", >> name="TestApp2", >> app=["main.py"], >> setup_requires=["py2app"] >> ) >> >> If it doesn't produce the error it's probably because of this: "The >> "cprocessors" module in SQLAlchemy is written in C and compiles >> conditionally, based on if the current platform supports compiling it. If >> not present, SQLAlchemy continues to work perfectly well as the hooks which >> attempt to import it will fall back to pure-Python functions instead." So >> you may have a cprocessors.py which I dont think you'd get the problem, only >> if it compiled the .so when sqlalchemy installed. >> >> >> I had the cprocessors extension in my build (that is, py2app mentioned in >> copied the extension) >> >> >> I get the error, but only when it builds the second app. In my main build >> script I make a few apps in the same script (I make 3 apps which get moved >> into the main app, any additional code in their site-packages.zip is moved >> into the main apps zip, I remove the "sub-apps" Contents/Resources/lib >> folder and symlink it at run time to the main apps lib folder.) >> >> Is this a bug or are you never supposed to run multiple setups in the same >> build? If not how can I achieve the above? >> >> >> Calling distutils.setup multiple times is at best untested with py2app, >> and I wouldn't be surprised if it causes problems due to state leaking from >> one build into the next. A workaround would be to use the subprocess module >> to run the setup jobs in separate processes. >> > > Isn't the problem that they share dist folders, not a process? if not where > does the state exist? Would I need to subprocess them from different > directories? > > > The py2app command itself has state and I haven't reviewed the code to know > for sure that all state is cleaned up when the command is used twice in the > same process. BTW. I also don't know if distutils.setup creates a new py2app > command object every time it is called, if the second call to > distutils.setup creates a new py2app command object there is no information > leakage. > > >> >> BTW. I don't quite understand what you are trying to do with these 3 apps. >> Are you building 3 apps that share a lot of code/resources and where you >> want two of the apps to link to the 3th one to reduce the amount of >> disk-space used? >> > > Yea exactly, I have some smaller apps which are used for specific separate > jobs (one has a simple gui and generates and gathers log files from the main > app and zips them up should the main app ever fail to open for instance), > the jobs are all to do with the main app and all use a sub set of code to > the main app, so I put the apps in the Resources folder and symlink the lib > folder so I can include them with only using a little extra disk space, but > more importantly keeping the installer size down. > > > That sounds like something that would be useful to support directly. I'll > add it to the list of nice-to-have featuers, but don't know when I'll get > around to looking into this. > > Ronald > > >> >> Ronald >> >> >> On 10 September 2012 13:18, Ronald Oussoren >> wrote: >>> >>> >>> On 9 Sep, 2012, at 20:34, Paul Wiseman wrote: >>> >>> Hey, >>> >>> When building an app that is using sqlalchemy I get this error: >>> >>> creating python loader for extension 'sqlalchemy.cprocessors' >>> error: >>> /Users/paul/Source/Python/build/bdist.macosx-10.6-intel/python2.7-standalone/app/temp/sqlalchemy/cprocessors.py: >>> No such file or directory >>> >>> I took a look in site packages and there is no cprocessors.py, but a >>> cprocessors.so - so maybe it is just looking for the wrong extension >>> >>> I tried adding "sqlalchemy.cprocessors" to the includes list in py2app >>> but that hasn't helped. >>> >>> I was wondering if I can fool it by dropping an empty cprocessors.py so >>> it will build, then swap it out afterwards for the so, but I'm sure there's >>> a better way and I'm not convinced that could even work. >>> >>> Surely py2app doesn't assume every extension is .py, or if it does can it >>> be changed? >>> >>> >>> Py2app does not assume that every extension is a python file. Given the >>> messasge I'd say that the error occurs in the code path that creates a >>> helper python file that actually loads the exention. >>> >>> A little background information: when py2app creates the application >>> bundle all modules are stored in a zipfile and loaded using python's >>> zipimporter. Extensions cannot be stored in the zipfiles because the >>> zipimporter doesn't support that. Py2app therefore creates a placeholder >>> python module in the zipfile that loads the extensions from a directory in >>> the application bundle. >>> >>> BTW. could you please create a sample project that demonstrates the >>> problem? I've tried to reproduce your problem on my machine and failed to do >>> so. I did run into another problem, py2app generated an incomplete bundle >>> due to confusion between a _collections submodule in SQLAlchemy and the >>> _collections extension in the stdlib; that's something I'm currently trying >>> to fix. >>> >>> 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 >>> >>> >> >> > > > > _______________________________________________ > 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 poalman at gmail.com Thu Sep 13 20:29:13 2012 From: poalman at gmail.com (Paul Wiseman) Date: Thu, 13 Sep 2012 19:29:13 +0100 Subject: [Pythonmac-SIG] py2app unable to find cprocessors.so In-Reply-To: References: <4FAEB541-D6C5-48E6-8F1A-17A6C240D10F@mac.com> <0498BE1F-2079-454F-8B2D-E97D88F880C3@mac.com> Message-ID: On 13 September 2012 18:36, Michael McCracken wrote: > FWIW, here's how I do something similar now, to avoid having many > copies of the Qt libraries. > There is one master app, and several sub-apps. > > * call setup() for each of the apps, generating full separate apps > with copies of the Qt libraries and other stuff > -- each call has a unique directory sent in the setup options > "bdist_base" and "dist_dir". This avoids sharing build state, as > mentioned earlier in the thread. This seems to work fine, calling > setup() multiple times in the same script. > > * inside main app Contents/Resources, create empty sub.app/ directory > * for each sub app: > ** copy sub.app/Contents/MacOS into > main.app/Contents/Resources/sub.app/Contents/MacOS > ** copy sub.app/Contents/Info.plist into > main.app/Contents/Resources/sub.app/Contents/Info.plist > ** copy everything in sub.app/Contents/Resources/ that isn't include > or lib into main.app/Contents/Resources/sub.app/Contents/Resources/ > ** create symlinks for sub.app/Contents/Resources/include -> > main.app/Contents/Resources/include (do the same with Resources/lib) > 3. merge the contents of > sub.app/Contents/Resources/lib/python*/site-packages.zip into the main > app's copy using zipfile > 4. merge the contents of the > sub.app/Contents/Resources/lib/python*/lib-dynload directory into the > main app's directory > > NOTE: this will ignore any packages in > sub.app/Contents/Resources/lib/python*/ that aren't in the > site-packages.zip. > That's fine for me, since I have the same "packages" option for all of the > apps. > > -mike > > That's pretty similar to what I do, I'm interested to know though how you do this tough 'each call has a unique directory sent in the setup options "bdist_base" and "dist_dir"', that might solve my problem. > > On Thu, Sep 13, 2012 at 1:53 AM, Ronald Oussoren > wrote: > > > > On 13 Sep, 2012, at 10:47, Paul Wiseman wrote: > > > > On 13 September 2012 07:18, Ronald Oussoren > wrote: > >> > >> > >> On 10 Sep, 2012, at 16:37, Paul Wiseman wrote: > >> > >> Ah, > >> > >> I've found out how to recreate the error > >> > >> If I create a main.py with nothing but 'import sqlalchemy' > >> > >> then use the following setup.py: > >> > >> from setuptools import setup > >> > >> setup( > >> version="1", > >> name="TestApp1", > >> app=["main.py"], > >> setup_requires=["py2app"] > >> ) > >> > >> setup( > >> version="1", > >> name="TestApp2", > >> app=["main.py"], > >> setup_requires=["py2app"] > >> ) > >> > >> If it doesn't produce the error it's probably because of this: "The > >> "cprocessors" module in SQLAlchemy is written in C and compiles > >> conditionally, based on if the current platform supports compiling it. > If > >> not present, SQLAlchemy continues to work perfectly well as the hooks > which > >> attempt to import it will fall back to pure-Python functions instead." > So > >> you may have a cprocessors.py which I dont think you'd get the problem, > only > >> if it compiled the .so when sqlalchemy installed. > >> > >> > >> I had the cprocessors extension in my build (that is, py2app mentioned > in > >> copied the extension) > >> > >> > >> I get the error, but only when it builds the second app. In my main > build > >> script I make a few apps in the same script (I make 3 apps which get > moved > >> into the main app, any additional code in their site-packages.zip is > moved > >> into the main apps zip, I remove the "sub-apps" Contents/Resources/lib > >> folder and symlink it at run time to the main apps lib folder.) > >> > >> Is this a bug or are you never supposed to run multiple setups in the > same > >> build? If not how can I achieve the above? > >> > >> > >> Calling distutils.setup multiple times is at best untested with py2app, > >> and I wouldn't be surprised if it causes problems due to state leaking > from > >> one build into the next. A workaround would be to use the subprocess > module > >> to run the setup jobs in separate processes. > >> > > > > Isn't the problem that they share dist folders, not a process? if not > where > > does the state exist? Would I need to subprocess them from different > > directories? > > > > > > The py2app command itself has state and I haven't reviewed the code to > know > > for sure that all state is cleaned up when the command is used twice in > the > > same process. BTW. I also don't know if distutils.setup creates a new > py2app > > command object every time it is called, if the second call to > > distutils.setup creates a new py2app command object there is no > information > > leakage. > > > > > >> > >> BTW. I don't quite understand what you are trying to do with these 3 > apps. > >> Are you building 3 apps that share a lot of code/resources and where you > >> want two of the apps to link to the 3th one to reduce the amount of > >> disk-space used? > >> > > > > Yea exactly, I have some smaller apps which are used for specific > separate > > jobs (one has a simple gui and generates and gathers log files from the > main > > app and zips them up should the main app ever fail to open for instance), > > the jobs are all to do with the main app and all use a sub set of code to > > the main app, so I put the apps in the Resources folder and symlink the > lib > > folder so I can include them with only using a little extra disk space, > but > > more importantly keeping the installer size down. > > > > > > That sounds like something that would be useful to support directly. I'll > > add it to the list of nice-to-have featuers, but don't know when I'll get > > around to looking into this. > > > > Ronald > > > > > >> > >> Ronald > >> > >> > >> On 10 September 2012 13:18, Ronald Oussoren > >> wrote: > >>> > >>> > >>> On 9 Sep, 2012, at 20:34, Paul Wiseman wrote: > >>> > >>> Hey, > >>> > >>> When building an app that is using sqlalchemy I get this error: > >>> > >>> creating python loader for extension 'sqlalchemy.cprocessors' > >>> error: > >>> > /Users/paul/Source/Python/build/bdist.macosx-10.6-intel/python2.7-standalone/app/temp/sqlalchemy/cprocessors.py: > >>> No such file or directory > >>> > >>> I took a look in site packages and there is no cprocessors.py, but a > >>> cprocessors.so - so maybe it is just looking for the wrong extension > >>> > >>> I tried adding "sqlalchemy.cprocessors" to the includes list in py2app > >>> but that hasn't helped. > >>> > >>> I was wondering if I can fool it by dropping an empty cprocessors.py so > >>> it will build, then swap it out afterwards for the so, but I'm sure > there's > >>> a better way and I'm not convinced that could even work. > >>> > >>> Surely py2app doesn't assume every extension is .py, or if it does can > it > >>> be changed? > >>> > >>> > >>> Py2app does not assume that every extension is a python file. Given the > >>> messasge I'd say that the error occurs in the code path that creates a > >>> helper python file that actually loads the exention. > >>> > >>> A little background information: when py2app creates the application > >>> bundle all modules are stored in a zipfile and loaded using python's > >>> zipimporter. Extensions cannot be stored in the zipfiles because the > >>> zipimporter doesn't support that. Py2app therefore creates a > placeholder > >>> python module in the zipfile that loads the extensions from a > directory in > >>> the application bundle. > >>> > >>> BTW. could you please create a sample project that demonstrates the > >>> problem? I've tried to reproduce your problem on my machine and failed > to do > >>> so. I did run into another problem, py2app generated an incomplete > bundle > >>> due to confusion between a _collections submodule in SQLAlchemy and the > >>> _collections extension in the stdlib; that's something I'm currently > trying > >>> to fix. > >>> > >>> 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 > >>> > >>> > >> > >> > > > > > > > > _______________________________________________ > > 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 poalman at gmail.com Thu Sep 13 20:32:12 2012 From: poalman at gmail.com (Paul Wiseman) Date: Thu, 13 Sep 2012 19:32:12 +0100 Subject: [Pythonmac-SIG] py2app unable to find cprocessors.so In-Reply-To: <4BBCFCA9-F2DF-45DC-B3CE-731E1A97C15F@mac.com> References: <9E886771-9C0F-4DF2-9A20-DFA8C48E7C4A@mac.com> <4BBCFCA9-F2DF-45DC-B3CE-731E1A97C15F@mac.com> Message-ID: On 13 September 2012 14:36, Ronald Oussoren wrote: > > On 13 Sep, 2012, at 15:17, Paul Wiseman wrote: > > On 13 September 2012 13:26, Ronald Oussoren wrote: > >> >> On 13 Sep, 2012, at 14:17, Paul Wiseman wrote: >> >> On 13 September 2012 12:13, Ronald Oussoren wrote: >> >>> >>>>> >>>> I checked out the latest trunk ( >>>> http://svn.pythonmac.org/py2app/py2app/trunk/), installed that and the >>>> problem has gone :) >>>> >>>> Not sure which version I had before, but I only built this mac a week >>>> ago or so, so think it's maybe the current version available for download >>>> >>>> >>> Hm maybe I spoke too soon, it builds ok now but when I run the app I get >>> a error dialog with Open console and Terminate options, and this stack >>> trace in the console >>> >>> Traceback (most recent call last): >>> File "/Applications/ZipCloud.app/Contents/Resources/__boot__.py", line >>> 103, in >>> _argv_emulation() >>> File "/Applications/ZipCloud.app/Contents/Resources/__boot__.py", line >>> 101, in _argv_emulation >>> _get_argvemulator().mainloop() >>> File "/Applications/ZipCloud.app/Contents/Resources/__boot__.py", line >>> 40, in mainloop >>> stoptime = Evt.TickCount() + timeout >>> AttributeError: 'module' object has no attribute 'TickCount' >>> >>> That's odd, that code is not present in the trunk. Have you removed the >>> dist and build directories before testing the latest py2app? >>> >>> Ronald >>> >> >> Yea definitely, I removed them at the start of the build script. I >> removed them myself and ran it again with the same outcome. How can I check >> which version I'm running? I guess installing the current trunk hasn't >> worked exactly >> >> >> The easiest way to check the version is run "python -c 'import py2app; >> print(py2app.__version__)'". >> >> Ronald >> >> > I've got 0.5.3 which I'm a bit confused at as I can get 0.6.4 from pypi. I > just looked in the one I checked out from svn, and in the readme it says > 0.5.3 - whats the address I can checkout the latest version? > > > I should have noticed this before, but the py2app sources aren't at > svn.pythonmac.org anymore. Py2app is currently hosted at < > https://bitbucket.org/ronaldoussoren/py2app>, and you'll also have to > install the sibling projects altgraph, modulegraph and macholib. > > I hope to have some time this weekend to push out new releases of these > projects, > > Ronald > I tried with multiprocess but I had no joy, I didn't manage to see the stderr but it definitely wasn't building the subapps so I believe it was getting the same error. I've got a 10.7 macbook I'm putting devtools and sqlalchemy on which I'll try tomorrow and see if it will build or not to get more evidence if it's a problem with 10.6 or not -------------- next part -------------- An HTML attachment was scrubbed... URL: From michael.mccracken at gmail.com Thu Sep 13 20:56:12 2012 From: michael.mccracken at gmail.com (Michael McCracken) Date: Thu, 13 Sep 2012 11:56:12 -0700 Subject: [Pythonmac-SIG] py2app unable to find cprocessors.so In-Reply-To: References: <9E886771-9C0F-4DF2-9A20-DFA8C48E7C4A@mac.com> <4BBCFCA9-F2DF-45DC-B3CE-731E1A97C15F@mac.com> Message-ID: Paul, it's like this: setup(blah, options={"py2app": = {"bdist_base": "build/app1", "dist_dir": "dist/app1"}}) setup(blah, options={"py2app": = {"bdist_base": "build/app2", "dist_dir": "dist/app2"}}) For the full version, see my setup.py here: (ignore "windows-installer") http://bazaar.launchpad.net/~ubuntuone-control-tower/ubuntuone-windows-installer/trunk/view/head:/scripts/setup-mac.py see line 571 for how I call setup, line 562 for where I set the app-specific options, and line 497 for the dict with the options that the apps have in common. -mike On Thu, Sep 13, 2012 at 11:32 AM, Paul Wiseman wrote: > On 13 September 2012 14:36, Ronald Oussoren wrote: >> >> >> On 13 Sep, 2012, at 15:17, Paul Wiseman wrote: >> >> On 13 September 2012 13:26, Ronald Oussoren >> wrote: >>> >>> >>> On 13 Sep, 2012, at 14:17, Paul Wiseman wrote: >>> >>> On 13 September 2012 12:13, Ronald Oussoren >>> wrote: >>>>>> >>>>>> >>>>> >>>>> I checked out the latest trunk >>>>> (http://svn.pythonmac.org/py2app/py2app/trunk/), installed that and the >>>>> problem has gone :) >>>>> >>>>> Not sure which version I had before, but I only built this mac a week >>>>> ago or so, so think it's maybe the current version available for download >>>>> >>>> >>>> Hm maybe I spoke too soon, it builds ok now but when I run the app I get >>>> a error dialog with Open console and Terminate options, and this stack trace >>>> in the console >>>> >>>> Traceback (most recent call last): >>>> File "/Applications/ZipCloud.app/Contents/Resources/__boot__.py", line >>>> 103, in >>>> _argv_emulation() >>>> File "/Applications/ZipCloud.app/Contents/Resources/__boot__.py", line >>>> 101, in _argv_emulation >>>> _get_argvemulator().mainloop() >>>> File "/Applications/ZipCloud.app/Contents/Resources/__boot__.py", line >>>> 40, in mainloop >>>> stoptime = Evt.TickCount() + timeout >>>> AttributeError: 'module' object has no attribute 'TickCount' >>>> >>>> That's odd, that code is not present in the trunk. Have you removed the >>>> dist and build directories before testing the latest py2app? >>>> >>>> Ronald >>> >>> >>> Yea definitely, I removed them at the start of the build script. I >>> removed them myself and ran it again with the same outcome. How can I check >>> which version I'm running? I guess installing the current trunk hasn't >>> worked exactly >>> >>> >>> The easiest way to check the version is run "python -c 'import py2app; >>> print(py2app.__version__)'". >>> >>> Ronald >>> >> >> I've got 0.5.3 which I'm a bit confused at as I can get 0.6.4 from pypi. I >> just looked in the one I checked out from svn, and in the readme it says >> 0.5.3 - whats the address I can checkout the latest version? >> >> >> I should have noticed this before, but the py2app sources aren't at >> svn.pythonmac.org anymore. Py2app is currently hosted at >> , and you'll also have to >> install the sibling projects altgraph, modulegraph and macholib. >> >> I hope to have some time this weekend to push out new releases of these >> projects, >> >> Ronald > > > I tried with multiprocess but I had no joy, I didn't manage to see the > stderr but it definitely wasn't building the subapps so I believe it was > getting the same error. > > I've got a 10.7 macbook I'm putting devtools and sqlalchemy on which I'll > try tomorrow and see if it will build or not to get more evidence if it's a > problem with 10.6 or not > From chris.barker at noaa.gov Thu Sep 13 21:16:49 2012 From: chris.barker at noaa.gov (Chris Barker) Date: Thu, 13 Sep 2012 12:16:49 -0700 Subject: [Pythonmac-SIG] py2app unable to find cprocessors.so In-Reply-To: References: <4FAEB541-D6C5-48E6-8F1A-17A6C240D10F@mac.com> <0498BE1F-2079-454F-8B2D-E97D88F880C3@mac.com> Message-ID: On Thu, Sep 13, 2012 at 10:36 AM, Michael McCracken wrote: > FWIW, here's how I do something similar now, to avoid having many > copies of the Qt libraries. cool! Thanks for the description > There is one master app, and several sub-apps. > > * call setup() for each of the apps, generating full separate apps > with copies of the Qt libraries and other stuff > -- each call has a unique directory sent in the setup options > "bdist_base" and "dist_dir". This avoids sharing build state, as > mentioned earlier in the thread. This seems to work fine, calling > setup() multiple times in the same script. good to know -- I think the OP was right, the conflict over the sharing build dirs -- I didn't know you could override that. > * inside main app Contents/Resources, create empty sub.app/ directory > * for each sub app: > ** copy sub.app/Contents/MacOS into > main.app/Contents/Resources/sub.app/Contents/MacOS > ** copy sub.app/Contents/Info.plist into > main.app/Contents/Resources/sub.app/Contents/Info.plist > ** copy everything in sub.app/Contents/Resources/ that isn't include > or lib into main.app/Contents/Resources/sub.app/Contents/Resources/ > ** create symlinks for sub.app/Contents/Resources/include -> > main.app/Contents/Resources/include (do the same with Resources/lib) OK -- here is where I"m confused -- with a sylink, you can do either relative or absoute path, yes? absolute wouldn't work, as who knows where the user will install it -- but relative could, as long as the users keeps them all together -- is that how you handle it? Alternatively I suppose you could require that main.app be installed in /Library/Frameworks or something, and then symlink to the absolute path. I actually kind of like that idea, 'cause it would keep the apps a bit more distinct, -- I have a base I want to use with multiple apps but don't necessarily want folks to have to install everything at once to use one. > 3. merge the contents of > sub.app/Contents/Resources/lib/python*/site-packages.zip into the main > app's copy using zipfile > 4. merge the contents of the > sub.app/Contents/Resources/lib/python*/lib-dynload directory into the > main app's directory But anyway, this is a nice model for what py2app could so for us. Thanks, -Chris > NOTE: this will ignore any packages in > sub.app/Contents/Resources/lib/python*/ that aren't in the > site-packages.zip. > That's fine for me, since I have the same "packages" option for all of the apps. > > -mike > > > On Thu, Sep 13, 2012 at 1:53 AM, Ronald Oussoren wrote: >> >> On 13 Sep, 2012, at 10:47, Paul Wiseman wrote: >> >> On 13 September 2012 07:18, Ronald Oussoren wrote: >>> >>> >>> On 10 Sep, 2012, at 16:37, Paul Wiseman wrote: >>> >>> Ah, >>> >>> I've found out how to recreate the error >>> >>> If I create a main.py with nothing but 'import sqlalchemy' >>> >>> then use the following setup.py: >>> >>> from setuptools import setup >>> >>> setup( >>> version="1", >>> name="TestApp1", >>> app=["main.py"], >>> setup_requires=["py2app"] >>> ) >>> >>> setup( >>> version="1", >>> name="TestApp2", >>> app=["main.py"], >>> setup_requires=["py2app"] >>> ) >>> >>> If it doesn't produce the error it's probably because of this: "The >>> "cprocessors" module in SQLAlchemy is written in C and compiles >>> conditionally, based on if the current platform supports compiling it. If >>> not present, SQLAlchemy continues to work perfectly well as the hooks which >>> attempt to import it will fall back to pure-Python functions instead." So >>> you may have a cprocessors.py which I dont think you'd get the problem, only >>> if it compiled the .so when sqlalchemy installed. >>> >>> >>> I had the cprocessors extension in my build (that is, py2app mentioned in >>> copied the extension) >>> >>> >>> I get the error, but only when it builds the second app. In my main build >>> script I make a few apps in the same script (I make 3 apps which get moved >>> into the main app, any additional code in their site-packages.zip is moved >>> into the main apps zip, I remove the "sub-apps" Contents/Resources/lib >>> folder and symlink it at run time to the main apps lib folder.) >>> >>> Is this a bug or are you never supposed to run multiple setups in the same >>> build? If not how can I achieve the above? >>> >>> >>> Calling distutils.setup multiple times is at best untested with py2app, >>> and I wouldn't be surprised if it causes problems due to state leaking from >>> one build into the next. A workaround would be to use the subprocess module >>> to run the setup jobs in separate processes. >>> >> >> Isn't the problem that they share dist folders, not a process? if not where >> does the state exist? Would I need to subprocess them from different >> directories? >> >> >> The py2app command itself has state and I haven't reviewed the code to know >> for sure that all state is cleaned up when the command is used twice in the >> same process. BTW. I also don't know if distutils.setup creates a new py2app >> command object every time it is called, if the second call to >> distutils.setup creates a new py2app command object there is no information >> leakage. >> >> >>> >>> BTW. I don't quite understand what you are trying to do with these 3 apps. >>> Are you building 3 apps that share a lot of code/resources and where you >>> want two of the apps to link to the 3th one to reduce the amount of >>> disk-space used? >>> >> >> Yea exactly, I have some smaller apps which are used for specific separate >> jobs (one has a simple gui and generates and gathers log files from the main >> app and zips them up should the main app ever fail to open for instance), >> the jobs are all to do with the main app and all use a sub set of code to >> the main app, so I put the apps in the Resources folder and symlink the lib >> folder so I can include them with only using a little extra disk space, but >> more importantly keeping the installer size down. >> >> >> That sounds like something that would be useful to support directly. I'll >> add it to the list of nice-to-have featuers, but don't know when I'll get >> around to looking into this. >> >> Ronald >> >> >>> >>> Ronald >>> >>> >>> On 10 September 2012 13:18, Ronald Oussoren >>> wrote: >>>> >>>> >>>> On 9 Sep, 2012, at 20:34, Paul Wiseman wrote: >>>> >>>> Hey, >>>> >>>> When building an app that is using sqlalchemy I get this error: >>>> >>>> creating python loader for extension 'sqlalchemy.cprocessors' >>>> error: >>>> /Users/paul/Source/Python/build/bdist.macosx-10.6-intel/python2.7-standalone/app/temp/sqlalchemy/cprocessors.py: >>>> No such file or directory >>>> >>>> I took a look in site packages and there is no cprocessors.py, but a >>>> cprocessors.so - so maybe it is just looking for the wrong extension >>>> >>>> I tried adding "sqlalchemy.cprocessors" to the includes list in py2app >>>> but that hasn't helped. >>>> >>>> I was wondering if I can fool it by dropping an empty cprocessors.py so >>>> it will build, then swap it out afterwards for the so, but I'm sure there's >>>> a better way and I'm not convinced that could even work. >>>> >>>> Surely py2app doesn't assume every extension is .py, or if it does can it >>>> be changed? >>>> >>>> >>>> Py2app does not assume that every extension is a python file. Given the >>>> messasge I'd say that the error occurs in the code path that creates a >>>> helper python file that actually loads the exention. >>>> >>>> A little background information: when py2app creates the application >>>> bundle all modules are stored in a zipfile and loaded using python's >>>> zipimporter. Extensions cannot be stored in the zipfiles because the >>>> zipimporter doesn't support that. Py2app therefore creates a placeholder >>>> python module in the zipfile that loads the extensions from a directory in >>>> the application bundle. >>>> >>>> BTW. could you please create a sample project that demonstrates the >>>> problem? I've tried to reproduce your problem on my machine and failed to do >>>> so. I did run into another problem, py2app generated an incomplete bundle >>>> due to confusion between a _collections submodule in SQLAlchemy and the >>>> _collections extension in the stdlib; that's something I'm currently trying >>>> to fix. >>>> >>>> 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 >>>> >>>> >>> >>> >> >> >> >> _______________________________________________ >> 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 >> > _______________________________________________ > 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 poalman at gmail.com Thu Sep 13 23:41:39 2012 From: poalman at gmail.com (Paul Wiseman) Date: Thu, 13 Sep 2012 22:41:39 +0100 Subject: [Pythonmac-SIG] py2app unable to find cprocessors.so In-Reply-To: References: <9E886771-9C0F-4DF2-9A20-DFA8C48E7C4A@mac.com> <4BBCFCA9-F2DF-45DC-B3CE-731E1A97C15F@mac.com> Message-ID: On 13 September 2012 19:56, Michael McCracken wrote: > Paul, it's like this: > setup(blah, options={"py2app": = {"bdist_base": "build/app1", > "dist_dir": "dist/app1"}}) > setup(blah, options={"py2app": = {"bdist_base": "build/app2", > "dist_dir": "dist/app2"}}) > > For the full version, see my setup.py here: (ignore "windows-installer") > > > http://bazaar.launchpad.net/~ubuntuone-control-tower/ubuntuone-windows-installer/trunk/view/head:/scripts/setup-mac.py > > see line 571 for how I call setup, line 562 for where I set the > app-specific options, and line 497 for the dict with the options that > the apps have in common. > > -mike > > Awesome, thanks buddy! changing the dist and build folders has solved my problem with cprocessors.py and I can get a build, however running the app now reveals another hurdle (yay) ImportError: dlopen(/Users/paul/Source/Python/dist/_--_BRAND_--_/_--_BRAND_--_.app/Contents/Resources/lib/python2.7/lib-dynload/wx/_core_.so, 2): no suitable image found. Did find: /Users/paul/Source/Python/dist/_--_BRAND_--_/_--_BRAND_--_.app/Contents/Resources/lib/python2.7/lib-dynload/wx/_core_.so: no matching architecture in universal wrapper running file on it gives the following; paul$ file dist/_--_BRAND_--_/_--_BRAND_--_.app/Contents/Resources/lib/python2.7/lib-dynload/wx/_core_.so dist/_--_BRAND_--_/_--_BRAND_--_.app/Contents/Resources/lib/python2.7/lib-dynload/wx/_core_.so: Mach-O universal binary with 2 architectures dist/_--_BRAND_--_/_--_BRAND_--_.app/Contents/Resources/lib/python2.7/lib-dynload/wx/_core_.so (for architecture ppc): Mach-O bundle ppc dist/_--_BRAND_--_/_--_BRAND_--_.app/Contents/Resources/lib/python2.7/lib-dynload/wx/_core_.so (for architecture i386): Mach-O bundle i386 and running this shows that it's looking for x86_64 paul$ dist/_--_BRAND_--_/_--_BRAND_--_.app/Contents/MacOS/python Python 2.7.3 (v2.7.3:70274d53c1dd, Apr 9 2012, 20:52:43) [GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> import sys >>> sys.maxsize 9223372036854775807 but... paul$ python Python 2.7.3 (v2.7.3:70274d53c1dd, Apr 9 2012, 20:52:43) [GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> import sys >>> sys.maxsize 2147483647 my python interpreter is 32-bit and I ran 'python setup.py py2app' - how has the app got ahold of a 64bit interpreter? I thought it just used the one that you call setup with? > On Thu, Sep 13, 2012 at 11:32 AM, Paul Wiseman wrote: > > On 13 September 2012 14:36, Ronald Oussoren > wrote: > >> > >> > >> On 13 Sep, 2012, at 15:17, Paul Wiseman wrote: > >> > >> On 13 September 2012 13:26, Ronald Oussoren > >> wrote: > >>> > >>> > >>> On 13 Sep, 2012, at 14:17, Paul Wiseman wrote: > >>> > >>> On 13 September 2012 12:13, Ronald Oussoren > >>> wrote: > >>>>>> > >>>>>> > >>>>> > >>>>> I checked out the latest trunk > >>>>> (http://svn.pythonmac.org/py2app/py2app/trunk/), installed that and > the > >>>>> problem has gone :) > >>>>> > >>>>> Not sure which version I had before, but I only built this mac a week > >>>>> ago or so, so think it's maybe the current version available for > download > >>>>> > >>>> > >>>> Hm maybe I spoke too soon, it builds ok now but when I run the app I > get > >>>> a error dialog with Open console and Terminate options, and this > stack trace > >>>> in the console > >>>> > >>>> Traceback (most recent call last): > >>>> File "/Applications/ZipCloud.app/Contents/Resources/__boot__.py", > line > >>>> 103, in > >>>> _argv_emulation() > >>>> File "/Applications/ZipCloud.app/Contents/Resources/__boot__.py", > line > >>>> 101, in _argv_emulation > >>>> _get_argvemulator().mainloop() > >>>> File "/Applications/ZipCloud.app/Contents/Resources/__boot__.py", > line > >>>> 40, in mainloop > >>>> stoptime = Evt.TickCount() + timeout > >>>> AttributeError: 'module' object has no attribute 'TickCount' > >>>> > >>>> That's odd, that code is not present in the trunk. Have you removed > the > >>>> dist and build directories before testing the latest py2app? > >>>> > >>>> Ronald > >>> > >>> > >>> Yea definitely, I removed them at the start of the build script. I > >>> removed them myself and ran it again with the same outcome. How can I > check > >>> which version I'm running? I guess installing the current trunk hasn't > >>> worked exactly > >>> > >>> > >>> The easiest way to check the version is run "python -c 'import py2app; > >>> print(py2app.__version__)'". > >>> > >>> Ronald > >>> > >> > >> I've got 0.5.3 which I'm a bit confused at as I can get 0.6.4 from > pypi. I > >> just looked in the one I checked out from svn, and in the readme it says > >> 0.5.3 - whats the address I can checkout the latest version? > >> > >> > >> I should have noticed this before, but the py2app sources aren't at > >> svn.pythonmac.org anymore. Py2app is currently hosted at > >> , and you'll also have to > >> install the sibling projects altgraph, modulegraph and macholib. > >> > >> I hope to have some time this weekend to push out new releases of these > >> projects, > >> > >> Ronald > > > > > > I tried with multiprocess but I had no joy, I didn't manage to see the > > stderr but it definitely wasn't building the subapps so I believe it was > > getting the same error. > > > > I've got a 10.7 macbook I'm putting devtools and sqlalchemy on which I'll > > try tomorrow and see if it will build or not to get more evidence if > it's a > > problem with 10.6 or not > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From michael.mccracken at gmail.com Fri Sep 14 00:54:41 2012 From: michael.mccracken at gmail.com (Michael McCracken) Date: Thu, 13 Sep 2012 15:54:41 -0700 Subject: [Pythonmac-SIG] py2app unable to find cprocessors.so In-Reply-To: References: <4FAEB541-D6C5-48E6-8F1A-17A6C240D10F@mac.com> <0498BE1F-2079-454F-8B2D-E97D88F880C3@mac.com> Message-ID: On Thu, Sep 13, 2012 at 12:16 PM, Chris Barker wrote: > On Thu, Sep 13, 2012 at 10:36 AM, Michael McCracken > wrote: >> FWIW, here's how I do something similar now, to avoid having many >> copies of the Qt libraries. > > cool! Thanks for the description > >> There is one master app, and several sub-apps. >> >> * call setup() for each of the apps, generating full separate apps >> with copies of the Qt libraries and other stuff >> -- each call has a unique directory sent in the setup options >> "bdist_base" and "dist_dir". This avoids sharing build state, as >> mentioned earlier in the thread. This seems to work fine, calling >> setup() multiple times in the same script. > > good to know -- I think the OP was right, the conflict over the > sharing build dirs -- I didn't know you could override that. > >> * inside main app Contents/Resources, create empty sub.app/ directory >> * for each sub app: >> ** copy sub.app/Contents/MacOS into >> main.app/Contents/Resources/sub.app/Contents/MacOS >> ** copy sub.app/Contents/Info.plist into >> main.app/Contents/Resources/sub.app/Contents/Info.plist >> ** copy everything in sub.app/Contents/Resources/ that isn't include >> or lib into main.app/Contents/Resources/sub.app/Contents/Resources/ >> ** create symlinks for sub.app/Contents/Resources/include -> >> main.app/Contents/Resources/include (do the same with Resources/lib) > > OK -- here is where I"m confused -- with a sylink, you can do either > relative or absoute path, yes? absolute wouldn't work, as who knows > where the user will install it -- but relative could, as long as the > users keeps them all together -- is that how you handle it? Yes, they're relative paths - all the sub-apps stay inside the main .app wrapper. If someone moves things around inside there, that's "unsupported" :) > Alternatively I suppose you could require that main.app be installed > in /Library/Frameworks or something, and then symlink to the absolute > path. > > I actually kind of like that idea, 'cause it would keep the apps a bit > more distinct, -- I have a base I want to use with multiple apps but > don't necessarily want folks to have to install everything at once to > use one. Yes, that'd probably work, but it has the inconvenience of requiring an installer... I'm not sure what the best way to go in your situation is. An installer isn't all that bad, I guess. -mike >> 3. merge the contents of >> sub.app/Contents/Resources/lib/python*/site-packages.zip into the main >> app's copy using zipfile >> 4. merge the contents of the >> sub.app/Contents/Resources/lib/python*/lib-dynload directory into the >> main app's directory > > > But anyway, this is a nice model for what py2app could so for us. > > Thanks, > -Chris > >> NOTE: this will ignore any packages in >> sub.app/Contents/Resources/lib/python*/ that aren't in the >> site-packages.zip. >> That's fine for me, since I have the same "packages" option for all of the apps. >> >> -mike >> >> >> On Thu, Sep 13, 2012 at 1:53 AM, Ronald Oussoren wrote: >>> >>> On 13 Sep, 2012, at 10:47, Paul Wiseman wrote: >>> >>> On 13 September 2012 07:18, Ronald Oussoren wrote: >>>> >>>> >>>> On 10 Sep, 2012, at 16:37, Paul Wiseman wrote: >>>> >>>> Ah, >>>> >>>> I've found out how to recreate the error >>>> >>>> If I create a main.py with nothing but 'import sqlalchemy' >>>> >>>> then use the following setup.py: >>>> >>>> from setuptools import setup >>>> >>>> setup( >>>> version="1", >>>> name="TestApp1", >>>> app=["main.py"], >>>> setup_requires=["py2app"] >>>> ) >>>> >>>> setup( >>>> version="1", >>>> name="TestApp2", >>>> app=["main.py"], >>>> setup_requires=["py2app"] >>>> ) >>>> >>>> If it doesn't produce the error it's probably because of this: "The >>>> "cprocessors" module in SQLAlchemy is written in C and compiles >>>> conditionally, based on if the current platform supports compiling it. If >>>> not present, SQLAlchemy continues to work perfectly well as the hooks which >>>> attempt to import it will fall back to pure-Python functions instead." So >>>> you may have a cprocessors.py which I dont think you'd get the problem, only >>>> if it compiled the .so when sqlalchemy installed. >>>> >>>> >>>> I had the cprocessors extension in my build (that is, py2app mentioned in >>>> copied the extension) >>>> >>>> >>>> I get the error, but only when it builds the second app. In my main build >>>> script I make a few apps in the same script (I make 3 apps which get moved >>>> into the main app, any additional code in their site-packages.zip is moved >>>> into the main apps zip, I remove the "sub-apps" Contents/Resources/lib >>>> folder and symlink it at run time to the main apps lib folder.) >>>> >>>> Is this a bug or are you never supposed to run multiple setups in the same >>>> build? If not how can I achieve the above? >>>> >>>> >>>> Calling distutils.setup multiple times is at best untested with py2app, >>>> and I wouldn't be surprised if it causes problems due to state leaking from >>>> one build into the next. A workaround would be to use the subprocess module >>>> to run the setup jobs in separate processes. >>>> >>> >>> Isn't the problem that they share dist folders, not a process? if not where >>> does the state exist? Would I need to subprocess them from different >>> directories? >>> >>> >>> The py2app command itself has state and I haven't reviewed the code to know >>> for sure that all state is cleaned up when the command is used twice in the >>> same process. BTW. I also don't know if distutils.setup creates a new py2app >>> command object every time it is called, if the second call to >>> distutils.setup creates a new py2app command object there is no information >>> leakage. >>> >>> >>>> >>>> BTW. I don't quite understand what you are trying to do with these 3 apps. >>>> Are you building 3 apps that share a lot of code/resources and where you >>>> want two of the apps to link to the 3th one to reduce the amount of >>>> disk-space used? >>>> >>> >>> Yea exactly, I have some smaller apps which are used for specific separate >>> jobs (one has a simple gui and generates and gathers log files from the main >>> app and zips them up should the main app ever fail to open for instance), >>> the jobs are all to do with the main app and all use a sub set of code to >>> the main app, so I put the apps in the Resources folder and symlink the lib >>> folder so I can include them with only using a little extra disk space, but >>> more importantly keeping the installer size down. >>> >>> >>> That sounds like something that would be useful to support directly. I'll >>> add it to the list of nice-to-have featuers, but don't know when I'll get >>> around to looking into this. >>> >>> Ronald >>> >>> >>>> >>>> Ronald >>>> >>>> >>>> On 10 September 2012 13:18, Ronald Oussoren >>>> wrote: >>>>> >>>>> >>>>> On 9 Sep, 2012, at 20:34, Paul Wiseman wrote: >>>>> >>>>> Hey, >>>>> >>>>> When building an app that is using sqlalchemy I get this error: >>>>> >>>>> creating python loader for extension 'sqlalchemy.cprocessors' >>>>> error: >>>>> /Users/paul/Source/Python/build/bdist.macosx-10.6-intel/python2.7-standalone/app/temp/sqlalchemy/cprocessors.py: >>>>> No such file or directory >>>>> >>>>> I took a look in site packages and there is no cprocessors.py, but a >>>>> cprocessors.so - so maybe it is just looking for the wrong extension >>>>> >>>>> I tried adding "sqlalchemy.cprocessors" to the includes list in py2app >>>>> but that hasn't helped. >>>>> >>>>> I was wondering if I can fool it by dropping an empty cprocessors.py so >>>>> it will build, then swap it out afterwards for the so, but I'm sure there's >>>>> a better way and I'm not convinced that could even work. >>>>> >>>>> Surely py2app doesn't assume every extension is .py, or if it does can it >>>>> be changed? >>>>> >>>>> >>>>> Py2app does not assume that every extension is a python file. Given the >>>>> messasge I'd say that the error occurs in the code path that creates a >>>>> helper python file that actually loads the exention. >>>>> >>>>> A little background information: when py2app creates the application >>>>> bundle all modules are stored in a zipfile and loaded using python's >>>>> zipimporter. Extensions cannot be stored in the zipfiles because the >>>>> zipimporter doesn't support that. Py2app therefore creates a placeholder >>>>> python module in the zipfile that loads the extensions from a directory in >>>>> the application bundle. >>>>> >>>>> BTW. could you please create a sample project that demonstrates the >>>>> problem? I've tried to reproduce your problem on my machine and failed to do >>>>> so. I did run into another problem, py2app generated an incomplete bundle >>>>> due to confusion between a _collections submodule in SQLAlchemy and the >>>>> _collections extension in the stdlib; that's something I'm currently trying >>>>> to fix. >>>>> >>>>> 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 >>>>> >>>>> >>>> >>>> >>> >>> >>> >>> _______________________________________________ >>> 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 >>> >> _______________________________________________ >> 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 poalman at gmail.com Fri Sep 14 01:13:29 2012 From: poalman at gmail.com (Paul Wiseman) Date: Fri, 14 Sep 2012 00:13:29 +0100 Subject: [Pythonmac-SIG] py2app unable to find cprocessors.so In-Reply-To: References: <4FAEB541-D6C5-48E6-8F1A-17A6C240D10F@mac.com> <0498BE1F-2079-454F-8B2D-E97D88F880C3@mac.com> Message-ID: On 13 September 2012 20:16, Chris Barker wrote: > On Thu, Sep 13, 2012 at 10:36 AM, Michael McCracken > wrote: > > FWIW, here's how I do something similar now, to avoid having many > > copies of the Qt libraries. > > cool! Thanks for the description > > > There is one master app, and several sub-apps. > > > > * call setup() for each of the apps, generating full separate apps > > with copies of the Qt libraries and other stuff > > -- each call has a unique directory sent in the setup options > > "bdist_base" and "dist_dir". This avoids sharing build state, as > > mentioned earlier in the thread. This seems to work fine, calling > > setup() multiple times in the same script. > > good to know -- I think the OP was right, the conflict over the > sharing build dirs -- I didn't know you could override that. > > > * inside main app Contents/Resources, create empty sub.app/ directory > > * for each sub app: > > ** copy sub.app/Contents/MacOS into > > main.app/Contents/Resources/sub.app/Contents/MacOS > > ** copy sub.app/Contents/Info.plist into > > main.app/Contents/Resources/sub.app/Contents/Info.plist > > ** copy everything in sub.app/Contents/Resources/ that isn't include > > or lib into main.app/Contents/Resources/sub.app/Contents/Resources/ > > ** create symlinks for sub.app/Contents/Resources/include -> > > main.app/Contents/Resources/include (do the same with Resources/lib) > > OK -- here is where I"m confused -- with a sylink, you can do either > relative or absoute path, yes? absolute wouldn't work, as who knows > where the user will install it -- but relative could, as long as the > users keeps them all together -- is that how you handle it? > > Alternatively I suppose you could require that main.app be installed > in /Library/Frameworks or something, and then symlink to the absolute > path. > > I actually kind of like that idea, 'cause it would keep the apps a bit > more distinct, -- I have a base I want to use with multiple apps but > don't necessarily want folks to have to install everything at once to > use one. > You could create the multiple apps at run time when running the main app, that's not too far away from what I'm doing at the moment. I think it's mainly just a few xml plist files that cant be symlinked because they wont be the same as the main app. A slightly easier solution would be to zip the apps up and drop them in place and relatively symlink the needed parts back to the main app. > > > 3. merge the contents of > > sub.app/Contents/Resources/lib/python*/site-packages.zip into the main > > app's copy using zipfile > > 4. merge the contents of the > > sub.app/Contents/Resources/lib/python*/lib-dynload directory into the > > main app's directory > > > But anyway, this is a nice model for what py2app could so for us. > > Thanks, > -Chris > > > NOTE: this will ignore any packages in > > sub.app/Contents/Resources/lib/python*/ that aren't in the > > site-packages.zip. > > That's fine for me, since I have the same "packages" option for all of > the apps. > > > > -mike > > > > > > On Thu, Sep 13, 2012 at 1:53 AM, Ronald Oussoren > wrote: > >> > >> On 13 Sep, 2012, at 10:47, Paul Wiseman wrote: > >> > >> On 13 September 2012 07:18, Ronald Oussoren > wrote: > >>> > >>> > >>> On 10 Sep, 2012, at 16:37, Paul Wiseman wrote: > >>> > >>> Ah, > >>> > >>> I've found out how to recreate the error > >>> > >>> If I create a main.py with nothing but 'import sqlalchemy' > >>> > >>> then use the following setup.py: > >>> > >>> from setuptools import setup > >>> > >>> setup( > >>> version="1", > >>> name="TestApp1", > >>> app=["main.py"], > >>> setup_requires=["py2app"] > >>> ) > >>> > >>> setup( > >>> version="1", > >>> name="TestApp2", > >>> app=["main.py"], > >>> setup_requires=["py2app"] > >>> ) > >>> > >>> If it doesn't produce the error it's probably because of this: "The > >>> "cprocessors" module in SQLAlchemy is written in C and compiles > >>> conditionally, based on if the current platform supports compiling it. > If > >>> not present, SQLAlchemy continues to work perfectly well as the hooks > which > >>> attempt to import it will fall back to pure-Python functions instead." > So > >>> you may have a cprocessors.py which I dont think you'd get the > problem, only > >>> if it compiled the .so when sqlalchemy installed. > >>> > >>> > >>> I had the cprocessors extension in my build (that is, py2app mentioned > in > >>> copied the extension) > >>> > >>> > >>> I get the error, but only when it builds the second app. In my main > build > >>> script I make a few apps in the same script (I make 3 apps which get > moved > >>> into the main app, any additional code in their site-packages.zip is > moved > >>> into the main apps zip, I remove the "sub-apps" Contents/Resources/lib > >>> folder and symlink it at run time to the main apps lib folder.) > >>> > >>> Is this a bug or are you never supposed to run multiple setups in the > same > >>> build? If not how can I achieve the above? > >>> > >>> > >>> Calling distutils.setup multiple times is at best untested with py2app, > >>> and I wouldn't be surprised if it causes problems due to state leaking > from > >>> one build into the next. A workaround would be to use the subprocess > module > >>> to run the setup jobs in separate processes. > >>> > >> > >> Isn't the problem that they share dist folders, not a process? if not > where > >> does the state exist? Would I need to subprocess them from different > >> directories? > >> > >> > >> The py2app command itself has state and I haven't reviewed the code to > know > >> for sure that all state is cleaned up when the command is used twice in > the > >> same process. BTW. I also don't know if distutils.setup creates a new > py2app > >> command object every time it is called, if the second call to > >> distutils.setup creates a new py2app command object there is no > information > >> leakage. > >> > >> > >>> > >>> BTW. I don't quite understand what you are trying to do with these 3 > apps. > >>> Are you building 3 apps that share a lot of code/resources and where > you > >>> want two of the apps to link to the 3th one to reduce the amount of > >>> disk-space used? > >>> > >> > >> Yea exactly, I have some smaller apps which are used for specific > separate > >> jobs (one has a simple gui and generates and gathers log files from the > main > >> app and zips them up should the main app ever fail to open for > instance), > >> the jobs are all to do with the main app and all use a sub set of code > to > >> the main app, so I put the apps in the Resources folder and symlink the > lib > >> folder so I can include them with only using a little extra disk space, > but > >> more importantly keeping the installer size down. > >> > >> > >> That sounds like something that would be useful to support directly. > I'll > >> add it to the list of nice-to-have featuers, but don't know when I'll > get > >> around to looking into this. > >> > >> Ronald > >> > >> > >>> > >>> Ronald > >>> > >>> > >>> On 10 September 2012 13:18, Ronald Oussoren > >>> wrote: > >>>> > >>>> > >>>> On 9 Sep, 2012, at 20:34, Paul Wiseman wrote: > >>>> > >>>> Hey, > >>>> > >>>> When building an app that is using sqlalchemy I get this error: > >>>> > >>>> creating python loader for extension 'sqlalchemy.cprocessors' > >>>> error: > >>>> > /Users/paul/Source/Python/build/bdist.macosx-10.6-intel/python2.7-standalone/app/temp/sqlalchemy/cprocessors.py: > >>>> No such file or directory > >>>> > >>>> I took a look in site packages and there is no cprocessors.py, but a > >>>> cprocessors.so - so maybe it is just looking for the wrong extension > >>>> > >>>> I tried adding "sqlalchemy.cprocessors" to the includes list in py2app > >>>> but that hasn't helped. > >>>> > >>>> I was wondering if I can fool it by dropping an empty cprocessors.py > so > >>>> it will build, then swap it out afterwards for the so, but I'm sure > there's > >>>> a better way and I'm not convinced that could even work. > >>>> > >>>> Surely py2app doesn't assume every extension is .py, or if it does > can it > >>>> be changed? > >>>> > >>>> > >>>> Py2app does not assume that every extension is a python file. Given > the > >>>> messasge I'd say that the error occurs in the code path that creates a > >>>> helper python file that actually loads the exention. > >>>> > >>>> A little background information: when py2app creates the application > >>>> bundle all modules are stored in a zipfile and loaded using python's > >>>> zipimporter. Extensions cannot be stored in the zipfiles because the > >>>> zipimporter doesn't support that. Py2app therefore creates a > placeholder > >>>> python module in the zipfile that loads the extensions from a > directory in > >>>> the application bundle. > >>>> > >>>> BTW. could you please create a sample project that demonstrates the > >>>> problem? I've tried to reproduce your problem on my machine and > failed to do > >>>> so. I did run into another problem, py2app generated an incomplete > bundle > >>>> due to confusion between a _collections submodule in SQLAlchemy and > the > >>>> _collections extension in the stdlib; that's something I'm currently > trying > >>>> to fix. > >>>> > >>>> 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 > >>>> > >>>> > >>> > >>> > >> > >> > >> > >> _______________________________________________ > >> 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 > >> > > _______________________________________________ > > 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 > -------------- next part -------------- An HTML attachment was scrubbed... URL: From michael.mccracken at gmail.com Fri Sep 14 01:32:29 2012 From: michael.mccracken at gmail.com (Michael McCracken) Date: Thu, 13 Sep 2012 16:32:29 -0700 Subject: [Pythonmac-SIG] py2app unable to find cprocessors.so In-Reply-To: References: <4FAEB541-D6C5-48E6-8F1A-17A6C240D10F@mac.com> <0498BE1F-2079-454F-8B2D-E97D88F880C3@mac.com> Message-ID: On Thu, Sep 13, 2012 at 4:13 PM, Paul Wiseman wrote: > On 13 September 2012 20:16, Chris Barker wrote: >> >> On Thu, Sep 13, 2012 at 10:36 AM, Michael McCracken >> wrote: >> > FWIW, here's how I do something similar now, to avoid having many >> > copies of the Qt libraries. >> >> cool! Thanks for the description >> >> > There is one master app, and several sub-apps. >> > >> > * call setup() for each of the apps, generating full separate apps >> > with copies of the Qt libraries and other stuff >> > -- each call has a unique directory sent in the setup options >> > "bdist_base" and "dist_dir". This avoids sharing build state, as >> > mentioned earlier in the thread. This seems to work fine, calling >> > setup() multiple times in the same script. >> >> good to know -- I think the OP was right, the conflict over the >> sharing build dirs -- I didn't know you could override that. >> >> > * inside main app Contents/Resources, create empty sub.app/ directory >> > * for each sub app: >> > ** copy sub.app/Contents/MacOS into >> > main.app/Contents/Resources/sub.app/Contents/MacOS >> > ** copy sub.app/Contents/Info.plist into >> > main.app/Contents/Resources/sub.app/Contents/Info.plist >> > ** copy everything in sub.app/Contents/Resources/ that isn't include >> > or lib into main.app/Contents/Resources/sub.app/Contents/Resources/ >> > ** create symlinks for sub.app/Contents/Resources/include -> >> > main.app/Contents/Resources/include (do the same with Resources/lib) >> >> OK -- here is where I"m confused -- with a sylink, you can do either >> relative or absoute path, yes? absolute wouldn't work, as who knows >> where the user will install it -- but relative could, as long as the >> users keeps them all together -- is that how you handle it? >> >> Alternatively I suppose you could require that main.app be installed >> in /Library/Frameworks or something, and then symlink to the absolute >> path. >> >> I actually kind of like that idea, 'cause it would keep the apps a bit >> more distinct, -- I have a base I want to use with multiple apps but >> don't necessarily want folks to have to install everything at once to >> use one. > > > You could create the multiple apps at run time when running the main app, > that's not too far away from what I'm doing at the moment. I think it's > mainly just a few xml plist files that cant be symlinked because they wont > be the same as the main app. A slightly easier solution would be to zip the > apps up and drop them in place and relatively symlink the needed parts back > to the main app. Yep, this could probably be made to work, but would break code signatures on any apps that you changed in that way - just something to keep in mind. From ronaldoussoren at mac.com Fri Sep 14 08:51:54 2012 From: ronaldoussoren at mac.com (Ronald Oussoren) Date: Fri, 14 Sep 2012 08:51:54 +0200 Subject: [Pythonmac-SIG] py2app unable to find cprocessors.so In-Reply-To: References: <9E886771-9C0F-4DF2-9A20-DFA8C48E7C4A@mac.com> <4BBCFCA9-F2DF-45DC-B3CE-731E1A97C15F@mac.com> Message-ID: On 13 Sep, 2012, at 23:41, Paul Wiseman wrote: > On 13 September 2012 19:56, Michael McCracken wrote: > Paul, it's like this: > setup(blah, options={"py2app": = {"bdist_base": "build/app1", > "dist_dir": "dist/app1"}}) > setup(blah, options={"py2app": = {"bdist_base": "build/app2", > "dist_dir": "dist/app2"}}) > > For the full version, see my setup.py here: (ignore "windows-installer") > > http://bazaar.launchpad.net/~ubuntuone-control-tower/ubuntuone-windows-installer/trunk/view/head:/scripts/setup-mac.py > > see line 571 for how I call setup, line 562 for where I set the > app-specific options, and line 497 for the dict with the options that > the apps have in common. > > -mike > > > Awesome, thanks buddy! > > changing the dist and build folders has solved my problem with cprocessors.py and I can get a build, however running the app now reveals another hurdle (yay) > > ImportError: dlopen(/Users/paul/Source/Python/dist/_--_BRAND_--_/_--_BRAND_--_.app/Contents/Resources/lib/python2.7/lib-dynload/wx/_core_.so, 2): no suitable image found. Did find: > /Users/paul/Source/Python/dist/_--_BRAND_--_/_--_BRAND_--_.app/Contents/Resources/lib/python2.7/lib-dynload/wx/_core_.so: no matching architecture in universal wrapper > > running file on it gives the following; > > paul$ file dist/_--_BRAND_--_/_--_BRAND_--_.app/Contents/Resources/lib/python2.7/lib-dynload/wx/_core_.so > dist/_--_BRAND_--_/_--_BRAND_--_.app/Contents/Resources/lib/python2.7/lib-dynload/wx/_core_.so: Mach-O universal binary with 2 architectures > dist/_--_BRAND_--_/_--_BRAND_--_.app/Contents/Resources/lib/python2.7/lib-dynload/wx/_core_.so (for architecture ppc): Mach-O bundle ppc > dist/_--_BRAND_--_/_--_BRAND_--_.app/Contents/Resources/lib/python2.7/lib-dynload/wx/_core_.so (for architecture i386): Mach-O bundle i386 > > and running this shows that it's looking for x86_64 > > paul$ dist/_--_BRAND_--_/_--_BRAND_--_.app/Contents/MacOS/python > Python 2.7.3 (v2.7.3:70274d53c1dd, Apr 9 2012, 20:52:43) > [GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin > Type "help", "copyright", "credits" or "license" for more information. > >>> import sys > >>> sys.maxsize > 9223372036854775807 > > but... > > paul$ python > Python 2.7.3 (v2.7.3:70274d53c1dd, Apr 9 2012, 20:52:43) > [GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin > Type "help", "copyright", "credits" or "license" for more information. > >>> import sys > >>> sys.maxsize > 2147483647 > > my python interpreter is 32-bit and I ran 'python setup.py py2app' - how has the app got ahold of a 64bit interpreter? I thought it just used the one that you call setup with? What does the file command have to say about the python you use? Are you by any change using Apple's python with VERSIONER_PYTHON_PREFER_32_BIT set the environment (or the simular settings in defaults(1)). That would explain why you get a binary in the app bundle that supports 64-bit code while you don't get 64-bit code outsite of it. :>>> import distutils.util :>>> distutils.util.get_platform() 'macosx-10.8-intel' Py2app currently doesn't detect this, although it might be better to do so (either automaticly adjust the executable in the bundle, or warn about this) Ronald > > On Thu, Sep 13, 2012 at 11:32 AM, Paul Wiseman wrote: > > On 13 September 2012 14:36, Ronald Oussoren wrote: > >> > >> > >> On 13 Sep, 2012, at 15:17, Paul Wiseman wrote: > >> > >> On 13 September 2012 13:26, Ronald Oussoren > >> wrote: > >>> > >>> > >>> On 13 Sep, 2012, at 14:17, Paul Wiseman wrote: > >>> > >>> On 13 September 2012 12:13, Ronald Oussoren > >>> wrote: > >>>>>> > >>>>>> > >>>>> > >>>>> I checked out the latest trunk > >>>>> (http://svn.pythonmac.org/py2app/py2app/trunk/), installed that and the > >>>>> problem has gone :) > >>>>> > >>>>> Not sure which version I had before, but I only built this mac a week > >>>>> ago or so, so think it's maybe the current version available for download > >>>>> > >>>> > >>>> Hm maybe I spoke too soon, it builds ok now but when I run the app I get > >>>> a error dialog with Open console and Terminate options, and this stack trace > >>>> in the console > >>>> > >>>> Traceback (most recent call last): > >>>> File "/Applications/ZipCloud.app/Contents/Resources/__boot__.py", line > >>>> 103, in > >>>> _argv_emulation() > >>>> File "/Applications/ZipCloud.app/Contents/Resources/__boot__.py", line > >>>> 101, in _argv_emulation > >>>> _get_argvemulator().mainloop() > >>>> File "/Applications/ZipCloud.app/Contents/Resources/__boot__.py", line > >>>> 40, in mainloop > >>>> stoptime = Evt.TickCount() + timeout > >>>> AttributeError: 'module' object has no attribute 'TickCount' > >>>> > >>>> That's odd, that code is not present in the trunk. Have you removed the > >>>> dist and build directories before testing the latest py2app? > >>>> > >>>> Ronald > >>> > >>> > >>> Yea definitely, I removed them at the start of the build script. I > >>> removed them myself and ran it again with the same outcome. How can I check > >>> which version I'm running? I guess installing the current trunk hasn't > >>> worked exactly > >>> > >>> > >>> The easiest way to check the version is run "python -c 'import py2app; > >>> print(py2app.__version__)'". > >>> > >>> Ronald > >>> > >> > >> I've got 0.5.3 which I'm a bit confused at as I can get 0.6.4 from pypi. I > >> just looked in the one I checked out from svn, and in the readme it says > >> 0.5.3 - whats the address I can checkout the latest version? > >> > >> > >> I should have noticed this before, but the py2app sources aren't at > >> svn.pythonmac.org anymore. Py2app is currently hosted at > >> , and you'll also have to > >> install the sibling projects altgraph, modulegraph and macholib. > >> > >> I hope to have some time this weekend to push out new releases of these > >> projects, > >> > >> Ronald > > > > > > I tried with multiprocess but I had no joy, I didn't manage to see the > > stderr but it definitely wasn't building the subapps so I believe it was > > getting the same error. > > > > I've got a 10.7 macbook I'm putting devtools and sqlalchemy on which I'll > > try tomorrow and see if it will build or not to get more evidence if it's a > > problem with 10.6 or not > > > -------------- 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 poalman at gmail.com Fri Sep 14 12:26:10 2012 From: poalman at gmail.com (Paul Wiseman) Date: Fri, 14 Sep 2012 11:26:10 +0100 Subject: [Pythonmac-SIG] py2app unable to find cprocessors.so In-Reply-To: References: <9E886771-9C0F-4DF2-9A20-DFA8C48E7C4A@mac.com> <4BBCFCA9-F2DF-45DC-B3CE-731E1A97C15F@mac.com> Message-ID: On 14 September 2012 07:51, Ronald Oussoren wrote: > > On 13 Sep, 2012, at 23:41, Paul Wiseman wrote: > > On 13 September 2012 19:56, Michael McCracken > wrote: > >> Paul, it's like this: >> setup(blah, options={"py2app": = {"bdist_base": "build/app1", >> "dist_dir": "dist/app1"}}) >> setup(blah, options={"py2app": = {"bdist_base": "build/app2", >> "dist_dir": "dist/app2"}}) >> >> For the full version, see my setup.py here: (ignore "windows-installer") >> >> >> http://bazaar.launchpad.net/~ubuntuone-control-tower/ubuntuone-windows-installer/trunk/view/head:/scripts/setup-mac.py >> >> see line 571 for how I call setup, line 562 for where I set the >> app-specific options, and line 497 for the dict with the options that >> the apps have in common. >> >> -mike >> >> > Awesome, thanks buddy! > > changing the dist and build folders has solved my problem with > cprocessors.py and I can get a build, however running the app now reveals > another hurdle (yay) > > ImportError: > dlopen(/Users/paul/Source/Python/dist/_--_BRAND_--_/_--_BRAND_--_.app/Contents/Resources/lib/python2.7/lib-dynload/wx/_core_.so, > 2): no suitable image found. Did find: > /Users/paul/Source/Python/dist/_--_BRAND_--_/_--_BRAND_--_.app/Contents/Resources/lib/python2.7/lib-dynload/wx/_core_.so: > no matching architecture in universal wrapper > > running file on it gives the following; > > paul$ file > dist/_--_BRAND_--_/_--_BRAND_--_.app/Contents/Resources/lib/python2.7/lib-dynload/wx/_core_.so > dist/_--_BRAND_--_/_--_BRAND_--_.app/Contents/Resources/lib/python2.7/lib-dynload/wx/_core_.so: > Mach-O universal binary with 2 architectures > dist/_--_BRAND_--_/_--_BRAND_--_.app/Contents/Resources/lib/python2.7/lib-dynload/wx/_core_.so > (for architecture ppc): Mach-O bundle ppc > dist/_--_BRAND_--_/_--_BRAND_--_.app/Contents/Resources/lib/python2.7/lib-dynload/wx/_core_.so > (for architecture i386): Mach-O bundle i386 > > and running this shows that it's looking for x86_64 > > paul$ dist/_--_BRAND_--_/_--_BRAND_--_.app/Contents/MacOS/python > Python 2.7.3 (v2.7.3:70274d53c1dd, Apr 9 2012, 20:52:43) > [GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin > Type "help", "copyright", "credits" or "license" for more information. > >>> import sys > >>> sys.maxsize > 9223372036854775807 > > but... > > paul$ python > Python 2.7.3 (v2.7.3:70274d53c1dd, Apr 9 2012, 20:52:43) > [GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin > Type "help", "copyright", "credits" or "license" for more information. > >>> import sys > >>> sys.maxsize > 2147483647 > > my python interpreter is 32-bit and I ran 'python setup.py py2app' - how > has the app got ahold of a 64bit interpreter? I thought it just used the > one that you call setup with? > > > What does the file command have to say about the python you use? Are you > by any change using Apple's python with VERSIONER_PYTHON_PREFER_32_BIT set > the environment (or the simular settings in defaults(1)). That would > explain why you get a binary in the app bundle that supports 64-bit code > while you don't get 64-bit code outsite of it. > > :>>> import distutils.util > :>>> distutils.util.get_platform() > 'macosx-10.8-intel' > > Py2app currently doesn't detect this, although it might be better to do so > (either automaticly adjust the executable in the bundle, or warn about this) > > Ronald > > Ah, yea I am indeed using the VERSIONER variable, I got myself confused because I was checking this, pauls-mac-pro:Python paul$ type python python is hashed (/Library/Frameworks/Python.framework/Versions/2.7/bin/python) paul$ file /Library/Frameworks/Python.framework/Versions/2.7/bin/python /Library/Frameworks/Python.framework/Versions/2.7/bin/python: Mach-O universal binary with 1 architecture /Library/Frameworks/Python.framework/Versions/2.7/bin/python (for architecture i386): Mach-O executable i386 which I don't quite understand, but. paul$ file $(whereis python) /usr/bin/python: Mach-O universal binary with 3 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 /usr/bin/python (for architecture ppc7400): Mach-O executable ppc would explain it, although I'm a little confused which python I'm actually running when I type python, I guess it must be the later (which is /usr/bin/python) By the way, thank you all so much for your help with this!! I think I'm getting pretty close now I think :) So the final question (hopefully ;) ) is how can I use the later python (I want i386 and ppc support, so don't want to use the former) but default it to not use x86_64? > > > >> On Thu, Sep 13, 2012 at 11:32 AM, Paul Wiseman >> wrote: >> > On 13 September 2012 14:36, Ronald Oussoren >> wrote: >> >> >> >> >> >> On 13 Sep, 2012, at 15:17, Paul Wiseman wrote: >> >> >> >> On 13 September 2012 13:26, Ronald Oussoren >> >> wrote: >> >>> >> >>> >> >>> On 13 Sep, 2012, at 14:17, Paul Wiseman wrote: >> >>> >> >>> On 13 September 2012 12:13, Ronald Oussoren >> >>> wrote: >> >>>>>> >> >>>>>> >> >>>>> >> >>>>> I checked out the latest trunk >> >>>>> (http://svn.pythonmac.org/py2app/py2app/trunk/), installed that >> and the >> >>>>> problem has gone :) >> >>>>> >> >>>>> Not sure which version I had before, but I only built this mac a >> week >> >>>>> ago or so, so think it's maybe the current version available for >> download >> >>>>> >> >>>> >> >>>> Hm maybe I spoke too soon, it builds ok now but when I run the app I >> get >> >>>> a error dialog with Open console and Terminate options, and this >> stack trace >> >>>> in the console >> >>>> >> >>>> Traceback (most recent call last): >> >>>> File "/Applications/ZipCloud.app/Contents/Resources/__boot__.py", >> line >> >>>> 103, in >> >>>> _argv_emulation() >> >>>> File "/Applications/ZipCloud.app/Contents/Resources/__boot__.py", >> line >> >>>> 101, in _argv_emulation >> >>>> _get_argvemulator().mainloop() >> >>>> File "/Applications/ZipCloud.app/Contents/Resources/__boot__.py", >> line >> >>>> 40, in mainloop >> >>>> stoptime = Evt.TickCount() + timeout >> >>>> AttributeError: 'module' object has no attribute 'TickCount' >> >>>> >> >>>> That's odd, that code is not present in the trunk. Have you removed >> the >> >>>> dist and build directories before testing the latest py2app? >> >>>> >> >>>> Ronald >> >>> >> >>> >> >>> Yea definitely, I removed them at the start of the build script. I >> >>> removed them myself and ran it again with the same outcome. How can I >> check >> >>> which version I'm running? I guess installing the current trunk hasn't >> >>> worked exactly >> >>> >> >>> >> >>> The easiest way to check the version is run "python -c 'import py2app; >> >>> print(py2app.__version__)'". >> >>> >> >>> Ronald >> >>> >> >> >> >> I've got 0.5.3 which I'm a bit confused at as I can get 0.6.4 from >> pypi. I >> >> just looked in the one I checked out from svn, and in the readme it >> says >> >> 0.5.3 - whats the address I can checkout the latest version? >> >> >> >> >> >> I should have noticed this before, but the py2app sources aren't at >> >> svn.pythonmac.org anymore. Py2app is currently hosted at >> >> , and you'll also have to >> >> install the sibling projects altgraph, modulegraph and macholib. >> >> >> >> I hope to have some time this weekend to push out new releases of these >> >> projects, >> >> >> >> Ronald >> > >> > >> > I tried with multiprocess but I had no joy, I didn't manage to see the >> > stderr but it definitely wasn't building the subapps so I believe it was >> > getting the same error. >> > >> > I've got a 10.7 macbook I'm putting devtools and sqlalchemy on which >> I'll >> > try tomorrow and see if it will build or not to get more evidence if >> it's a >> > problem with 10.6 or not >> > >> > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From ronaldoussoren at mac.com Fri Sep 14 12:35:04 2012 From: ronaldoussoren at mac.com (Ronald Oussoren) Date: Fri, 14 Sep 2012 12:35:04 +0200 Subject: [Pythonmac-SIG] py2app unable to find cprocessors.so In-Reply-To: References: <9E886771-9C0F-4DF2-9A20-DFA8C48E7C4A@mac.com> <4BBCFCA9-F2DF-45DC-B3CE-731E1A97C15F@mac.com> Message-ID: <08517CB8-A517-4E5F-AC91-15BBA3228702@mac.com> On 14 Sep, 2012, at 12:26, Paul Wiseman wrote: > > Ah, yea I am indeed using the VERSIONER variable, I got myself confused because I was checking this, > > pauls-mac-pro:Python paul$ type python > python is hashed (/Library/Frameworks/Python.framework/Versions/2.7/bin/python) > paul$ file /Library/Frameworks/Python.framework/Versions/2.7/bin/python > /Library/Frameworks/Python.framework/Versions/2.7/bin/python: Mach-O universal binary with 1 architecture > /Library/Frameworks/Python.framework/Versions/2.7/bin/python (for architecture i386): Mach-O executable i386 > > which I don't quite understand, but. > > paul$ file $(whereis python) > /usr/bin/python: Mach-O universal binary with 3 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 > /usr/bin/python (for architecture ppc7400): Mach-O executable ppc > > would explain it, although I'm a little confused which python I'm actually running when I type python, I guess it must be the later (which is /usr/bin/python) You could try: python -c 'import sys; print(sys.executable)' > > By the way, thank you all so much for your help with this!! I think I'm getting pretty close now I think :) > > So the final question (hopefully ;) ) is how can I use the later python (I want i386 and ppc support, so don't want to use the former) but default it to not use x86_64? I don't have support for selecting a different bootstrap executable right now. A crude hack: look for the installed py2app package, and in particular the directory "py2app/apptemplate/prebuilt". Then copy "main-fat" to "main-3way". This replaces the executable that py2app puts into the application bundle by a version that only supports the PPC and i386 architectures. A slightly less hack way: the lipo command-line tool can be used to strip architectures from a binary, you could run that after running py2app. Ronald -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 4788 bytes Desc: not available URL: From poalman at gmail.com Fri Sep 14 21:15:19 2012 From: poalman at gmail.com (Paul Wiseman) Date: Fri, 14 Sep 2012 20:15:19 +0100 Subject: [Pythonmac-SIG] py2app unable to find cprocessors.so In-Reply-To: <08517CB8-A517-4E5F-AC91-15BBA3228702@mac.com> References: <9E886771-9C0F-4DF2-9A20-DFA8C48E7C4A@mac.com> <4BBCFCA9-F2DF-45DC-B3CE-731E1A97C15F@mac.com> <08517CB8-A517-4E5F-AC91-15BBA3228702@mac.com> Message-ID: On 14 September 2012 11:35, Ronald Oussoren wrote: > > On 14 Sep, 2012, at 12:26, Paul Wiseman wrote: > > > > Ah, yea I am indeed using the VERSIONER variable, I got myself confused > because I was checking this, > > > > pauls-mac-pro:Python paul$ type python > > python is hashed > (/Library/Frameworks/Python.framework/Versions/2.7/bin/python) > > paul$ file /Library/Frameworks/Python.framework/Versions/2.7/bin/python > > /Library/Frameworks/Python.framework/Versions/2.7/bin/python: Mach-O > universal binary with 1 architecture > > /Library/Frameworks/Python.framework/Versions/2.7/bin/python (for > architecture i386): Mach-O executable i386 > > > > which I don't quite understand, but. > > > > paul$ file $(whereis python) > > /usr/bin/python: Mach-O universal binary with 3 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 > > /usr/bin/python (for architecture ppc7400): Mach-O executable ppc > > > > would explain it, although I'm a little confused which python I'm > actually running when I type python, I guess it must be the later (which is > /usr/bin/python) > > You could try: python -c 'import sys; print(sys.executable)' > > > > > By the way, thank you all so much for your help with this!! I think I'm > getting pretty close now I think :) > > > > So the final question (hopefully ;) ) is how can I use the later python > (I want i386 and ppc support, so don't want to use the former) but default > it to not use x86_64? > > I don't have support for selecting a different bootstrap executable right > now. > > A crude hack: look for the installed py2app package, and in particular the > directory "py2app/apptemplate/prebuilt". Then copy "main-fat" to > "main-3way". This replaces the executable that py2app puts into the > application bundle by a version that only supports the PPC and i386 > architectures. > > A slightly less hack way: the lipo command-line tool can be used to strip > architectures from a binary, you could run that after running py2app. > > Ronald Ah that's pretty cool- will be worth remembering. I was just being stupid though, I just downloaded python for i386/ppc from python.org. I thought I already had that one but I must have had the other x86_64/i386 one. Whoops. All is working perfectly now :D - Thank you so much again for all your help and work on the project! -------------- next part -------------- An HTML attachment was scrubbed... URL: From poalman at gmail.com Mon Sep 17 19:13:34 2012 From: poalman at gmail.com (Paul Wiseman) Date: Mon, 17 Sep 2012 18:13:34 +0100 Subject: [Pythonmac-SIG] ImportError, no suitable image found (app not running under 10.5) Message-ID: This app runs fine on 10.6 and 10.7, but when I run it on 10.5 I an apple error report, and the following error in console Traceback (most recent call last): ImportError: dlopen(/Applications/TestApp.app/Contents/Resources/lib/python2.7/lib-dynload/_librsync.so, 2): Library not loaded: @executable_path/../Frameworks/librsync.1.dylib Referenced from: /Applications/TestApp.app/Contents/Resources/lib/python2.7/lib-dynload/_librsync.so Reason: no suitable image found. Did find: /Applications/TestApp.app/Contents/MacOS/../Frameworks/librsync.1.dylib: unknown required load command 0x80000022 /Applications/TestApp.app/Contents/MacOS/../Frameworks/librsync.1.dylib: unknown required load command 0x80000022 TestApp Error ([0x0-0x1e01e].org.pythonmac.unspecified.TestApp[342]) Exited abnormally: Bus error I searched around and found this, http://www.riverbankcomputing.com/pipermail/pyqt/2009-November/025098.htmlalthough I think it might be specific to compiling pyqt and this solution http://www.riverbankcomputing.com/pipermail/pyqt/2011-June/029975.html but not really sure if it applies to my case or not. I have both Xcode 3 and 4 installed and I have the 10.5 SDK, I'm just not sure about how I can compile the extensions I need to use it? -------------- next part -------------- An HTML attachment was scrubbed... URL: From poalman at gmail.com Mon Sep 17 20:03:07 2012 From: poalman at gmail.com (Paul Wiseman) Date: Mon, 17 Sep 2012 19:03:07 +0100 Subject: [Pythonmac-SIG] ImportError, no suitable image found (app not running under 10.5) In-Reply-To: References: Message-ID: On 17 September 2012 18:13, Paul Wiseman wrote: > This app runs fine on 10.6 and 10.7, but when I run it on 10.5 I an apple > error report, and the following error in console > > Traceback (most recent call last): > > ImportError: > dlopen(/Applications/TestApp.app/Contents/Resources/lib/python2.7/lib-dynload/_librsync.so, > 2): Library not loaded: @executable_path/../Frameworks/librsync.1.dylib > Referenced from: > /Applications/TestApp.app/Contents/Resources/lib/python2.7/lib-dynload/_librsync.so > Reason: no suitable image found. Did find: > > /Applications/TestApp.app/Contents/MacOS/../Frameworks/librsync.1.dylib: > unknown required load command 0x80000022 > > /Applications/TestApp.app/Contents/MacOS/../Frameworks/librsync.1.dylib: > unknown required load command 0x80000022 > TestApp Error > ([0x0-0x1e01e].org.pythonmac.unspecified.TestApp[342]) Exited abnormally: > Bus error > > I searched around and found this, > http://www.riverbankcomputing.com/pipermail/pyqt/2009-November/025098.htmlalthough I think it might be specific to compiling pyqt and this solution > http://www.riverbankcomputing.com/pipermail/pyqt/2011-June/029975.htmlbut not really sure if it applies to my case or not. > > I have both Xcode 3 and 4 installed and I have the 10.5 SDK, I'm just not > sure about how I can compile the extensions I need to use it? > Just did file on the librsync.1.dylib and it only supports i386 which I guess is the problem. Any idea why this wouldn't have been built with ppc like the so was? I've tried building again with -isysroot /Xcode3/SDKs/MacOSX10.5.sdk -mmacosx-version-min=10.5 CFLAGS but doesn't seem to help -------------- next part -------------- An HTML attachment was scrubbed... URL: From dave at bcs.co.nz Mon Sep 17 23:11:41 2012 From: dave at bcs.co.nz (David Brooks) Date: Tue, 18 Sep 2012 09:11:41 +1200 Subject: [Pythonmac-SIG] ImportError, no suitable image found (app not running under 10.5) In-Reply-To: References: Message-ID: <5057920D.9030806@bcs.co.nz> On 18/09/12 6:03 AM, Paul Wiseman wrote: > On 17 September 2012 18:13, Paul Wiseman > wrote: > > This app runs fine on 10.6 and 10.7, but when I run it on 10.5 I > an apple error report, and the following error in console > > Traceback (most recent call last): > > ImportError: > dlopen(/Applications/TestApp.app/Contents/Resources/lib/python2.7/lib-dynload/_librsync.so, > 2): Library not loaded: > @executable_path/../Frameworks/librsync.1.dylib > Referenced from: > /Applications/TestApp.app/Contents/Resources/lib/python2.7/lib-dynload/_librsync.so > Reason: no suitable image found. Did find: > /Applications/TestApp.app/Contents/MacOS/../Frameworks/librsync.1.dylib: > unknown required load command 0x80000022 > /Applications/TestApp.app/Contents/MacOS/../Frameworks/librsync.1.dylib: > unknown required load command 0x80000022 > TestApp Error > ([0x0-0x1e01e].org.pythonmac.unspecified.TestApp[342]) Exited > abnormally: Bus error > > I searched around and found this, > http://www.riverbankcomputing.com/pipermail/pyqt/2009-November/025098.htmlalthough > I think it might be specific to compiling pyqt and this solution > http://www.riverbankcomputing.com/pipermail/pyqt/2011-June/029975.htmlbut > not really sure if it applies to my case or not. > > I have both Xcode 3 and 4 installed and I have the 10.5 SDK, I'm > just not sure about how I can compile the extensions I need to use it? > > > > Just did file on the librsync.1.dylib and it only supports i386 which > I guess is the problem. Any idea why this wouldn't have been built > with ppc like the so was? > > I've tried building again with -isysroot /Xcode3/SDKs/MacOSX10.5.sdk > -mmacosx-version-min=10.5 CFLAGS but doesn't seem to help > When and how did you install librsync?? Manually or using Brew, MacPorts, or Fink? What about re-installing and setting whatever options are needed to include the PPC architecture? -------------- next part -------------- An HTML attachment was scrubbed... URL: From poalman at gmail.com Tue Sep 18 10:51:54 2012 From: poalman at gmail.com (Paul Wiseman) Date: Tue, 18 Sep 2012 09:51:54 +0100 Subject: [Pythonmac-SIG] ImportError, no suitable image found (app not running under 10.5) In-Reply-To: <5057920D.9030806@bcs.co.nz> References: <5057920D.9030806@bcs.co.nz> Message-ID: On 17 September 2012 22:11, David Brooks wrote: > > On 18/09/12 6:03 AM, Paul Wiseman wrote: > > On 17 September 2012 18:13, Paul Wiseman wrote: > >> This app runs fine on 10.6 and 10.7, but when I run it on 10.5 I an apple >> error report, and the following error in console >> >> Traceback (most recent call last): >> >> ImportError: >> dlopen(/Applications/TestApp.app/Contents/Resources/lib/python2.7/lib-dynload/_librsync.so, >> 2): Library not loaded: @executable_path/../Frameworks/librsync.1.dylib >> Referenced from: >> /Applications/TestApp.app/Contents/Resources/lib/python2.7/lib-dynload/_librsync.so >> Reason: no suitable image found. Did find: >> >> /Applications/TestApp.app/Contents/MacOS/../Frameworks/librsync.1.dylib: >> unknown required load command 0x80000022 >> >> /Applications/TestApp.app/Contents/MacOS/../Frameworks/librsync.1.dylib: >> unknown required load command 0x80000022 >> TestApp Error >> ([0x0-0x1e01e].org.pythonmac.unspecified.TestApp[342]) Exited abnormally: >> Bus error >> >> I searched around and found this, >> http://www.riverbankcomputing.com/pipermail/pyqt/2009-November/025098.htmlalthough I think it might be specific to compiling pyqt and this solution >> http://www.riverbankcomputing.com/pipermail/pyqt/2011-June/029975.htmlbut not really sure if it applies to my case or not. >> >> I have both Xcode 3 and 4 installed and I have the 10.5 SDK, I'm just >> not sure about how I can compile the extensions I need to use it? >> > > > Just did file on the librsync.1.dylib and it only supports i386 which I > guess is the problem. Any idea why this wouldn't have been built with ppc > like the so was? > > I've tried building again with -isysroot /Xcode3/SDKs/MacOSX10.5.sdk > -mmacosx-version-min=10.5 CFLAGS but doesn't seem to help > > When and how did you install librsync?? Manually or using Brew, MacPorts, > or Fink? What about re-installing and setting whatever options are needed > to include the PPC architecture? > I downloaded the librsync source using fink, but installed duplicity for the python extension. This is how I installed duplicity, it looks as if it should be building for ppc, maybe its the targeting 10.5 that isn't working though? paul$ export CC='/Xcode3/usr/bin/gcc-4.0' paul$ export ARCHFLAGS='-arch ppc -arch i386' paul$ export CFLAGS='-isysroot /Xcode3/SDKs/MacOSX10.5.sdk -mmacosx-version-min=10.5' paul$ python setup.py --librsync-dir=/sw build running build running build_py running build_ext building 'duplicity._librsync' extension /Xcode3/usr/bin/gcc-4.0 -DNDEBUG -g -O3 -isysroot /Xcode3/SDKs/MacOSX10.5.sdk -mmacosx-version-min=10.5 -arch ppc -arch i386 -I/sw/include -I/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c duplicity/_librsyncmodule.c -o build/temp.macosx-10.3-fat-2.7/duplicity/_librsyncmodule.o /Xcode3/usr/bin/gcc-4.0 -bundle -undefined dynamic_lookup -g -isysroot /Xcode3/SDKs/MacOSX10.5.sdk -mmacosx-version-min=10.5 -arch ppc -arch i386 build/temp.macosx-10.3-fat-2.7/duplicity/_librsyncmodule.o -L/sw/lib -lrsync -o build/lib.macosx-10.3-fat-2.7/duplicity/_librsync.so ld: warning in /sw/lib/librsync.dylib, file is not of required architecture running build_scripts creating build/scripts-2.7 copying and adjusting bin/rdiffdir -> build/scripts-2.7 copying and adjusting bin/duplicity -> build/scripts-2.7 changing mode of build/scripts-2.7/rdiffdir from 644 to 755 changing mode of build/scripts-2.7/duplicity from 644 to 755 Perhaps its the warning librsync.dylib is not of required architecture, which I guess is missing ppc. Any ideas how I can resolve that? -------------- next part -------------- An HTML attachment was scrubbed... URL: From dave at bcs.co.nz Tue Sep 18 13:30:17 2012 From: dave at bcs.co.nz (David Brooks) Date: Tue, 18 Sep 2012 23:30:17 +1200 Subject: [Pythonmac-SIG] ImportError, no suitable image found (app not running under 10.5) In-Reply-To: References: <5057920D.9030806@bcs.co.nz> Message-ID: <50585B49.7030407@bcs.co.nz> On 18/09/12 8:51 PM, Paul Wiseman wrote: > On 17 September 2012 22:11, David Brooks > wrote: > > > On 18/09/12 6:03 AM, Paul Wiseman wrote: >> On 17 September 2012 18:13, Paul Wiseman > > wrote: >> >> This app runs fine on 10.6 and 10.7, but when I run it on >> 10.5 I an apple error report, and the following error in console >> >> Traceback (most recent call last): >> >> ImportError: >> dlopen(/Applications/TestApp.app/Contents/Resources/lib/python2.7/lib-dynload/_librsync.so, >> 2): Library not loaded: >> @executable_path/../Frameworks/librsync.1.dylib >> Referenced from: >> /Applications/TestApp.app/Contents/Resources/lib/python2.7/lib-dynload/_librsync.so >> Reason: no suitable image found. Did find: >> /Applications/TestApp.app/Contents/MacOS/../Frameworks/librsync.1.dylib: >> unknown required load command 0x80000022 >> /Applications/TestApp.app/Contents/MacOS/../Frameworks/librsync.1.dylib: >> unknown required load command 0x80000022 >> TestApp Error >> ([0x0-0x1e01e].org.pythonmac.unspecified.TestApp[342]) Exited >> abnormally: Bus error >> >> I searched around and found this, >> http://www.riverbankcomputing.com/pipermail/pyqt/2009-November/025098.htmlalthough >> I think it might be specific to compiling pyqt and this >> solution >> http://www.riverbankcomputing.com/pipermail/pyqt/2011-June/029975.htmlbut >> not really sure if it applies to my case or not. >> >> I have both Xcode 3 and 4 installed and I have the 10.5 SDK, >> I'm just not sure about how I can compile the extensions I >> need to use it? >> >> >> >> Just did file on the librsync.1.dylib and it only supports i386 >> which I guess is the problem. Any idea why this wouldn't have >> been built with ppc like the so was? >> >> I've tried building again with -isysroot >> /Xcode3/SDKs/MacOSX10.5.sdk -mmacosx-version-min=10.5 CFLAGS but >> doesn't seem to help >> > When and how did you install librsync?? Manually or using Brew, > MacPorts, or Fink? What about re-installing and setting whatever > options are needed to include the PPC architecture? > > > I downloaded the librsync source using fink, but installed duplicity > for the python extension. This is how I installed duplicity, it looks > as if it should be building for ppc, maybe its the targeting 10.5 that > isn't working though? > > paul$ export CC='/Xcode3/usr/bin/gcc-4.0' > paul$ export ARCHFLAGS='-arch ppc -arch i386' > paul$ export CFLAGS='-isysroot /Xcode3/SDKs/MacOSX10.5.sdk > -mmacosx-version-min=10.5' > paul$ python setup.py --librsync-dir=/sw build > running build > running build_py > running build_ext > building 'duplicity._librsync' extension > /Xcode3/usr/bin/gcc-4.0 -DNDEBUG -g -O3 -isysroot > /Xcode3/SDKs/MacOSX10.5.sdk -mmacosx-version-min=10.5 -arch ppc -arch > i386 -I/sw/include > -I/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 > -c duplicity/_librsyncmodule.c -o > build/temp.macosx-10.3-fat-2.7/duplicity/_librsyncmodule.o > /Xcode3/usr/bin/gcc-4.0 -bundle -undefined dynamic_lookup -g -isysroot > /Xcode3/SDKs/MacOSX10.5.sdk -mmacosx-version-min=10.5 -arch ppc -arch > i386 build/temp.macosx-10.3-fat-2.7/duplicity/_librsyncmodule.o > -L/sw/lib -lrsync -o build/lib.macosx-10.3-fat-2.7/duplicity/_librsync.so > ld: warning in /sw/lib/librsync.dylib, file is not of required > architecture > running build_scripts > creating build/scripts-2.7 > copying and adjusting bin/rdiffdir -> build/scripts-2.7 > copying and adjusting bin/duplicity -> build/scripts-2.7 > changing mode of build/scripts-2.7/rdiffdir from 644 to 755 > changing mode of build/scripts-2.7/duplicity from 644 to 755 > > Perhaps its the warning librsync.dylib is not of required > architecture, which I guess is missing ppc. Any ideas how I can > resolve that? I don't know how to drive fink, but presumably you can tell it to enable ppc builds. The fink mailing list? What is reported by: $ file /sw/lib/librsync.dylib -------------- next part -------------- An HTML attachment was scrubbed... URL: From poalman at gmail.com Tue Sep 18 14:11:48 2012 From: poalman at gmail.com (Paul Wiseman) Date: Tue, 18 Sep 2012 13:11:48 +0100 Subject: [Pythonmac-SIG] ImportError, no suitable image found (app not running under 10.5) In-Reply-To: <50585B49.7030407@bcs.co.nz> References: <5057920D.9030806@bcs.co.nz> <50585B49.7030407@bcs.co.nz> Message-ID: On 18 September 2012 12:30, David Brooks wrote: > > On 18/09/12 8:51 PM, Paul Wiseman wrote: > > On 17 September 2012 22:11, David Brooks wrote: > >> >> On 18/09/12 6:03 AM, Paul Wiseman wrote: >> >> On 17 September 2012 18:13, Paul Wiseman wrote: >> >>> This app runs fine on 10.6 and 10.7, but when I run it on 10.5 I an >>> apple error report, and the following error in console >>> >>> Traceback (most recent call last): >>> >>> ImportError: >>> dlopen(/Applications/TestApp.app/Contents/Resources/lib/python2.7/lib-dynload/_librsync.so, >>> 2): Library not loaded: @executable_path/../Frameworks/librsync.1.dylib >>> Referenced from: >>> /Applications/TestApp.app/Contents/Resources/lib/python2.7/lib-dynload/_librsync.so >>> Reason: no suitable image found. Did find: >>> >>> /Applications/TestApp.app/Contents/MacOS/../Frameworks/librsync.1.dylib: >>> unknown required load command 0x80000022 >>> >>> /Applications/TestApp.app/Contents/MacOS/../Frameworks/librsync.1.dylib: >>> unknown required load command 0x80000022 >>> TestApp Error >>> ([0x0-0x1e01e].org.pythonmac.unspecified.TestApp[342]) Exited >>> abnormally: Bus error >>> >>> I searched around and found this, >>> http://www.riverbankcomputing.com/pipermail/pyqt/2009-November/025098.htmlalthough I think it might be specific to compiling pyqt and this solution >>> http://www.riverbankcomputing.com/pipermail/pyqt/2011-June/029975.htmlbut not really sure if it applies to my case or not. >>> >>> I have both Xcode 3 and 4 installed and I have the 10.5 SDK, I'm just >>> not sure about how I can compile the extensions I need to use it? >>> >> >> >> Just did file on the librsync.1.dylib and it only supports i386 which I >> guess is the problem. Any idea why this wouldn't have been built with ppc >> like the so was? >> >> I've tried building again with -isysroot /Xcode3/SDKs/MacOSX10.5.sdk >> -mmacosx-version-min=10.5 CFLAGS but doesn't seem to help >> >> When and how did you install librsync?? Manually or using Brew, >> MacPorts, or Fink? What about re-installing and setting whatever options >> are needed to include the PPC architecture? >> > > I downloaded the librsync source using fink, but installed duplicity for > the python extension. This is how I installed duplicity, it looks as if it > should be building for ppc, maybe its the targeting 10.5 that isn't working > though? > > paul$ export CC='/Xcode3/usr/bin/gcc-4.0' > paul$ export ARCHFLAGS='-arch ppc -arch i386' > paul$ export CFLAGS='-isysroot /Xcode3/SDKs/MacOSX10.5.sdk > -mmacosx-version-min=10.5' > paul$ python setup.py --librsync-dir=/sw build > running build > running build_py > running build_ext > building 'duplicity._librsync' extension > /Xcode3/usr/bin/gcc-4.0 -DNDEBUG -g -O3 -isysroot > /Xcode3/SDKs/MacOSX10.5.sdk -mmacosx-version-min=10.5 -arch ppc -arch i386 > -I/sw/include > -I/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c > duplicity/_librsyncmodule.c -o > build/temp.macosx-10.3-fat-2.7/duplicity/_librsyncmodule.o > /Xcode3/usr/bin/gcc-4.0 -bundle -undefined dynamic_lookup -g -isysroot > /Xcode3/SDKs/MacOSX10.5.sdk -mmacosx-version-min=10.5 -arch ppc -arch i386 > build/temp.macosx-10.3-fat-2.7/duplicity/_librsyncmodule.o -L/sw/lib > -lrsync -o build/lib.macosx-10.3-fat-2.7/duplicity/_librsync.so > ld: warning in /sw/lib/librsync.dylib, file is not of required architecture > running build_scripts > creating build/scripts-2.7 > copying and adjusting bin/rdiffdir -> build/scripts-2.7 > copying and adjusting bin/duplicity -> build/scripts-2.7 > changing mode of build/scripts-2.7/rdiffdir from 644 to 755 > changing mode of build/scripts-2.7/duplicity from 644 to 755 > > Perhaps its the warning librsync.dylib is not of required architecture, > which I guess is missing ppc. Any ideas how I can resolve that? > > I don't know how to drive fink, but presumably you can tell it to enable > ppc builds. The fink mailing list? What is reported by: > > $ file /sw/lib/librsync.dylib > > That is i386 only, which will be problem a problem if I run ppc but I don't know why I get an import error on i386 10.5 maybe it's two different problems. I'm thinking I might need to pass the -isysroot and -mmacosx-version-min flags to fink when it builds librsync, but currently fink doesn't work saying I need to install Developer tools, despite having Xcode 3 and 4 installed. -------------- next part -------------- An HTML attachment was scrubbed... URL: From michael.mccracken at gmail.com Thu Sep 20 00:31:24 2012 From: michael.mccracken at gmail.com (Michael McCracken) Date: Wed, 19 Sep 2012 15:31:24 -0700 Subject: [Pythonmac-SIG] packaged .app creating site.pyo and others, breaking code signature Message-ID: I've been getting occasional issues where my code signature is invalid because python has written .pyo files inside the app bundle. Specifically it's writing UbuntuOne.app/Contents/Resources/site.pyo and a bunch of files in the one package that isn't included in my .zip, for example: UbuntuOne.app/Contents/Resources/lib/python2.7/configglue/schema.pyo This is confusing, because I'm not setting 'optimize' in the py2app options. I looked into the py2app bundle template, and I see in main.c where it sets PYTHONOPTIMIZE based on the info.plist PyOptions dict. My Info.plist has optimize = 0, and if I print os.environ in my main script, I see 'PYTHONOPTIMIZE': '0'. OK, so then I print sys.flags immediately afterwards, just as a sanity check, and I get this: sys.flags(debug=0, py3k_warning=0, division_warning=0, division_new=0, inspect=0, interactive=0, optimize=1, dont_write_bytecode=0, no_user_site=0, no_site=0, ignore_environment=0, tabcheck=0, verbose=0, unicode=0, bytes_warning=0, hash_randomization=0) Note the optimize=1. That looks like the culprit, but I'm kind of stumped as to where that's getting set. Any ideas? On a related note, I tried to set sys.dont_write_bytecode = True at the top of my main script, and it still writes the .pyo files. I imagine I could run the app once before signing it, but that's not ideal for automated builds. Thanks for any help, -mike From ronaldoussoren at mac.com Thu Sep 20 10:49:38 2012 From: ronaldoussoren at mac.com (Ronald Oussoren) Date: Thu, 20 Sep 2012 10:49:38 +0200 Subject: [Pythonmac-SIG] packaged .app creating site.pyo and others, breaking code signature In-Reply-To: References: Message-ID: <4BE34194-7BE1-4E0B-BE30-AFEB0087E605@mac.com> Micheal, Could you file an issue for the code-signing problem at https://bitbucket.com/ronaldoussoren/py2app? Py2app should gain better support for code signing, and should definitely generate output that can be signed without further post-processing steps. The optimization bug should be fixed in changeset '95e2b13d3867' (just pushed to the repository). Ronald On 20 Sep, 2012, at 0:31, Michael McCracken wrote: > I've been getting occasional issues where my code signature is invalid > because python has written .pyo files inside the app bundle. > > Specifically it's writing > > UbuntuOne.app/Contents/Resources/site.pyo > > and a bunch of files in the one package that isn't included in my > .zip, for example: > > UbuntuOne.app/Contents/Resources/lib/python2.7/configglue/schema.pyo > > This is confusing, because I'm not setting 'optimize' in the py2app options. > > I looked into the py2app bundle template, and I see in main.c where it > sets PYTHONOPTIMIZE based on the info.plist PyOptions dict. My > Info.plist has optimize = 0, and if I print os.environ in my main > script, I see 'PYTHONOPTIMIZE': '0'. > > OK, so then I print sys.flags immediately afterwards, just as a sanity > check, and I get this: > sys.flags(debug=0, py3k_warning=0, division_warning=0, division_new=0, > inspect=0, interactive=0, optimize=1, dont_write_bytecode=0, > no_user_site=0, no_site=0, ignore_environment=0, tabcheck=0, > verbose=0, unicode=0, bytes_warning=0, hash_randomization=0) > > Note the optimize=1. That looks like the culprit, but I'm kind of > stumped as to where that's getting set. Any ideas? > > On a related note, I tried to set sys.dont_write_bytecode = True at > the top of my main script, and it still writes the .pyo files. > > I imagine I could run the app once before signing it, but that's not > ideal for automated builds. > > Thanks for any help, > -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 -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 4788 bytes Desc: not available URL: From irving at naml.us Fri Sep 21 21:36:14 2012 From: irving at naml.us (Geoffrey Irving) Date: Fri, 21 Sep 2012 12:36:14 -0700 Subject: [Pythonmac-SIG] uniformative Error when launching app Message-ID: I am trying to package up a mixed Python/C++ application using py2app. My setup.py is from setuptools import setup setup(app=['voxpopuli.py'],data_files=[],options= {'py2app'{'argv_emulation':True}},setup_requires=['py2app']) and I invoke py2app via python setup.py py2app --no-strip --iconfile /Users/irving/otherlab/other/bin/OLicon.icns --resources /opt/local/lib/Resources/qt_menu.nib This completes without warnings or errors, but when I try to run the resuling app a window pops up that simply says "voxpopuli Error". It has an "Open Console" button, but the only console messages are 9/21/12 11:43:14.691 AM voxpopuli[52765]: voxpopuli Error 9/21/12 11:43:15.926 AM com.apple.launchd.peruser.501[158]: ([0x0-0x177d77c].org.pythonmac.unspecified.voxpopuli[52765]) Exited with code: 255 Are there standard ways to get more information out of py2app to help diagnosing this error? Thanks, Geoffrey From ronaldoussoren at mac.com Mon Sep 24 09:21:10 2012 From: ronaldoussoren at mac.com (Ronald Oussoren) Date: Mon, 24 Sep 2012 09:21:10 +0200 Subject: [Pythonmac-SIG] uniformative Error when launching app In-Reply-To: References: Message-ID: <788DB257-EBDE-426F-BC05-8EF83CD97C03@mac.com> On 21 Sep, 2012, at 21:36, Geoffrey Irving wrote: > I am trying to package up a mixed Python/C++ application using py2app. > My setup.py is > > from setuptools import setup > setup(app=['voxpopuli.py'],data_files=[],options= > {'py2app'{'argv_emulation':True}},setup_requires=['py2app']) > > and I invoke py2app via > > python setup.py py2app --no-strip --iconfile > /Users/irving/otherlab/other/bin/OLicon.icns --resources > /opt/local/lib/Resources/qt_menu.nib > > This completes without warnings or errors, but when I try to run the > resuling app a window pops up that simply says "voxpopuli Error". It > has an "Open Console" button, but the only console messages are > > 9/21/12 11:43:14.691 AM voxpopuli[52765]: voxpopuli Error > 9/21/12 11:43:15.926 AM com.apple.launchd.peruser.501[158]: > ([0x0-0x177d77c].org.pythonmac.unspecified.voxpopuli[52765]) Exited > with code: 255 > > Are there standard ways to get more information out of py2app to help > diagnosing this error? You can run the application from the commandline as "voxpopuli.app/Contents/MacOS/voxpopuli" and that should print the script output to the terminal window. Ronald > > Thanks, > Geoffrey > _______________________________________________ > 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 irving at naml.us Mon Sep 24 18:39:49 2012 From: irving at naml.us (Geoffrey Irving) Date: Mon, 24 Sep 2012 09:39:49 -0700 Subject: [Pythonmac-SIG] uniformative Error when launching app In-Reply-To: <788DB257-EBDE-426F-BC05-8EF83CD97C03@mac.com> References: <788DB257-EBDE-426F-BC05-8EF83CD97C03@mac.com> Message-ID: On Mon, Sep 24, 2012 at 12:21 AM, Ronald Oussoren wrote: > > On 21 Sep, 2012, at 21:36, Geoffrey Irving wrote: > >> I am trying to package up a mixed Python/C++ application using py2app. >> My setup.py is >> >> from setuptools import setup >> setup(app=['voxpopuli.py'],data_files=[],options= >> {'py2app'{'argv_emulation':True}},setup_requires=['py2app']) >> >> and I invoke py2app via >> >> python setup.py py2app --no-strip --iconfile >> /Users/irving/otherlab/other/bin/OLicon.icns --resources >> /opt/local/lib/Resources/qt_menu.nib >> >> This completes without warnings or errors, but when I try to run the >> resuling app a window pops up that simply says "voxpopuli Error". It >> has an "Open Console" button, but the only console messages are >> >> 9/21/12 11:43:14.691 AM voxpopuli[52765]: voxpopuli Error >> 9/21/12 11:43:15.926 AM com.apple.launchd.peruser.501[158]: >> ([0x0-0x177d77c].org.pythonmac.unspecified.voxpopuli[52765]) Exited >> with code: 255 >> >> Are there standard ways to get more information out of py2app to help >> diagnosing this error? > > You can run the application from the commandline as "voxpopuli.app/Contents/MacOS/voxpopuli" and that should print the script output to the terminal window. When I do that the app runs fine with no errors or warnings. Geoffrey From ronaldoussoren at mac.com Mon Sep 24 19:02:08 2012 From: ronaldoussoren at mac.com (Ronald Oussoren) Date: Mon, 24 Sep 2012 19:02:08 +0200 Subject: [Pythonmac-SIG] uniformative Error when launching app In-Reply-To: References: <788DB257-EBDE-426F-BC05-8EF83CD97C03@mac.com> Message-ID: <1A349C05-4170-48A9-8AD3-C1CCF6739999@mac.com> On 24 Sep, 2012, at 18:39, Geoffrey Irving wrote: > On Mon, Sep 24, 2012 at 12:21 AM, Ronald Oussoren > wrote: >> >> On 21 Sep, 2012, at 21:36, Geoffrey Irving wrote: >> >>> I am trying to package up a mixed Python/C++ application using py2app. >>> My setup.py is >>> >>> from setuptools import setup >>> setup(app=['voxpopuli.py'],data_files=[],options= >>> {'py2app'{'argv_emulation':True}},setup_requires=['py2app']) >>> >>> and I invoke py2app via >>> >>> python setup.py py2app --no-strip --iconfile >>> /Users/irving/otherlab/other/bin/OLicon.icns --resources >>> /opt/local/lib/Resources/qt_menu.nib >>> >>> This completes without warnings or errors, but when I try to run the >>> resuling app a window pops up that simply says "voxpopuli Error". It >>> has an "Open Console" button, but the only console messages are >>> >>> 9/21/12 11:43:14.691 AM voxpopuli[52765]: voxpopuli Error >>> 9/21/12 11:43:15.926 AM com.apple.launchd.peruser.501[158]: >>> ([0x0-0x177d77c].org.pythonmac.unspecified.voxpopuli[52765]) Exited >>> with code: 255 >>> >>> Are there standard ways to get more information out of py2app to help >>> diagnosing this error? >> >> You can run the application from the commandline as "voxpopuli.app/Contents/MacOS/voxpopuli" and that should print the script output to the terminal window. > > When I do that the app runs fine with no errors or warnings. That's annoying. You could try to redirect sys.stdout/sys.stderrr to see that provides more information. There is a __boot__.py file in the bundle that is loaded early during startup of the application, adding lines like these should redirect that output to a temporary file: import sys sys.stdout = open('/tmp/program.out', 'w') sys.stderr = open('/tmp/program.err', 'w') Ronald > > Geoffrey -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 4788 bytes Desc: not available URL: From poalman at gmail.com Mon Sep 24 21:38:00 2012 From: poalman at gmail.com (Paul Wiseman) Date: Mon, 24 Sep 2012 20:38:00 +0100 Subject: [Pythonmac-SIG] uniformative Error when launching app In-Reply-To: <1A349C05-4170-48A9-8AD3-C1CCF6739999@mac.com> References: <788DB257-EBDE-426F-BC05-8EF83CD97C03@mac.com> <1A349C05-4170-48A9-8AD3-C1CCF6739999@mac.com> Message-ID: On 24 September 2012 18:02, Ronald Oussoren wrote: > > On 24 Sep, 2012, at 18:39, Geoffrey Irving wrote: > > > On Mon, Sep 24, 2012 at 12:21 AM, Ronald Oussoren > > wrote: > >> > >> On 21 Sep, 2012, at 21:36, Geoffrey Irving wrote: > >> > >>> I am trying to package up a mixed Python/C++ application using py2app. > >>> My setup.py is > >>> > >>> from setuptools import setup > >>> setup(app=['voxpopuli.py'],data_files=[],options= > >>> {'py2app'{'argv_emulation':True}},setup_requires=['py2app']) > >>> > >>> and I invoke py2app via > >>> > >>> python setup.py py2app --no-strip --iconfile > >>> /Users/irving/otherlab/other/bin/OLicon.icns --resources > >>> /opt/local/lib/Resources/qt_menu.nib > >>> > >>> This completes without warnings or errors, but when I try to run the > >>> resuling app a window pops up that simply says "voxpopuli Error". It > >>> has an "Open Console" button, but the only console messages are > >>> > >>> 9/21/12 11:43:14.691 AM voxpopuli[52765]: voxpopuli Error > >>> 9/21/12 11:43:15.926 AM com.apple.launchd.peruser.501[158]: > >>> ([0x0-0x177d77c].org.pythonmac.unspecified.voxpopuli[52765]) Exited > >>> with code: 255 > >>> > >>> Are there standard ways to get more information out of py2app to help > >>> diagnosing this error? > >> > >> You can run the application from the commandline as > "voxpopuli.app/Contents/MacOS/voxpopuli" and that should print the script > output to the terminal window. > > > > When I do that the app runs fine with no errors or warnings. > > That's annoying. You could try to redirect sys.stdout/sys.stderrr to see > that provides more information. There is a __boot__.py file in the bundle > that is loaded early during startup of the application, adding lines like > these should redirect that output to a temporary file: > > import sys > sys.stdout = open('/tmp/program.out', 'w') > sys.stderr = open('/tmp/program.err', 'w') > > Ronald > > > > > Geoffrey > > > _______________________________________________ > 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 > > It's usually caused by an unhandled exception. You should be able to write it out by overwriting sys.excepthook import sys import traceback def _excepthook(e,v,tb): with open("error.log","w") as error_log: error_log.write(str(e)) error_log.write(v) error_log.write("Traceback:\n"+"".join(traceback.format_tb(tb))) sys.excepthook= _excepthook -------------- next part -------------- An HTML attachment was scrubbed... URL: From lists+Pythonmac-SIG at hoech.org Tue Sep 25 17:53:30 2012 From: lists+Pythonmac-SIG at hoech.org (=?UTF-8?B?RmxvcmlhbiBIw7ZjaA==?=) Date: Tue, 25 Sep 2012 17:53:30 +0200 Subject: [Pythonmac-SIG] py2app - building under 10.6.8, running under 10.4? Message-ID: <5061D37A.90908@hoech.org> Hi, I'm getting the following error in console.log when I try to run my app which was built on OS X 10.6.8 under OS X 10.4: Traceback (most recent call last): File "/Applications/dispcalGUI/dispcalGUI.app/Contents/Resources/ __boot__.py", line 277, in _argv_emulation() File "/Applications/dispcalGUI/dispcalGUI.app/Contents/Resources/ __boot__.py", line 275, in _argv_emulation _run_argvemulator() File "/Applications/dispcalGUI/dispcalGUI.app/Contents/Resources/ __boot__.py", line 110, in _run_argvemulator carbon = _ctypes_setup() File "/Applications/dispcalGUI/dispcalGUI.app/Contents/Resources/ __boot__.py", line 65, in _ctypes_setup carbon.AEProcessEvent.restype = ctypes.c_int File "ctypes/__init__.pyc", line 366, in __getattr__ File "ctypes/__init__.pyc", line 371, in __getitem__ AttributeError: dlsym(0x101eb0, AEProcessEvent): symbol not found The software on the build system with OS X 10.6.8 is the following: python-2.6.6-macosx10.3 (from python.org) numpy-1.6.2-py2.6-python.org-macosx10.3 wxPython2.8-osx-unicode-2.8.12.1-universal-py2.6 py2app 0.6.4 I thought it should be possible to build an app that runs on OS X 10.4, too, but it only seems to run under OS X 10.6 and newer. -- Florian H?ch From ronaldoussoren at mac.com Wed Sep 26 20:29:06 2012 From: ronaldoussoren at mac.com (Ronald Oussoren) Date: Wed, 26 Sep 2012 20:29:06 +0200 Subject: [Pythonmac-SIG] py2app - building under 10.6.8, running under 10.4? In-Reply-To: <5061D37A.90908@hoech.org> References: <5061D37A.90908@hoech.org> Message-ID: <99920E1B-1026-4DD4-8879-26DB4CBE0EBC@mac.com> On 25 Sep, 2012, at 17:53, Florian H?ch wrote: > Hi, > > I'm getting the following error in console.log when I try to run my app > which was built on OS X 10.6.8 under OS X 10.4: > > Traceback (most recent call last): > File "/Applications/dispcalGUI/dispcalGUI.app/Contents/Resources/ > __boot__.py", line 277, in > _argv_emulation() > File "/Applications/dispcalGUI/dispcalGUI.app/Contents/Resources/ > __boot__.py", line 275, in _argv_emulation > _run_argvemulator() > File "/Applications/dispcalGUI/dispcalGUI.app/Contents/Resources/ > __boot__.py", line 110, in _run_argvemulator > carbon = _ctypes_setup() > File "/Applications/dispcalGUI/dispcalGUI.app/Contents/Resources/ > __boot__.py", line 65, in _ctypes_setup > carbon.AEProcessEvent.restype = ctypes.c_int > File "ctypes/__init__.pyc", line 366, in __getattr__ > File "ctypes/__init__.pyc", line 371, in __getitem__ > AttributeError: dlsym(0x101eb0, AEProcessEvent): symbol not found > > The software on the build system with OS X 10.6.8 is the following: > > python-2.6.6-macosx10.3 (from python.org) > numpy-1.6.2-py2.6-python.org-macosx10.3 > wxPython2.8-osx-unicode-2.8.12.1-universal-py2.6 > py2app 0.6.4 > > I thought it should be possible to build an app that runs on OS X 10.4, > too, but it only seems to run under OS X 10.6 and newer. I've looked at the header files and indeed, the function AEProcessEvent is only available on OSX 10.5 or later. Does your appliction need the argv emulator? This is used to ensure that sys.argv has a value when you drop a file on your application (or double click on a file that is associated with your application). Ronald > > -- > Florian H?ch > > _______________________________________________ > 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 lists+Pythonmac-SIG at hoech.org Fri Sep 28 16:33:25 2012 From: lists+Pythonmac-SIG at hoech.org (=?ISO-8859-1?Q?Florian_H=F6ch?=) Date: Fri, 28 Sep 2012 16:33:25 +0200 Subject: [Pythonmac-SIG] py2app - building under 10.6.8, running under 10.4? In-Reply-To: <99920E1B-1026-4DD4-8879-26DB4CBE0EBC@mac.com> References: <5061D37A.90908@hoech.org> <99920E1B-1026-4DD4-8879-26DB4CBE0EBC@mac.com> Message-ID: <5065B535.1090700@hoech.org> Am 26.09.2012 20:29, schrieb Ronald Oussoren: > > On 25 Sep, 2012, at 17:53, Florian H?ch wrote: > >> Hi, >> >> I'm getting the following error in console.log when I try to run my app >> which was built on OS X 10.6.8 under OS X 10.4: >> >> Traceback (most recent call last): >> File "/Applications/dispcalGUI/dispcalGUI.app/Contents/Resources/ >> __boot__.py", line 277, in >> _argv_emulation() >> File "/Applications/dispcalGUI/dispcalGUI.app/Contents/Resources/ >> __boot__.py", line 275, in _argv_emulation >> _run_argvemulator() >> File "/Applications/dispcalGUI/dispcalGUI.app/Contents/Resources/ >> __boot__.py", line 110, in _run_argvemulator >> carbon = _ctypes_setup() >> File "/Applications/dispcalGUI/dispcalGUI.app/Contents/Resources/ >> __boot__.py", line 65, in _ctypes_setup >> carbon.AEProcessEvent.restype = ctypes.c_int >> File "ctypes/__init__.pyc", line 366, in __getattr__ >> File "ctypes/__init__.pyc", line 371, in __getitem__ >> AttributeError: dlsym(0x101eb0, AEProcessEvent): symbol not found >> >> The software on the build system with OS X 10.6.8 is the following: >> >> python-2.6.6-macosx10.3 (from python.org) >> numpy-1.6.2-py2.6-python.org-macosx10.3 >> wxPython2.8-osx-unicode-2.8.12.1-universal-py2.6 >> py2app 0.6.4 >> >> I thought it should be possible to build an app that runs on OS X 10.4, >> too, but it only seems to run under OS X 10.6 and newer. > > I've looked at the header files and indeed, the function AEProcessEvent is only available on OSX 10.5 or later. > > Does your appliction need the argv emulator? This is used to ensure that sys.argv has a value when you drop a file on your application (or double click on a file that is associated with your application). No, I don't need argv emulation. So, I should use the argv_emulation=False option? I'll try this later. -- Florian H?ch From ronaldoussoren at mac.com Fri Sep 28 18:18:54 2012 From: ronaldoussoren at mac.com (Ronald Oussoren) Date: Fri, 28 Sep 2012 18:18:54 +0200 Subject: [Pythonmac-SIG] py2app - building under 10.6.8, running under 10.4? In-Reply-To: <5065B535.1090700@hoech.org> References: <5061D37A.90908@hoech.org> <99920E1B-1026-4DD4-8879-26DB4CBE0EBC@mac.com> <5065B535.1090700@hoech.org> Message-ID: On 28 Sep, 2012, at 16:33, Florian H?ch wrote: > Am 26.09.2012 20:29, schrieb Ronald Oussoren: >> >> On 25 Sep, 2012, at 17:53, Florian H?ch wrote: >> >>> Hi, >>> >>> I'm getting the following error in console.log when I try to run my app >>> which was built on OS X 10.6.8 under OS X 10.4: >>> >>> Traceback (most recent call last): >>> File "/Applications/dispcalGUI/dispcalGUI.app/Contents/Resources/ >>> __boot__.py", line 277, in >>> _argv_emulation() >>> File "/Applications/dispcalGUI/dispcalGUI.app/Contents/Resources/ >>> __boot__.py", line 275, in _argv_emulation >>> _run_argvemulator() >>> File "/Applications/dispcalGUI/dispcalGUI.app/Contents/Resources/ >>> __boot__.py", line 110, in _run_argvemulator >>> carbon = _ctypes_setup() >>> File "/Applications/dispcalGUI/dispcalGUI.app/Contents/Resources/ >>> __boot__.py", line 65, in _ctypes_setup >>> carbon.AEProcessEvent.restype = ctypes.c_int >>> File "ctypes/__init__.pyc", line 366, in __getattr__ >>> File "ctypes/__init__.pyc", line 371, in __getitem__ >>> AttributeError: dlsym(0x101eb0, AEProcessEvent): symbol not found >>> >>> The software on the build system with OS X 10.6.8 is the following: >>> >>> python-2.6.6-macosx10.3 (from python.org) >>> numpy-1.6.2-py2.6-python.org-macosx10.3 >>> wxPython2.8-osx-unicode-2.8.12.1-universal-py2.6 >>> py2app 0.6.4 >>> >>> I thought it should be possible to build an app that runs on OS X 10.4, >>> too, but it only seems to run under OS X 10.6 and newer. >> >> I've looked at the header files and indeed, the function AEProcessEvent is only available on OSX 10.5 or later. >> >> Does your appliction need the argv emulator? This is used to ensure that sys.argv has a value when you drop a file on your application (or double click on a file that is associated with your application). > > No, I don't need argv emulation. So, I should use the > argv_emulation=False option? I'll try this later. That's correct. Ronald > > -- > Florian H?ch > -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 4788 bytes Desc: not available URL: