Sublime Forum

New user - [WinError 2] The system cannot find the file specified

#21

This is a screenshot of the build using the New Build system I created as per your code above (hopefully uploaded). Although any code i look at throught several feeds all produce the same ‘finished 0.2s’ output. So I’m thinking I must have missed something fairly simple.

0 Likes

#22

Have you selected the build system? Under the menu Tools > Build System > Iampythonbuild.

0 Likes

#23

Yes, Well I’m pretty sure I am. Will add a screenshot of build code and also one selecting that code in the build system. I then saved a file .py as above screenshot and type that code and just get the ‘finished 0.2s’ so not sure what I am doing wrong

0 Likes

#24

It looks like you’ve set up the build system to only check for syntax errors.

0 Likes

#25

If you do ctrl+shift+b and select the IamPythonbuild, not the IamPythonbuild - Syntax Check, it should work.

0 Likes

#26

Thank you. It looks like it’s already selected but I could be doing something wrong. Selected it and the box disappears. I then build the system again and still get the same output.

0 Likes

#27

Save your file before running the build.

0 Likes

#28

I have done that. Still getting the same. Save it in a folder I have created on my desktop as hello_world.py then write the code and run…

0 Likes

#29

That file is not saved. The round icon next to the name on the tab indicates that it hasn’t been saved.

0 Likes

#30

I would not waste time with this clown. He is playing us for fools. The only way he could get the results he does is if he saves an empty Python file and executes it. The screenshot is doctored.
You will note that this wasn’t the original problem.

0 Likes

#31

I’m a bit confused. Is the issue that the file isn’t saved? If so, I’m confused as to why it hasn’t saved

0 Likes

#32

How are you saving the file? You should be using the menu or pressing ctrl+s before running the build.

0 Likes

#33

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!

0 Likes

#34

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.

0 Likes

#35

That makes sense. Thank you so much for your help so far.

0 Likes

#36

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.

0 Likes

#37

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.

0 Likes

#38

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.

0 Likes

#39

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.

0 Likes

#40

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.

0 Likes