python - Sublime Text : "The system cannot find the file specified" error

标签 python sublimetext3 sublimetext

首先,我知道这个问题被问了很多很多次,但是通过阅读其他答案,我没有找到问题的答案。

我正在使用 Sublime Text 3,但根本无法理解构建系统!

我有最简单的 Python 文件,仅包含 print 'test'

我的构建文件并不复杂,因为它是:

{
    "selector": "source.python",
    "cmd": ["echo test"],
}

但是,当尝试运行它时,我得到:

[WinError 2] The system cannot find the file specified
[cmd: ['echo test']]
[dir: C:\P4\depot\test]
[path: C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\CCM;C:\Python27\;C:\Python27\Scripts]
[Finished]

据我了解,出现此错误主要是因为 %PATH% 问题,但我认为这不可能是这里的问题,因为我调用了系统命令。

那么,你知道如何解决这个问题吗?

谢谢:)

最佳答案

对于那些感兴趣的人,答案很简单:改变:

"cmd": ["echo test"]

进入

"shell_cmd": "echo test"

再一次,我的问题与 Python 本身无关,而更多的是在 Sublime Text 中构建系统,我发现这些系统的文档记录非常少。

关于python - Sublime Text : "The system cannot find the file specified" error,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32589479/

相关文章:

python - 关于python3.4.1客户端连接redis中的char b前缀

sublimetext3 - 如何使 Sublime Text 3 使用 rubocop-rspec (`require' : cannot load such file error)

visual-studio-code - 在我的自定义片段中使用 TM_SELECTED_TEXT

java - 有没有办法向 Sublime Text 2 添加对 Java 的自动完成支持?

python - Pandas - 条形图和折线图 - 日期时间轴

c++ - 带有静态链接的 Python 3.3 undefined reference

python - 使用 Pandas str.split 和不同长度的逗号分隔字符串

sublimetext - 具有多个工作区的单个项目?

python - 崇高文本 3 API : Get all text from a file

sublimetext - 在 Sublime Text 2 中使用 Zen Coding for Slim 的任何方法?