Hi,
I have some python code that runs fine if I execute it from the terminal. If I run it from within textmat (cmd-R) I get this error:
IOError: 2, No such file or directory
function main in AMODConv_pathLaufen.py at line 198 t3 = t2.astimezone(pytz.timezone(pytz.country_timezones('de')[0])) function country_timezones in __init__.py at line 202 zone_tab = open(os.path.join(os.path.dirname(__file__), 'zone.tab')) Program exited with code #1 after 2.05 seconds.
I guess it has to do with the pytz module? But why does it run on the terminal? Can there be a difference between running python on the terminal vs. from within TextMate? I am running OS X 10.5.6, TextMate 1.5.8(1498)
TextMate does find the pytz module - at least it displays the pytz module help after hitting F3.
Thanks for your help, Claus
On 3 Mar 2009, at 17:33, Claus wrote:
I have some python code that runs fine if I execute it from the terminal. If I run it from within textmat (cmd-R) I get this error:
IOError: 2, No such file or directory [...] I guess it has to do with the pytz module?
It looks like a run-time error from the script trying to open a time zone file or similar.
But why does it run on the terminal? Can there be a difference between running python on the terminal vs. from within TextMate?
Yes, the environments (shown via the ‘env’ command) can differ in many ways, in your case it could be that TZ is setup differently for the Terminal than TextMate, or maybe it is related to the LC variables…
Can you provide a small example which reproduce the problem?