Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to run a python code on sublime text 3?

i tried to run my code on windows 8 using ctrl+B but it gave the following error.

'python' is not recognized as an internal or external command,
operable program or batch file.
[Finished in 0.1s with exit code 1]
[shell_cmd: python -u "C:\Users\vishal_pc\Documents\python_codes\helloworld.py"]
[dir: C:\Users\vishal_pc\Documents\python_codes]
[path: c:\Program Files (x86)\AMD APP\bin\x86_64;c:\Program Files (x86)\AMD APP\bin\x86;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(R) Management Engine Components\DAL;C:\Program Files\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\IPT;c:\Program Files (x86)\ATI Technologies\ATI.ACE\Core-Static;C:\Program Files (x86)\Windows Live\Shared;C:\Program Files (x86)\QuickTime\QTSystem\;C:\Program Files\Intel\WiFi\bin\;C:\Program Files\Common Files\Intel\WirelessCommon\;C:\Program Files\Microsoft\Web Platform Installer\]

some body please help! thank you.

like image 712
user3275284 Avatar asked Feb 13 '23 21:02

user3275284


2 Answers

It looks like your PATH isn't setup correctly. Sometimes this happens when you install Python in a specific folder instead of the default C:\Python folder (e.g. C:\Python27)

To setup your PATH, right click on 'My Computer' and click 'Properties', then in the 'System Properties' click on the 'Advanced' tab. In the 'System variables' section, you'll see a variable called 'Path'. Now add where you installed Python to that list (additional items are appended with a semicolon).

For example, if you installed on C:\Program Files\Python27 then you would add ";C:\Program Files\Python27" to your PATH variable.

like image 73
Will Avatar answered Feb 16 '23 09:02

Will


Steps to fix it easily [For Pyhton 3.X] 1. Uninstall current version 1. Reinstall Note : Make Sure You Allow the Check box as Shown in the figure [Based on 3.7]

... enter image description here

like image 27
Fitsum Alemu Avatar answered Feb 16 '23 11:02

Fitsum Alemu