Sublime Forum

Yet another Winerror 2

#1

New user, struggling to get it running with python3.9 and get this error, thoughts?

[WinError 2] The system cannot find the file specified
[cmd: [‘python3.9’, ‘-u’, ‘’]]
[dir: C:\Program Files\Sublime Text 3]
[path: C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0;C:\WINDOWS\System32\OpenSSH;C:\Program Files\Microsoft SQL Server\Client SDK\ODBC\110\Tools\Binn;C:\Program Files (x86)\Microsoft SQL Server\120\Tools\Binn;C:\Program Files\Microsoft SQL Server\120\Tools\Binn;C:\Program Files\Microsoft SQL Server\120\DTS\Binn;C:\Program Files (x86)\Windows Kits\8.1\Windows Performance Toolkit;C:\Program Files (x86)\Calibre2;c:\ediabas\bin;C:\Users\jerry\AppData\Local\Microsoft\WindowsApps;C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.9_3.9.496.0_x64__qbz5n2kfra8p0;]
[Finished]

Using this config file:
{
“cmd”: [“python3.9”, “-u”, “$file”],
}

0 Likes

#2

The error is an indication that python3.9 is not available on the PATH, and thus Windows can’t find it to execute it. You can verify that by opening a command prompt and trying to run python3.9 from there.

Your path includes C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.9_3.9.496.0_x64__qbz5n2kfra8p0, so you may want to look in there and see if there’s an executable in there; it’s likely just named python.exe or similar.

This is the command that you’re executing; third argument is $file, which expands out to the name of the current file on disk.

This is the command as it was executed; note that the last argument given is ''; that means that you didn’t save your Python file to disk at least once to give it a name. In that case even if python3.9 was executed, there’s nothing for it to do because it doesn’t know what file to execute (because there isn’t one).

So, you want to make sure you also save the file once as well.

0 Likes

#3

ON,
I can run python3.9 from a cmd line. However, after saving the test (import sys) file I ran again and got this:

[WinError 2] The system cannot find the file specified
[cmd: [‘python3.9’, ‘-u’, ‘C:\Users\jerry\import sys’]]
[dir: C:\Users\jerry]
[path: C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0;C:\WINDOWS\System32\OpenSSH;C:\Program Files\Microsoft SQL Server\Client SDK\ODBC\110\Tools\Binn;C:\Program Files (x86)\Microsoft SQL Server\120\Tools\Binn;C:\Program Files\Microsoft SQL Server\120\Tools\Binn;C:\Program Files\Microsoft SQL Server\120\DTS\Binn;C:\Program Files (x86)\Windows Kits\8.1\Windows Performance Toolkit;C:\Program Files (x86)\Calibre2;c:\ediabas\bin;C:\Users\jerry\AppData\Local\Microsoft\WindowsApps;C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.9_3.9.496.0_x64__qbz5n2kfra8p0;]
[Finished]

0 Likes

#4

What’s the result of where python3.9.exe?

0 Likes

#5

Have you saved your file somewhere with a .py extension? Looks like it’s trying to run C:\Users\jerry\import sys indicating you haven’t done so.

0 Likes

#6

0 Likes

#7

[WinError 2] The system cannot find the file specified
[cmd: [‘python3.9’, ‘-u’, ‘C:\Users\jerry\import sys.py’]]
[dir: C:\Users\jerry]
[path: C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0;C:\WINDOWS\System32\OpenSSH;C:\Program Files\Microsoft SQL Server\Client SDK\ODBC\110\Tools\Binn;C:\Program Files (x86)\Microsoft SQL Server\120\Tools\Binn;C:\Program Files\Microsoft SQL Server\120\Tools\Binn;C:\Program Files\Microsoft SQL Server\120\DTS\Binn;C:\Program Files (x86)\Windows Kits\8.1\Windows Performance Toolkit;C:\Program Files (x86)\Calibre2;c:\ediabas\bin;C:\Users\jerry\AppData\Local\Microsoft\WindowsApps;C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.9_3.9.496.0_x64__qbz5n2kfra8p0;]
[Finished]

0 Likes