Sublime Forum

Can't build a file after installing a newer version of Sublime Text


After installing a newer version of Sublime Text I can’t build any of my previous files. These all were working (building, etc) under previous version. The traceback is :

[WinError 2] The system cannot find the file specified
[cmd: [‘py’, ‘-u’, ‘C:\Users\shirl\Documents\JAS docs\Programming\Python\python_work\’]]
[dir: C:\Users\shirl\Documents\JAS docs\Programming\Python\python_work]
[path: C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0;C:\Windows\System32\OpenSSH;C:\Program Files (x86)\Intel\Intel® Management Engine Components\DAL;C:\Program Files\Intel\Intel® Management Engine Components\DAL;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files\NVIDIA Corporation\NVIDIA NvDLISR;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0;C:\WINDOWS\System32\OpenSSH;C:\Users\shirl\Documents\JAS docs\Programming\Python\python_work;C:\Users\shirl\AppData\Local\Microsoft\WindowsApps;C:\Users\shirl\AppData\Local\Programs\MiKTeX\miktex\bin\x64;]
Can you help me?



In Sublime Text 3 the default Python build system executed python, but in Sublime Text 4 it uses py instead. py is a helper that Python installs directly into the Windows directory that knows where to find Python and execute it even if it’s not on the PATH.

The most common reason for Python builds suddenly failing when switching to ST4 is using an alternate distribution of Python that doesn’t come with the py helper (for examine miniconda) or having an installed Python version that didn’t install the helper.

The first step is in determining if and how you can execute Python files manually from a command prompt; then you can create a customization on the default Python build that will still execute for you.



I was successful in running Python from the command prompt. What now? and thanks.



In that case you need to make an adjustment to the Python build system so that it matches the command that you executed from the command prompt.

The following video talks about the stuff I mentioned above any why things might work differently for you if you were using the default Python build system in ST3, and also shows how to create a new build based off of the existing one and tweak it to work the way you need.