如何在sublime文本3上运行python代码?

时间:2014-02-05 13:05:20

标签: python sublimetext3

我尝试使用ctrl + B在Windows 8上运行我的代码,但它出现以下错误。

'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\]
有些身体请帮忙! 谢谢。

2 个答案:

答案 0 :(得分:6)

看起来您的PATH设置不正确。有时,当您在特定文件夹而不是默认的C:\ Python文件夹(例如C:\ Python27)中安装Python时会发生这种情况

要设置PATH,请右键单击“我的电脑”,然后单击“属性”,然后在“系统属性”中单击“高级”选项卡。在“系统变量”部分中,您将看到一个名为“路径”的变量。现在将Python的安装位置添加到该列表中(其他项目附加分号)。

例如,如果您安装在C:\ Program Files \ Python27上,那么您应该将“; C:\ Program Files \ Python27”添加到PATH变量中。

答案 1 :(得分:0)

轻松修复它的步骤[对于Pyhton 3.X] 1.卸载当前版本 1.重新安装 注意:确保允许复选框如图[基于3.7]

所示。

... enter image description here