为什么我不能在 Sublime text 2 中构建此代码?

Why can't I build this code in Sublime text 2?

我需要建立一个时间表,所以我找到了一个例子(见 In [13], Out [13])

http://playittodeath.ru/анализ-данных-при-помощи-python-графики-в-pandas/

然而,当我将它复制到 Sublime Text 2 中时,我得到了这个输出:

sh: sysctl: command not found
sh: grep: command not found
sh: sw_vers: command not found
sh: grep: command not found
/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/matplotlib/font_manager.py:273: UserWarning: Matplotlib is building the font cache using fc-list. This may take a moment.
  warnings.warn('Matplotlib is building the font cache using fc-list. This may take a moment.')
[Finished in 1.4s]

我使用 MacOS 和 Python 2.7.

当我修改我的 Sublime 构建文件时它起作用了。原文如下:

{
    "cmd": ["python", "-u", "$file"],
    "file_regex": "^[ ]*File \"(...*?)\", line ([0-9]*)",
    "selector": "source.python"
}

这里修改了一个:

{
    "path": "/Library/Frameworks/Python.framework/Versions/2.7/bin/",
    "cmd": ["python2.7", "-u", "$file"],
    "file_regex": "^[ ]*File \"(...*?)\", line ([0-9]*)",
    "selector": "source.python"
}

要获取您需要的路径,您应该在终端中 运行 which python 并将其复制到 "path" 中。然后你应该 运行 open *your path* 在你的终端中找到 pyhon.exe 或者它可以通过 python pythonversion .exe 并将其名称放入 "cmd".