From: Alex Ross alex.j.ross@gmail.com Date: December 19, 2007 8:08:51 PM EST To: TextMate users textmate@lists.macromates.com Subject: Re: [TxMt] Python Import Reply-To: TextMate users textmate@lists.macromates.com
Tony,
Have you made any modifications to your PYTHONPATH?
Hey Alex,
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.
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.
Thanks, -Tony
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
On Dec 21, 2007, at 2:08 AM, Alex Ross wrote:
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?
Sweet! This fixed the problem.
Neither sys.path (in Textmate and Terminal) have path to PyObjC listed. When I add this path to my PYTHONPATH, I'm able to import objc in Textmate. This doesn't explain why I was able to import objc in the Terminal window before, but I'm happy that this is atleast working.
Thanks again Alex!