我不明白为什么 Sublime Text 3 的控制台无法访问任何 PATH 命令。python
并coffee
返回“未定义”错误。我尝试了很多不同的东西:
我已经Python.sublime-settings
在 Packages/Python 中添加了一个并且我一直在尝试找到正确的路径
{
"env" :
{
"PYTHONPATH" : "/usr/local/bin/python:/usr/local/share/python:/usr/local/lib/python:/usr/local/Cellar/python/2.7.5/lib/python2.7/site-packages"
//"PYTHONPATH" : "/usr/local/git/bin:/usr/local/sbin:/usr/local/share/python:/Users/zak/.nvm/v0.10.0/bin:/opt/local/bin:/opt/local/sbin:/Users/zak/.rvm/gems/ruby-2.0.0-p0/bin:/Users/zak/.rvm/gems/ruby-2.0.0-p0@global/bin:/Users/zak/.rvm/rubies/ruby-2.0.0-p0/bin:/Users/zak/.rvm/bin:/opt/local/bin:/opt/local/sbin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin:/usr/local/git/bin:/opt/local/bin"
},
"path": "/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/local/bin/python:/usr/local/bin/python:/usr/local/share/python:/usr/local/lib/python",
// "cmd": ["/usr/local/bin/python", "-u", "$file"],
"cmd": ["python", "-u", "$file"],
"file_regex": "^[ ]*File \"(...*?)\", line ([0-9]*)",
"selector": "source.python"
}
我也试过添加path.py
一个Packages/User
:
导入操作系统
LOCAL = '/usr/local/git/bin:/usr/local/sbin:/usr/local/share/python:/Users/zak/.nvm/v0.10.0/bin:/opt/local/bin:/opt/local/sbin:/Users/zak/.rvm/gems/ruby-2.0.0-p0/bin:/Users/zak/.rvm/gems/ruby-2.0.0-p0@global/bin:/Users/zak/.rvm/rubies/ruby-2.0.0-p0/bin:/Users/zak/.rvm/bin:/opt/local/bin:/opt/local/sbin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin:/usr/local/git/bin:/opt/local/bin'
os.environ['PATH'] += ':'
os.environ['PATH'] += LOCAL
# print('PATH = ' + os.environ['PATH'])
没有任何效果。我不仅不能从控制台使用python
和coffee
使用这些库,而且我安装的使用这些库的包也失败了。如何让 Sublime Text 3 使用正确的 PATH 和环境变量?