Using cmd+B
(Tools -> Build) in Sublime Text 2, the following error message appears:
/usr/bin/python: can't find '__main__' module in ''
How to solve this?
Using cmd+B
(Tools -> Build) in Sublime Text 2, the following error message appears:
/usr/bin/python: can't find '__main__' module in ''
How to solve this?
You probably missed saving the file you are trying to run.
If this does not resolve the problem, try creating a file named __main__.py
in the same program directory. Within it, import
of the file you want to run.
Ex: Assuming that the program you want to run is in the meuscript.py
file, the contents of __main.py__
would look like this:
import meuscript
In general this problem can be solved by saving the script before running it.