我几乎要疯了,想弄清楚这件事,但我知道我已经很接近了。
我想要更改SublimeText2使用的Python
我在ST2中运行Python,但它不是我想要的版本。
import sys
print sys.executable
>>>> /usr/bin/python我想要的版本在终端中。
me_user$ which python
>>>> //anaconda/bin/python我想在ST2中使用Anaconda python,而不是/usr/bin/python。
但是我不知道如何更改ST2中的路径来读取蟒蛇版本的python。
有什么帮助吗?
.更新.....
我遵循了Jerome的说明,但现在我得到了一个错误。
下面是我的构建路径:
{
"path": "/anaconda/bin/python",
"cmd": ["python2.7", "$file"],
"file_regex": "^[ ]*File \"(...*?)\", line ([0-9]*)",
"selector": "source.python"
}下面是错误:
import sys
print(sys.version)
[Errno 20] Not a directory
[cmd: [u'python2.7', u'/Users/robertdefilippi/Desktop/test2.py']]
[dir: /Users/robertdefilippi/Desktop]
[path: /anaconda/bin/python]
[Finished]我现在做错了什么?
发布于 2014-12-09 11:13:18
我想通了。
我使用:
echo $PATH来获得完整的路径范围。
然后,我将路径复制到
选择器{ "path":"PATH","cmd":"python2.7","$file","file_regex":"^ *文件\"(...*?)\",line (0-9*)","selector":"source.python“}
它是有效的:)
https://stackoverflow.com/questions/27370513
复制相似问题