ST3 + virtualenv + Anaconda 的环境. 做 Python 开发
创建一个项目 编写 project 配置文件
{
"settings":
{
"python_interpreter": "D:\\coding\\web\\Scripts\\python.exe",
"extra_paths":
[
"D:\\coding\\web\\Lib\\site-packages"
]
},
"build_systems":
[
{
"file_regex": "^[ ]*File \"(...*?)\", line ([0-9]*)",
"name": "Anaconda Python Builder",
"selector": "source.python",
"env": {"PYTHONIOENCODING": "utf8"},
"shell_cmd": "\"D:\\coding\\web\\Scripts\\python.exe\" -u \"$file\""
}
],
"folders":
[
{
// "follow_symlinks": true,
"path": "."
}
],
"virtualenv": "D:\\coding\\web"
}
主要是为了添加 Build_systems 中的"env": {"PYTHONIOENCODING": "utf8"},这个参数, 否则输出结果会乱码.
配置好之后, 关闭工程. 再次打开工程, 选中任意.py 文件后再次查看 sublime-project 配置文件, 就会变成默认的配置: 之前添加的"env": {"PYTHONIOENCODING": "utf8"},没有了...
{
"build_systems":
[
{
"file_regex": "^[ ]*File \"(...*?)\", line ([0-9]*)",
"name": "Anaconda Python Builder",
"selector": "source.python",
"shell_cmd": "\"d:\\code\\web\\Scripts\\python.exe\" -u \"$file\""
}
],
"folders":
[
{
"path": "."
}
],
"settings":
{
"extra_paths":
[
"D:\\code\\web\\Lib\\site-packages"
],
"python_interpreter": "D:\\code\\web\\Scripts\\python.exe"
},
"virtualenv": "D:\\code\\web"
}
一直想不通为什么...从哪个方向入手排查问题?
1
jeeyong OP |