【问题标题】:Autoformatting failed, buffer not changed : Sublime text自动格式化失败,缓冲区未更改:崇高文本
【发布时间】:2020-11-08 00:51:29
【问题描述】:

在 Sublime text 3 中设置 Python 开发环境时,我想要自动格式化,因此我在 Preferences > Package settings > Anaconda > Settings User 中进行了以下设置

{
    "auto_formatting": true,
    "autoformat_ignore":
    [
    ],
    "pep8_ignore":
    [
        "E501"
    ],
    "anaconda_linter_underlines": false,
    "anaconda_linter_mark_style": "none",
    "display_signatures": false,
    "disable_anaconda_completion": true,
    "python_interpreter": "/usr/local/bin/python3"
}

auto_formatting 值在用户设置中设置为 true,在默认设置中设置为 false。 自动格式化不起作用并给我 Autoformatting failed, buffer not changed 错误。还尝试更改 auto_formatting_timeout = 5 //seconds ,但 没有成功。如果有人可以帮助我,那将是非常有帮助的。

【问题讨论】:

    标签: sublimetext3 python-3.8 autoformatting sublime-anaconda


    【解决方案1】:

    我遇到了完全相同的问题。问题是最后一行指向你的 python 解释器的错误路径

    Preferences > Package Settings > Anaconda > Settings - User
    
    Delete the last line   
    "python_interpreter": "/usr/local/bin/python3"
    
    Replace it with  
    "python_interpreter": "C:\\Users\\YOUR_NAME\\AppData\\Local\\Programs\\Python\\Python38-32\\python.EXE"
    

    重要提示:您的 python 解释器路径可能与我的不同,因此请找出它在哪里。请记住,您需要在路径中使用两个反斜杠而不是一个

    【讨论】:

      【解决方案2】:

      Sublime 在您构建它时正在环境变量中寻找python,但它无法在那里找到它。您可以通过键入python 在 cmd 中对其进行测试,如果它打开 Microsoft 商店,那么这是您可以做的修复,它对我有用。打开设置 -> 搜索manage app execution aliases -> 关闭“python.exe”和“python3.exe”。现在检查是否可以通过键入python 在cmd 中获得python,如果可以,则应该修复sublime 问题。如果您想知道为什么会这样,请关注stack overflow

      【讨论】:

        猜你喜欢
        • 2016-09-14
        • 1970-01-01
        • 2014-02-07
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2015-04-13
        相关资源
        最近更新 更多