<tfoot id='fxepa'></tfoot>
    <i id='fxepa'><tr id='fxepa'><dt id='fxepa'><q id='fxepa'><span id='fxepa'><b id='fxepa'><form id='fxepa'><ins id='fxepa'></ins><ul id='fxepa'></ul><sub id='fxepa'></sub></form><legend id='fxepa'></legend><bdo id='fxepa'><pre id='fxepa'><center id='fxepa'></center></pre></bdo></b><th id='fxepa'></th></span></q></dt></tr></i><div id='fxepa'><tfoot id='fxepa'></tfoot><dl id='fxepa'><fieldset id='fxepa'></fieldset></dl></div>

    <small id='fxepa'></small><noframes id='fxepa'>

      <legend id='fxepa'><style id='fxepa'><dir id='fxepa'><q id='fxepa'></q></dir></style></legend>
        <bdo id='fxepa'></bdo><ul id='fxepa'></ul>
    1. 将 Sublime Text 2 包定向到正确的 python 安装

      Directing Sublime Text 2 Packages to the correct python installation(将 Sublime Text 2 包定向到正确的 python 安装)

            <legend id='ZmfDX'><style id='ZmfDX'><dir id='ZmfDX'><q id='ZmfDX'></q></dir></style></legend><tfoot id='ZmfDX'></tfoot>

              <bdo id='ZmfDX'></bdo><ul id='ZmfDX'></ul>
              <i id='ZmfDX'><tr id='ZmfDX'><dt id='ZmfDX'><q id='ZmfDX'><span id='ZmfDX'><b id='ZmfDX'><form id='ZmfDX'><ins id='ZmfDX'></ins><ul id='ZmfDX'></ul><sub id='ZmfDX'></sub></form><legend id='ZmfDX'></legend><bdo id='ZmfDX'><pre id='ZmfDX'><center id='ZmfDX'></center></pre></bdo></b><th id='ZmfDX'></th></span></q></dt></tr></i><div id='ZmfDX'><tfoot id='ZmfDX'></tfoot><dl id='ZmfDX'><fieldset id='ZmfDX'></fieldset></dl></div>

              <small id='ZmfDX'></small><noframes id='ZmfDX'>

                  <tbody id='ZmfDX'></tbody>
              1. 本文介绍了将 Sublime Text 2 包定向到正确的 python 安装的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                问题描述

                我只想将一个 Sublime Text 2 包 (SublimeREPL) 指向 正确 python 安装——目前,它选择了错误的.

                I just want to direct a Sublime Text 2 Package (SublimeREPL) to the correct python installation--at the moment, it's picking up the wrong one.

                Mac 用户对这里的故事很熟悉.Mac OS 包含一个 python 安装,它用于需要 python 的各种操作系统内容.像许多其他人一样,我不喜欢使用这个系统 python(它位于/System/Library/...),因为它通常已经过时,当然更新它不是一个好主意——它是一个工作 pythonMac OS 使用的安装,以及更新导致依赖于该安装的操作系统任务中断的风险.

                The story here is familiar to Mac users. The Mac OS comes includes a python install which it uses for various OS stuff for which python is required. Like many others, i prefer not to use this system python (which resides in /System/Library/...) becasue it is usually out of date and of course it's not a good idea to update it--it is a working python install used by the Mac OS, and updating risks causing those OS tasks that depend on that install to break.

                但这是 SublimeREPL 包选择的版本:

                But that's the version picked up by the package SublimeREPL:

                Python 2.7.1 (r271:86832, Jun 25 2011, 05:09:01) 
                [GCC 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2335.15.00)] on darwin
                Type "help", "copyright", "credits" or "license" for more information.
                >>> 
                

                我用于开发的版本(安装在/Library/Frameworks/并符号链接到/usr/local/bin)是:

                The version i use for development (and which is installed in /Library/Frameworks/ and symlinked to /usr/local/bin) is:

                @ > python
                Python 2.7.3 (v2.7.3:70274d53c1dd, Apr  9 2012, 20:52:43) 
                [GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin
                Type "help", "copyright", "credits" or "license" for more information.
                >>> 
                

                Sublime 2 Text 在其他地方选择了正确的版本,except 在使用 SublimeREPL 包时,因此必须在该包中的一个配置文件中进行设置,让我将 SublimeREPL 定向到正确的python.

                Sublime 2 Text is picking up the correct version elsewhere, except when using the SublimeREPL Package so there must be a setting in one of the config files in that Package that will let me direct SublimeREPL to the correct python.

                但我找不到它.

                似乎我已经用尽了所有可能的选项,查看我的/Sublime Text 2/Packages/目录必须位于以下任一位置:

                It seems that i have exhausted all plausible options, which, looking through my /Sublime Text 2/Packages/ directory must reside in either:

                SublimeREPL/
                
                    SublimeREPL (OSX).sublime-settings
                    SublimeREPL.sublime-settings
                

                或者

                User/
                
                    SublimeREPL.sublime-settings
                

                其实上面的三个 JSON文件我都添加了如下,没有任何效果:

                In fact, i added the following each of the three JSON files above, with no effect:

                {
                    "default_extend_env": {"PATH": "/Library/Frameworks/Python.framework/Versions/2.7/bin:/usr/local/bin/python2.7:{PATH}"}
                }
                

                推荐答案

                如果你想使用 repl_open 你可以编辑配置中的 cmd 参数.我正在使用 Ubuntu,它位于:

                If you want to use repl_open you could edit the cmd parameter in the config. I am using Ubuntu and it is located in:

                /home/stav/.config/sublime-text-2/Packages/SublimeREPL/config/Python/Main.sublime-menu

                {"command": "repl_open",
                "caption": "Python",
                "id": "repl_python",
                "mnemonic": "p",
                "args": {
                  "type": "subprocess",
                  "encoding": "utf8",
                  "cmd": ["/usr/local/bin/python", "-i", "-u"],
                  "cwd": "$file_path",
                  "syntax": "Packages/Python/Python.tmLanguage",
                  "external_id": "python"
                  }
                },
                

                这篇关于将 Sublime Text 2 包定向到正确的 python 安装的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                相关文档推荐

                env: python: No such file or directory(env: python: 没有这样的文件或目录)
                How to evaluate environment variables into a string in Python?(如何在 Python 中将环境变量评估为字符串?)
                Python - temporarily modify the current process#39;s environment(Python - 临时修改当前进程的环境)
                Change current process environment#39;s LD_LIBRARY_PATH(更改当前进程环境的 LD_LIBRARY_PATH)
                Reading and writing environment variables in Python?(在 Python 中读写环境变量?)
                When to use sys.path.append and when modifying %PYTHONPATH% is enough(何时使用 sys.path.append 以及何时修改 %PYTHONPATH% 就足够了)

                    <i id='kSScz'><tr id='kSScz'><dt id='kSScz'><q id='kSScz'><span id='kSScz'><b id='kSScz'><form id='kSScz'><ins id='kSScz'></ins><ul id='kSScz'></ul><sub id='kSScz'></sub></form><legend id='kSScz'></legend><bdo id='kSScz'><pre id='kSScz'><center id='kSScz'></center></pre></bdo></b><th id='kSScz'></th></span></q></dt></tr></i><div id='kSScz'><tfoot id='kSScz'></tfoot><dl id='kSScz'><fieldset id='kSScz'></fieldset></dl></div>
                    <legend id='kSScz'><style id='kSScz'><dir id='kSScz'><q id='kSScz'></q></dir></style></legend>

                      <tbody id='kSScz'></tbody>

                    <small id='kSScz'></small><noframes id='kSScz'>

                        <bdo id='kSScz'></bdo><ul id='kSScz'></ul>
                          <tfoot id='kSScz'></tfoot>