gpt4 book ai didi

environment-variables - Sublime Text 2 : custom PATH and PYTHONPATH

转载 作者:行者123 更新时间:2023-12-03 06:13:13 25 4
gpt4 key购买 nike

我正在使用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 遵守这些环境变量?

最佳答案

env 需要是一个 JSON 对象,或者字典(如果你愿意的话),如下所示:

"env":
{
"PYTHONPATH":"/usr/local/lib/python:/usr/local/Cellar/python/2.7.2/lib/python2.7/site-packages"
},

关于environment-variables - Sublime Text 2 : custom PATH and PYTHONPATH,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8574919/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com