Axiom and py2app

Robert Gravina <[email protected]> Fri, 6 Oct 2006 15:38:28 +0900
Newsgroups gmane.comp.python.quotient.dev
Message-ID <[email protected]>
Divmod guys,

I am just having some issues with creating an app bundle (using  
py2app) of my Axiom-powered app and wondering if you know what might  
be the problem.

The bundle runs fine on my development machine (in fact two separate  
development machines - presumably because they have everything the  
app needs installed), but when I try the bundle on other Macs  
(without python, twisted, etc.) the application throws this traceback.

Traceback (most recent call last):
   File "twisted/python/log.pyc", line 53, in callWithLogger
   File "twisted/python/log.pyc", line 38, in callWithContext
   File "twisted/python/context.pyc", line 59, in callWithContext
   File "twisted/python/context.pyc", line 37, in callWithContext
--- <exception caught here> ---
   File "twisted/internet/threadedselectreactor.pyc", line 299, in  
_doReadOrWrite
   File "twisted/internet/tcp.pyc", line 111, in doRead
   File "twisted/internet/tcp.pyc", line 348, in doRead
   File "twisted/spread/banana.pyc", line 184, in dataReceived
   File "twisted/spread/banana.pyc", line 114, in gotItem
   File "twisted/spread/banana.pyc", line 81, in callExpressionReceived
   File "twisted/spread/pb.pyc", line 559, in expressionReceived
   File "twisted/spread/pb.pyc", line 928, in proto_answer
   File "twisted/spread/pb.pyc", line 820, in unserialize
   File "twisted/spread/jelly.pyc", line 890, in unjelly
   File "twisted/spread/jelly.pyc", line 519, in unjellyFull
   File "twisted/spread/jelly.pyc", line 542, in unjelly
   File "twisted/spread/flavors.pyc", line 455, in unjellyFor
   File "salespipeline/model/remote.pyc", line 89, in setCopyableState
   File "/Library/Frameworks/Python.framework/Versions/2.4/lib/ 
python2.4/site-packages/axiom/store.py", line 533, in __init__
   File "/Library/Frameworks/Python.framework/Versions/2.4/lib/ 
python2.4/site-packages/axiom/store.py", line 693, in _initdb
   File "/Library/Frameworks/Python.framework/Versions/2.4/lib/ 
python2.4/site-packages/axiom/_pysqlite2.py", line 24, in  
fromDatabaseName
pysqlite2.dbapi2.ProgrammingError: library routine called out of  
sequence

The line it is referring to in my source  (File "salespipeline/model/ 
remote.pyc", line 89, in setCopyableState) is this:

         self.db = Store()

So it dies while trying to make an in-memory store. I'm not sure the  
problem is with my code, or something to do with the environment,  
Axiom or pysqlite.

Py2app creates a Mac app bundle from a python script by following all  
the imports and creating an application bundle which has a copy of  
python, all the required libraries, etc. that a user without python  
can simply double-click and run. This might be unrelated, but py2app  
works fine for all libraries (e.g. Twisted) except for Axiom. For  
some reason, it just doesn't include it. If I add Axiom as a required  
package in the options, it will include it (although it copies the  
files across rather than includes them in the site-packages.zip  
archive it creates, not sure if that makes a difference).

Does anyone have any ideas what the problem might be?

Thanks once again,

Robert