"没有构建系统"当试图使用REPL运行python3代码时

时间:2017-02-21 01:31:16

标签: python macos sublimetext3 sublimerepl

我一直在尝试设置我的计算机环境,以便在python3中开始编码。

我开始安装包控制器,然后是sublimeREPL。 按照this question中回答的步骤创建第一个构建系统后。我做了那页上前3个答案中解释的事情。

这很有效,但它在已安装的python2中运行我的程序,而不是我新安装的python3。

我找到了解决此问题的方法here。 我没有采用virtualenv路线,而是遵循MattDMo的解决方案。

更改代码中的两个目录以匹配我:

[
     {
        "id": "tools",
        "children":
        [{
            "caption": "SublimeREPL",
            "mnemonic": "r",
            "id": "SublimeREPL",
            "children":
            [
                {"caption": "Python",
                "id": "Python",

                 "children":[
                    {"command": "repl_open",
                     "caption": "Python 3",
                     "id": "repl_python3",
                     "mnemonic": "p",
                     "args": {
                        "type": "subprocess",
                        "encoding": "utf8",
                        "cmd": ["/usr/local/bin/python3", "-i", "-u"],
                        "cwd": "$file_path",
                        "syntax": "Packages/Python/Python.tmLanguage",
                        "external_id": "python",
                        "extend_env": {"PYTHONIOENCODING": "utf-8"}
                        }
                    },
                    {"command": "repl_open",
                     "caption": "Python 3 - IPython",
                     "id": "repl_python_ipython3",
                     "mnemonic": "p",
                     "args": {
                        "type": "subprocess",
                        "encoding": "utf8",
                        "autocomplete_server": true,
                        "cmd": {
                            "osx": ["/usr/local/bin/python3", "-u", "${packages}/SublimeREPL/config/Python/ipy_repl.py"]
                        },
                        "cwd": "$file_path",
                        "syntax": "Packages/Python/Python.tmLanguage",
                        "external_id": "python",
                        "extend_env": {
                            "PYTHONIOENCODING": "utf-8",
                            "SUBLIMEREPL_EDITOR": "$editor"
                        }
                    }
                    }
                ]}
            ]
        }]
    }
]

现在,当我尝试构建'我编写的简单程序,在屏幕底部显示" No Build System"。

0 个答案:

没有答案