[Twisted-Python] Trying to get twisted.protocols.amp to work with py2app...

glyph at divmod.com glyph at divmod.com
Tue Mar 4 02:13:17 MST 2008


On 04:11 am, nathan.stocks at gmail.com wrote:
>I'm on a MacBook Pro running OS X 10.5.2 using py2app installed with
>the "easy" method in the py2app install docs.  I'm trying to package a
>little pyglet+twisted (pyglet.org, twistedmatrix.com) project that I'm
>working on, and it _mostly_ works, except it keeps giving me the
>following error when I try to run the resulting app:
>
>ImportError: No module named amp

AMP itself isn't doing anything clever that I can see would confuse 
py2app.  It's just a regular Python module with regular imports; no 
dynamic module loading; in fact, it's much less interesting than the 
core parts of Twisted which load various plugins.

I don't have any experience with py2app, but I can guess at the problem 
- I know that OS X 10.5 ships with an incomplete installation of Twisted 
in some system location.  Perhaps you've installed a complete version of 
Twisted elsewhere, but py2app is confused about the ordering of sys.path 
that you want, and is including the system location first.  I am not 
aware of how this installation is incomplete - maybe it doesn't include 
AMP?

However, this is only a vague understanding, I don't have a MacOS Python 
environment readily available to test with.  Twisted might actually be 
packaged inside one of Apple's application, not on the system path, so 
this could be a red herring.  Good luck investigating though, and please 
let us know your results when you discover what's going on!




More information about the Twisted-Python mailing list