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

Phil Christensen phil at bubblehouse.org
Tue Mar 4 19:39:22 EST 2008


On Mar 4, 2008, at 6:50 PM, Nathan wrote:

>>> Maybe when you actually run the .app it's finding the system- 
>>> installed
>>> version of Twisted?
>>>
>> And the canonical way to locate that problem would be to add  
>> something
>>  like:
>>
>>  import twisted.protocols
>>  print twisted.protocols.__file__
>>
>>  to your app, to see from where the twisted package is coming.
>>
>
> Now we're getting somewhere!  Yes, even though py2app seems to be
> pulling in my Twisted 2.5 from /Library/Python/2.5/site-packages when
> the app is built, when the app is actually run it's finding the
> Leopard-default-installed Twisted 2.4 instead:
>
> /System/Library/Frameworks/Python.framework/Versions/2.5/Extras/lib/ 
> python/twisted/protocols/__init__.pyc
>
> So, the next logical question would be:  How do I get my script inside
> my .app to consider the libraries inside the .app first?  You'd think
> that py2app would already be taking care of that...

This is a little inelegant (maybe even a lot inelegant), but when  
i've had issues with the system path that I couldn't fix (because I  
didn't have root, or was just in a hurry), I've just manipulated  
sys.path at the start of my code before I've imported any modules.

-phil




More information about the Twisted-Python mailing list