On Jan 2, 2011, at 2:17 PM, Allan Odgaard wrote:
I am not familiar with how the environment can affect Python search paths, only know of the site_customize thing, but perhaps this is key?
The PYTHONPATH environment variable can also affect this, but it will only add to the directories that are already being searched, so something available by default (like the xml module) should still work. I have PYTHONPATH defined in the TextMate preferences, and the example script works for me as well.
One thing that comes to mind: The “Run Script” command in the Python bundle uses some logic to figure out where the `python` executable is. I believe it is completely ignoring `#!/usr/bin/python` on the first line of your script. Could it be finding another copy of Python elsewhere on your system?
I would try “running” each of these from within TextMate (type it on a line and hit ⌃R) and see what you get.
echo $TM_PYTHON
and
which python