The problem likely is as intimated by the error message that your python interpreter not called "/usr/local/bin/python3.1" but I'd offhand guess, probably "/usr/local/bin/python". (Indeed, you run the interpreter yourself as "python" not "python3.1" so you should not be using "python3.1" in your script header.)<br>
<br>To check, try:<br><br>John-Wilkinsons-iMac:~ wilkinson$ which python<br><br>Assuming you have the "which" command this will tell you which version of python is used then you do e.g. "python hello.py." Then change the hash-bang (#!) header in your script to match the location you found. (If you dont have "which", you can also try "whereis" or "env" or "type -a".)<br>
<br>Note, some people use the following hash-bang header in preference of a hard coded path as I've suggested above, as follows:<br><br>#!/usr/bin/env python<br><br>/usr/bin/env goes off and looks up the appropriate path for (in this case) the "python" interpreter, then passes control to that, thereby making your script a little less dependent on a hardcoded paths present on your system. This works provided of course that "env" is available and found in /usr/bin. (Thought I'd mention that in case you wanted to use that instead/try it.)<br>
<br>Disclaimer: I don't have a Mac, the above is basically general advice which should however work any Unix'ish or GNU'ish system, including I believe on the Mac providing Apple's not changed things that I'm not aware of.<br>
<br>Hope that helps<br><br>Walter<br><br><br>