How are you saving the file? You should be using the menu or pressing ctrl+s
before running the build.
New user - [WinError 2] The system cannot find the file specified
Perfect. It has worked. I didn’t realise I had to save the file again after I had written the code and before building it. It has worked, finally. Thank you for your help all!
If you make sure that there’s a check mark next to Tools > Save all on build
then every time you run a build, all unsaved files will be saved automatically. Note that this only applies to files that already have a name on disk.
That is; you can’t create a new tab, write code, and then build without saving the file at least once.
Things to keep in mind: When you execute a build, you’re asking Sublime to ask some external program to do something. Whatever the external program is, it has no way whatsoever to know what’s appearing inside of your Sublme Text window (it doesn’t even care if you’re using Sublime, or Notepad, or whatever else to write your code).
So, if you don’t save your file, whatever that external tool is, it’s not going to have any clue what you’re trying to do and will almost certainly do not what you want/need/expect if you don’t save the file first.
I am reading the same book as OP and had the exact same problem. In my book, it says to type:
{
“cmd”: [“python3”, “-u”, “$file”],
}
I did this, and followed the same directions to save it as a new build system.It did not work.
I don’t understand. Why did mine not work? and why did yours work? Thank you.
What do you mean by didn’t work? Did it not allow you to save the build, or did the build generate the error about not being able to find the file specified?
If it’s the latter, the most common reason for that is that python3
isn’t available anywhere in your OS’s PATH
environment variable. You can confirm whether that’s the case or not by opening up a terminal and entering python3
in it. If that works, then there’s something else going on, but if it doesn’t then the reason is your OS doesn’t know where python3
is installed.
How you resolve that depends on what OS you’re on.
I’m sorry, but is there anyways you can dumb this down anymore? I’m extremely slow. Computers are entirely new to me.I just learned how to open zip files a month ago. I want to learn python, and I’ve been studying aggressively, but I just don’t understand even the basic vocabulary you are using.
If you can give the exact steps you followed (like how you saved, where you saved, how did you use it etc), it can be better understood on how to solve your issue.
Thanks, I was facing the same build issue, after replacing the build file content it worked. Please can you explain what are the details in the code that you have provided, I am really new to Python and ST.
Hello I am completely new to Sublime and just installed sublime 4 and I keep finding this error…
[WinError 2] The system cannot find the file specified
[cmd: [‘py’, ‘-u’, ‘C:\Users\18184\Sublime Projects\firstgame.py’]]
[dir: C:\Users\18184\Sublime Projects]
[path: C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0;C:\WINDOWS\System32\OpenSSH;C:\Program Files\Intel\WiFi\bin;C:\Program Files\Common Files\Intel\WirelessCommon;C:\Users\18184\AppData\Local\Microsoft\WindowsApps;]
[Finished]
…I tried to create a new path but that didn’t do anything. Can someone please help me with this?
Have you installed Python on your system? According to your PATH
it’s not present. The installer for Python has a check box you can enable that will have it update the PATH
for you.
sir i am new sublime user getting error of the the system cannot find the file specified while writing the code in c++ please
Can you provide more details, like the exact build system content you’re using and the full diagnostic output in the build panel (just the error message itself is not helpful is diagnosing why it’s happening).