In ST4, the default build system for Python changed so that instead of invoking python
it invokes python3
(on Linux/MacOS) and py
(on Windows).
The idea here is that there’s a checkbox that you have to check when you install Python on windows to get the installer to update the PATH
so that the command prompt (and thus Sublime) can see and run the Python interpreter, but this is not checked by default.
On Windows, the Python setup program will also install a program named py
into the Windows folder, which is a helper that will find and execute the correct version of Python automagically. There’s a checkbox for this as well, but it defaults to being checked.
Your error diagnostic indicates that you’re running the newer build (py
is being executed) but it can’t be found and also the PATH
as displayed in the output doesn’t include the Python install location either. From that I would guess that when you installed Python, the py
helper box was not checked.
As a test, you could try running py
from a command prompt outside of Sublime to see if that works, but failing that the way forward would be to manually update the PATH
to include the install location of Python and then make a custom sublime-build
file that executes python
instead of py
, or reinstalling Python and ensuring that the checkbox for the py
helper is checked.
This video also talks about this, and includes at the end a quick tutorial on how you can create a custom build based off of the existing one. Here you would use something like this to change the windows command to python
from py
after you update the PATH
.