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

时间:2016-07-26 12:59:30

标签: python python-2.7 pandas matplotlib sublimetext2

我需要建立一个时间表,所以我找到了一个例子(参见[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。

1 个答案:

答案 0 :(得分:-1)

当我修改我的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并将其复制到“路径”中。然后你应该在你的终端中运行open *your path*并找到pyhon.exe,或者它可以通过python python 版本 .exe并将它的名字放在“cmd”中。