So I’ve installed sublime text fine on my other computer and code runs fine on it. However, when I installed it on my laptop I get this error:
[WinError 2] The system cannot find the file specified
[cmd: [‘py’, ‘-u’, ‘C:\Users\S A hussain\Downloads\Boilerplate-arithmetic-formatter.py’]]
[dir: C:\Users\S A hussain\Downloads]
[path: C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0;C:\WINDOWS\System32\OpenSSH;C:\Program Files\Calibre2;C:\Program Files\AMD\AMDuProf\bin;C:\Program Files\Sublime Text\Lib\python38;C:\Users\S A hussain\AppData\Local\Microsoft\WindowsApps;]
[Finished]
I know this error has been shown on other forum posts but I don’t understand them or they’re on mac. I’m doing this with a python program.
[WinError 2] The system cannot find the file specified Python (again)
If you open a command prompt and type where py
, what does it say?
The default Python
build in ST4 has been augmented to work better on Windows by using the Python py
helper that Python installs into your Windows folder (which is always on the PATH
) to execute Python.
Additionally, your PATH
as per the build above looks like it contains the Sublime Text python library directory. If you added that thinking that Sublime comes with a Python interpreter that you can use, that’s not actually the case. That folder is a place to put libraries so that the embedded Python in Sublime (used for plugins) can see them.
If that’s the case, then installing Python should solve your problem (make sure you say yes if it asks you about the py
helper though).
Thanks for the quick reply:
I tried to follow some other posts before and I added that to my PATH trying to fix it. Here is what shows:
C:\Users\S A hussain>where py
INFO: Could not find files for the given pattern(s).