我正在使用 brew 在 /usr/local/bin/ 中安装 python (2.7.2) 但是,默认系统 python (2.7.1) 是在执行的/usr/bin/
,这似乎是因为它不遵守任何bash PATH 环境变量。此外,它找不到我的模块,因为它们安装在/usr/local/lib/python:/usr/local/Cellar/python/2.7.2/lib/python2.7/site-packages
.
我一直在尝试以下方法Python.sublime-settings
,但它不起作用:
{
"path": "/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin",
"env": ["PYTHONPATH", "/usr/local/lib/python:/usr/local/Cellar/python/2.7.2/lib/python2.7/site-packages"],
"cmd": ["python", "-u", "$file"],
"file_regex": "^[ ]*File \"(...*?)\", line ([0-9]*)",
"selector": "source.python"
}
如何让 Sublime Text 服从这些环境变量?