Sublime Forum

No build file error

#1

I am a new python user. I am using the Python Crash course book as my guide. The book suggested using Sublime Text, so I did. I followed the book suggestions for configuring Sublime text to run on Mac. (Mac OS Catalina ver 10.15.2). All was well and I was able to run a few of the suggested snippets both in terminal mode and Sublime text. I used the option B to execute the snippets. However, I didn’t get back to using Sublime Text for a couple of weeks. Now I can’t run anything without getting the “No build file” error. Suggestions?

0 Likes

#2

You’ll see this error in a couple of different circumstances:

  1. The build system selector in Tools > Build System is set to Automatic, but Sublime can’t determine what build system you should be using to select

  2. The build system selector in Tools > Build System is set to a specific build system, but the sublime-build file associated with it is broken (i.e. it is not valid JSON, like a comma is missing somewhere, there is an invalid escape sequence, etc)

Since this used to work for you and now it doesn’t, my guess would be that #1 is triggering for you here; Sublime can’t automatically select the Python build system if the file that you’re trying to build isn’t Python. You can check by looking in the bottom right of the window in the status bar to verify that it says Python there and not something else (e.g. Plain text).

If that’s the case, saving your file as a .py file should clear the problem up for you.

0 Likes

#3

Thanks for the prompt comeback. I went back and redid my build file with careful attention to spaces and rebuilt it. This is what I am using:

Python3.sublime-build
{
“cmd”: [“python3”, “-u”, “$file”]
}

Everything appears AOK now. Thanks

0 Likes