[TxMt] Python Import

Alex Ross alex.j.ross at gmail.com
Fri Dec 21 07:08:54 UTC 2007


> Thanks for your quick reply. I have added a couple of folders to the  
> PYTHONPATH in my `.profile` configuration file in my home directory.
>
> PYTHONPATH=/Users/Tony/python:/Users/Tony/python/nodebox/src
>
> It turns out that if I comment out the nodebox source path from the  
> above statement, `import objc` works fine. Unfortunately, the reason  
> I wanted to import the objc module was because nodebox requires it  
> (and requires the source tree be on the PYTHONPATH). Does any one  
> know why things would work fine from a Terminal, but not Textmate.

Hmm... that's pretty weird.

What happens if you set

PYTHONPATH="/Users/Tony/python:/Users/Tony/python/nodebox/src: 
$PYTHONPATH"

> BTW, sys.path gives the same output in Textmate and the Terminal  
> window, except that Textmate appends the Textmate path and the  
> Desktop, while Terminal appends the present working directory.

Presumably '/System/Library/Frameworks/Python.framework/Versions/2.5/ 
Extras/lib/python/PyObjC' is on sys.path in both instances?

–Alex


More information about the textmate mailing list