mac的sublime text3的python3环境无法输出中文

Launchpad中进入其他,选择其中的“终端”


输入which python3,目的是得到python3的路径


如图所示。

然后在sublime text3中选择Tools-->Build System-->New Build System(最下面一个)


输入如下内容,其中cmd中的第一个引号内替换成自己刚才终端得到的路径

{
"cmd": ["/Library/Frameworks/Python.framework/Versions/3.6/bin/python3","-u","$file"],
"file_regex": "^[ ]File \"(...?)\", line ([0-9]*)",
"selector": "source.python",
"env": {"PYTHONIOENCODING": "utf8"},
}


保存成python3.sublime-build即可


参考:http://blog.csdn.net/z5fn1v13/article/details/54946147