Sublime Forum

Building error

#1

when i try to build the code it prints this:

[WinError 2] The system cannot find the file specified
[shell_cmd: python -u “C:\Users\Gaming\OneDrive\Desktop\cartofia game\cartofia.py”]
[dir: C:\Users\Gaming\OneDrive\Desktop\cartofia game]
[path: C:\Program Files (x86)\Common Files\Intel\Shared Libraries\redist\intel64\compiler;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0;C:\WINDOWS\System32\OpenSSH;C:\Program Files (x86)\GtkSharp\2.12\bin;C:\Program Files (x86)\Windows Kits\10\Windows Performance Toolkit;C:\Program Files\dotnet;C:\Users\Gaming\AppData\Local\Programs\Python\Python39\Scripts;C:\Users\Gaming\AppData\Local\Programs\Python\Python39;C:\Users\Gaming\AppData\Local\Microsoft\WindowsApps;C:\Users[Gaming]\AppData\Local\Programs\Python;C:\Users\Gaming.dotnet\tools]
[Finished]

0 Likes

#2

Does it work if you store your program in a location that’s not being synced by OneDrive?

0 Likes

#3

i just tried that now, it doesn’t work

the error is almost the same

0 Likes

#4

What happens if you open a windows command prompt and try to run “python”?

0 Likes

#5

it says this

C:\Users\Gaming>python
Python 3.9.2 (tags/v3.9.2:1a79785, Feb 19 2021, 13:44:55) [MSC v.1928 64 bit (AMD64)] on win32
Type “help”, “copyright”, “credits” or “license” for more information.

0 Likes

#6

i uninstalled the app several times and it still says the same thing

0 Likes

#7

Does running the full command from the command line work?

0 Likes

#8

how do i do that?
sorry for the stupid question

0 Likes

#9

Open up cmd.exe and type in python -u "C:\Users\Gaming\OneDrive\Desktop\cartofia game\cartofia.py".

0 Likes

#10

@bschaaf it says this, but i have the image in the directory

0 Likes

#11

i did what it says here but it still didn’t work

0 Likes

#12

Can you paste the full custom build system you’re using?

0 Likes

#13

this?
“cmd”: [“g++”, “-std=gnu++11”, “${file}”, “-o”, “${file_path}/${file_base_name}”],
“file_regex”: “^(…[^:]):([0-9]+):?([0-9]+)?:? (.)$”,
“working_dir”: “${file_path}”,
“selector”: “source.c, source.c++”,

"variants":
[
    {
        "name": "Run",
        "cmd": ["${file_path}/${file_base_name}"]
    }
]

}

0 Likes

#14

That build system is executing g++ to compile and link a C++ file; that not the build that you’re using because you’re using Python.

0 Likes

#15

what should i use?

0 Likes

#16

This line in your original post shows you exactly what command your sublime-build file was trying to execute when it failed. Note that it says shell_cmd and includes python, but the build that you shared above uses cmd and says g++.

So, the build that you’re trying to actually use it correct (though perhaps there’s something about it that’s causing this problem, which is why we’d like to see what it contains) but the one that you picked to show isn’t the correct one.

Look in Tools > Build System for the item that has a checkmark next to it and note the name, then use View Package File from the command line and enter that name and .sublime-build to narrow down and find the correct file (it will be a sublime-build file with exactly the name you see in the menu).

0 Likes

#17

I can’t find python.sublime-build

0 Likes

#18

I created a new build,
image
i don’t have that error any longer, but when i build the game the background music starts but the window doesn’t appear.
i tried building another python file and it works just fine


i tried making another python file with the same code as the game and the same files in the folder but the building result is the same: music starts but no window
Thank you for your help and patience, I just started learning all of this.

0 Likes