1

I have a file named test.py with the following contents:

print ("Welcome")

Running this in Sumblime Text results with the following error in output:

[WinError 2] The system cannot find the file specified
[cmd: ['C:\\Users\\Mark\\AppData\\Local\\Programs\\Python\\Python35-32\\Python.exe', '-u', 'C:\\Users\\Mark Kaganovich\\Desktop\\test.py']]
[dir: C:\Users\Mark Kaganovich\Desktop]
[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:\Program Files\Java\jre1.8.0_171\bin;C:\Users\Mark Kaganovich\AppData\Local\Programs\Python\Python37-32;C:\Users\Mark Kaganovich\AppData\Local\Programs\Python\Python37-32\python.exe;C:\Users\Mark Kaganovich\AppData\Local\Programs\Python\Python37-32\Scripts\;C:\Users\Mark Kaganovich\AppData\Local\Programs\Python\Python37-32\;C:\Users\Mark Kaganovich\AppData\Local\Microsoft\WindowsApps;]
[Finished]
zvone
  • 18,045
  • 3
  • 49
  • 77
  • 5
    Please do not post code as images – U13-Forward Jul 01 '18 at 05:50
  • 1
    @Kaganovich I've edited your question, here is why: the code should not be in an image, the text should contain the code and other important information (e.g. the fact that sublime text is used is very important here), python-3 tag should not be used if the question is not specific to python 3, the title should say what the question is about, not just "help me" or something similar to that. See also https://stackoverflow.com/help/how-to-ask – zvone Jul 01 '18 at 08:45

1 Answers1

0

It seems your python path in environment variables is differ than python you ran.

Your python path is:

C:\Users\Mark Kaganovich\AppData\Local\Programs\Python\Python37-32

But your command is searching for:

C:\Users\Mark Kaganovich\AppData\Local\Programs\Python\Python35-32

If you are sure that you have Python35-32 then just add it to environment variables.

Here is instructions for adding python path to environment variables:

How to add to the pythonpath in Windows?

Ali Shahrivarian
  • 311
  • 2
  • 11
  • @KaganovichMark run `CMD` and go to `C:\Users\Mark Kaganovich\AppData\Local\Programs\Python\Python37-32` then run `Python.exe` from here and pass your `python` file `path` to it. – Ali Shahrivarian Jul 01 '18 at 06:02
  • @KaganovichMark I seen your error pic. Still have wrong `path` in your environment. Your account name is just `Mark` instead of `Mark Kaganovich`. Check that. – Ali Shahrivarian Jul 01 '18 at 06:04