0

In VS Code, I have installed autopep8 and verified that the path is correct. I can use autopep8 in the terminal without any issues. However, when I search for the "python run" item in the Command Palette, I see all the other options from the extension except autopep8.

I have attempted to change the path of autopep8 to use the version installed in my machine's Python installation, but that didn't resolve the issue.

Martin
  • 46
  • 9
  • Did you catch the notes in the VSC plugin? It details what is expected to be set and how the plugin functions. – JonSG Jan 21 '23 at 21:38

1 Answers1

1

You can search Python.Formatting.Provider in settings and choose autopep8:

enter image description here

Or you can add the following codes to your settings.json:

"python.formatting.provider": "autopep8",

When you want to use format function, you can use shortcuts "Ctrl+Shift+P" and search "Format Document".

BTW, I suggest you add the following codes to your settings.json as well:

  "editor.formatOnPaste": true,
  "editor.formatOnSave": true,
  "editor.formatOnType": true,
MingJie-MSFT
  • 5,569
  • 1
  • 2
  • 13