Sublime Forum

First timer with Sublime - Python


I’ve recently switched from using textmate to Sublime text, and I am absolutely loving it. I still have much to learn when it comes to hardcore coding and text editors :smile:

I’m having a problem when it comes to compiling python code within sublime itself; when I build the code it comes up with this error:

/usr/bin/python: can't find '__main__' module in '' [Finished in 0.2s with exit code 1]

I’m afraid I don’t have a clue as to what this exactly means. I’ve tried installing a new python and running the Update Shell Profile script, but this error still shows up.

I am expecting “Hello World” to print in the dialogue box below when I run print “Hello World”, is building of the code supposed to act as the output, or is that a job for the interpreter?



Having the same issue. I’ve never been able to get a simple Python script to run with Sublime Text 2… and I really want to use it for Python :frowning:

Running OS X Mountain Lion.



Guys, seems like you need to save ur file anywhere before build it. If it doesn’t help try to add this location to python path. This solution working for me on linux.



That worked for me, thanks. Would be nice if it could run without saving though, like BBEdit. Sometimes I just want to bring up a text editor and try out a sample of code.



What do you mean by