如何在 sublime text 3 上运行 python 代码? [英] How to run a python code on sublime text 3?

查看:58
本文介绍了如何在 sublime text 3 上运行 python 代码?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

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.

推荐答案

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

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)

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

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).

例如,如果您安装在 C:\Program Files\Python27 上,那么您需要将;C:\Program Files\Python27"添加到您的 PATH 变量中.

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

这篇关于如何在 sublime text 3 上运行 python 代码?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆