Autoformatting failed, buffer not changed : Sublime text

1.5k Views Asked by At

While setting up Python Development Environment in Sublime text 3, I wanted Auto formatting on and hence I made the following settings in 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"
}

The auto_formatting value is set to true in user settings and it is set to false in default settings . The auto formatting does not work out and gives me Autoformatting failed, buffer not changed error . Also tried changing auto_formatting_timeout = 5 //seconds , but that didn't work out . It would be of great help if someone could help me out .

2

There are 2 best solutions below

0
On

I had the exact same issue. The problem is the last line is pointing to the wrong path for your python interpreter

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"

IMPORTANT: Your python interpreter path might be different to mine so find out where it is. Remember you need to use TWO backslashes in the path not ONE

0
On

Sublime is looking for python in environmental variable when you build it, and it is not able to find it there. You can test it in cmd by typing python and if it opens Microsoft store then here is the fix you can do, it worked for me. Open setting -> search for manage app execution aliases -> turn off "python.exe" and "python3.exe". Now check if you can get python in cmd by typing python, if you do then sublime problem should be fixed. If you want to know why this works follow this stack overflow