Sublime Forum

Keep getting this error when I try to run a program in python

#1

Hi I downloaded python and set a path for it following a tutorial, then I downloaded Sublime Text and tried to run a simple hello world program, I got this error int he console window:

‘python’ is not recognized as an internal or external command,
operable program or batch file.
[Finished in 0.0s with exit code 1]
[shell_cmd: python -u “C:\Users\KingShawnTheGod\Documents\PythonWork\HelloWorld.py”]
[dir: C:\Users\KingShawnTheGod\Documents\PythonWork]
[path: C:\Program Files (x86)\Intel\iCLS Client;C:\Program Files\Intel\iCLS Client;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0;C:\Program Files\Intel\Intel® Management Engine Components\DAL;C:\Program Files (x86)\Intel\Intel® Management Engine Components\DAL;C:\Program Files\Intel\Intel® Management Engine Components\IPT;C:\Program Files (x86)\Intel\Intel® Management Engine Components\IPT;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files\Microsoft SQL Server\110\Tools\Binn;C:\Program Files\Microsoft SQL Server\120\Tools\Binn;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0;C:\Program Files (x86)\GtkSharp\2.12\bin;C:\Program Files\Microsoft SQL Server\130\Tools\Binn\ ;C:\Python36]

0 Likes

#2

The windows error message XXX is not recognized as an internal or external command is telling you that python is not being detected in the PATH properly.

You can verify that the path is set correctly by opening a command prompt in windows and using the command where python to see where it thinks the command is. This will either tell you the full path to the executable or say something like INFO: Could not find files for the given pattern(s), which indicates that the path you’ve set is not correct.

If it tells you a path, you should be able to issue the command python to open a python interpreter.

Here my version of Python is installed in C:\Program Files\Python36. That was the default location that it installed to, and it set the path for me so that I didn’t have to do it myself.

1 Like

#3

Yes I also tried that As well It is working according to the CMD but for some reason it does not work when I run it in sublime text, it still gives me that python is not recognized problem. I followed a tutorial which also told me to copy and enter this source from this website https://packagecontrol.io/installation, i did so and pressed enter I don’t know if that could have caused any problems

0 Likes

#4

Have you restarted Sublime since you installed Python and modified the path?

The only reason I can think of off the top of my head for that not working if it works from the command prompt is that Sublime was running when the path was modified, so it still thinks it’s the value that it was when it was started. Seems unlikely since the path is showing in the command output, though.

Installing Package Control (that’s what pasting that code did for you) shouldn’t cause this sort of problem.

0 Likes

#5

Yes I have I still get the same error as I did in my first post, After i Copy pasted the package control, I then CTRL Shift + P, which then brought up this search type window, i typed python and clicked on “Build with python”, that also did not do anything

0 Likes