Sublime Forum

[WinError 2] The system cannot find the file specified (yet again)

#1

Hi
Installed Python 3.7.3 64-bit version, with option “Add Python 3.7 to PATH” ticked.Runs OK in command window.
Installed Sublime Text Build 3207 x64. I get the following error just trying to run a Hello World. I’ve uninstalled and reinstalled everything 5 or more times. Have also checked similar topics in the forum, but still stuck. Can anyone help please?

[WinError 2] The system cannot find the file specified
[cmd: [‘python3’, ‘-u’, ‘C:\Users\John\Desktop\python_work\hello_world.py’]]
[dir: C:\Users\John\Desktop\python_work]
[path: C:\ProgramData\Oracle\Java\javapath;C:\Program Files (x86)\Intel\iCLS Client;C:\Program Files\Intel\iCLS Client;C:\Program Files\Broadcom\Broadcom 802.11

0 Likes

#2

What OS are you on?

Your PATH doesn’t contain paths to Python directories. If you are on Windows 7, you need to relogin after the PATH was changed. On 10 it should be enough to just relaunch ST (from explorer.exe) to make it pick up the updated PATH.

If nothing works, you can always add the Python path to your system’s PATH environemnt variable manually. Refer to some online manual specific to your OS version.

0 Likes

#3

Thank you FichteFoll. Sorry I omitted to give the OS - it’s Windows 10.
I reran sublime_text.exe, which is what I understood you to mean, but this didn’t fix it. I foolishly didn’t display the whole PATH in my post - sorry again. It does actually already contain the python37 directories, as below. So I’m still stuck at the moment, but thank you again for your help.

[path: C:\ProgramData\Oracle\Java\javapath;C:\Program Files (x86)\Intel\iCLS Client;C:\Program Files\Intel\iCLS Client;C:\Program Files\Broadcom\Broadcom 802.11 Network Adapter;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0;C:\Program Files (x86)\MiKTeX 2.9\miktex\bin;C:\WINDOWS\System32\OpenSSH;C:\Users\John\AppData\Local\Programs\Python\Python37\Scripts;C:\Users\John\AppData\Local\Programs\Python\Python37;C:\Users\John\AppData\Local\Programs\Python\Launcher;c:\users\john\appdata\local\enthought\canopy32\user\scripts;C:\Users\John\AppData\Local\Enthought\Canopy32\User;C:\Users\John\AppData\Local\Enthought\Canopy32\User\Scripts;C:\Users\John\AppData\Local\Microsoft\WindowsApps;]
[Finished]

0 Likes

#4

Okay, that should confirm that you most likely have the executable in your PATH. Though, could you test whether you can run python3from a console? If not, doespythonorpy` work?

What build system are you using, I. E. Is it from the default python package or do you have a third party installed?

0 Likes

#5

Thanks FichteFoll. I’ve actually managed to get it working - not 100% sure how, but I think it’s probably connected with what seemed to be a spurious version of the build file in the Users folder under AppData\Roaming. Thank you again for your assistance and patience. Best wishes.

0 Likes