Sublime Forum

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

#11

@Jackeroo, not sure what IDLE is but I haven’t seen it referred to in the book. The book is Python Crash Course 2nd Edtn. I have been writing print("") but it just says finished so assume I am doing something else wrong?!

0 Likes

#12

@deathaxe I have no idea what Terminus is. In the book it just says that if I have downloaded most recent version of Python (and downloaded to PATH) I won’t need to configure it with ST but it doesn’t seem to be the case

0 Likes

#13

You need to use my example. If you are coding what you write you are coding, you are printing nothing. A copy of your code would have been useful so we don’t have to play Twenty Questions here.
Stay away from Terminus until you have mastered Python basics.

0 Likes

#14

The code i’m writing in ST is: print(“Hello Python World!”) as per the example in the book. I have saved the file as hello_world.py in a python folder I’ve created on my desktop. I have tried to build this as python, python 3 and automatic. When build it just says Finished in 0.2s, not the print and time.

0 Likes

#15

Break your code (say by removing the last ) character) and then run the build again and paste the error diagnostic information from the output panel here.

0 Likes

#16

That’s the thing, if I type print(“Hello Python World” [removing )] I don’t get an error, i still just get Finished 0.2 seconds

0 Likes

Beginner syntax errors while teaching myself Python3
#17

Well then, whatever it’s doing, it’s not executing your Python code at all. I would double check that you’re definitely selecting Python when you’re being asked.

Something to try would be to use Tools > Build System > New Build System from the menu, which will open up a stub build system. Replace the entire content of that file with this:

{
	"shell_cmd": "python -u \"$file\"",
	"file_regex": "^[ ]*File \"(...*?)\", line ([0-9]*)",
	"selector": "source.python",

	"env": {"PYTHONIOENCODING": "utf-8"},

	"variants":
	[
		{
			"name": "Syntax Check",
			"shell_cmd": "python -m py_compile \"${file}\"",
		}
	]
}

Save the file in the location that Sublime will default to, and name it something really obvious, like I am definitely python.sublime-build.

Once you do that, either set the build system to Automatic and choose Tools > Build With and select the build with this name, or select it directly from the menu. Then use that to build your program and see what happens.

2 Likes

#18

Thank you. I have done exactly that and I am still getting ‘finished in 0.2s’. I did read on one of these feeds that Windows requires a double \, should I try that with the above as it appears still not to be working?!

0 Likes

#19

The above build system will work on any system regardless of what OS it is; it only requires that you’ve installed Python.

At this point, without seeing exactly the code that you’re trying to build and some screenshots or a screencast of how you’re attempting to run the thing, it’s hard to say what might be going wrong for you here.

0 Likes

#20

The code I’m trying to run is really simple - its print(“Hello Python World!”) after saving a file in a python work folder on my desktop called hello_world.py and building it with the new build system as per your earlier message. When i build it it just says finished in 0.2s. I really have no idea. I’ve installed Python 3.8 (32-bit)

0 Likes

#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