sublime-build
files are JSON files, but the content of the file that you’re using is not valid JSON because the double quote characters are the “fancy” curly-quotes that curve inward instead of being straight "
characters, which is not valid JSON. Additionally the file_regex
is broken because the "
character after File
is ending the string; you need to use \"
inside of a string to represent a double quote character inside of the string itself.
When the sublime-build
file is not valid JSON, Sublime can’t decode it properly. It doesn’t display any explicit error message when this happens, but when it tries to access the build information it can’t and as a result it says No build system
in the status bar (which is technically correct but not overly helpful).
A fixed version would be something like this:
{
"shell_cmd": "python3 -u \"$file\"",
"file_regex": "^[ ]*File \"(...*?)\", line ([0-9]*)",
"selector": "source.python",
"env": {"PYTHONIOENCODING": "utf-8"},
"variants":
[
{
"name": "Syntax Check",
"shell_cmd": "python3 -m py_compile \"${file}\"",
}
]
}
This is a duplicate of the Python.sublime-build
that ships with Sublime, but altered to run python3
instead of python
. If you replace the contents of the file created with this one, it should do what you want.