If I disabled Prettier as the default formatter, it would not format on save anymore, but my Python would be formatted by autopep8 on save. With this in mind, the following solution worked for me to have both Prettier working for other languages and autopep8 for Python:

{
  "workbench.iconTheme": "vscode-icons",
  "workbench.editorAssociations": [
    {
      "viewType": "jupyter.notebook.ipynb",
      "filenamePattern": "*.ipynb"
    }
  ],
  "git.confirmSync": false,
  "editor.formatOnPaste": true,
  "editor.formatOnSave": true,
  "python.formatting.provider": "autopep8",
  "explorer.confirmDelete": false,
  "python.showStartPage": false,
  "explorer.confirmDragAndDrop": false,
  "python.linting.pylintArgs": ["--load-plugins=pylint_django"],
  "javascript.updateImportsOnFileMove.enabled": "always",
  "editor.defaultFormatter": "esbenp.prettier-vscode",
  "[python]": {
    "editor.defaultFormatter": "ms-python.python"
  }
}

Let me know if somebody finds a better solution!

Answer from round_circle on Stack Overflow
🌐
Visual Studio Code
code.visualstudio.com › docs › python › formatting
Formatting Python in VS Code
November 3, 2021 - Missed Agent Sessions Day? Watch on-demand now · Formatting makes source code easier to read by human beings. By enforcing particular rules and conventions such as line spacing, indents, and spacing around operators, the code becomes more visually organized and comprehensible.
🌐
DEV Community
dev.to › eegli › quick-guide-to-python-formatting-in-vs-code-2040
Quick Guide to Python Formatting in VS Code (2025) - DEV Community
February 1, 2025 - I prefer applying this configuration to my user settings - this way, I can easily start a Python project and will get formatting out of the box based on my user settings. No need to create dedicated workspace settings for every single project and override the formatter over and over. Here's the relevant config from my settings: { "editor.defaultFormatter": "esbenp.prettier-vscode", "[python]": { "editor.defaultFormatter": null }, "python.formatting.blackArgs": ["--line-length", "120"], "python.formatting.provider": "black", }
🌐
GitHub
github.com › prettier › prettier-vscode
GitHub - prettier/prettier-vscode: Visual Studio Code extension for Prettier · GitHub
Visual Studio Code extension for Prettier. Contribute to prettier/prettier-vscode development by creating an account on GitHub.
Starred by 5.5K users
Forked by 509 users
Languages   TypeScript 78.3% | JavaScript 20.3% | PHP 0.6% | Dockerfile 0.3% | HTML 0.3% | SCSS 0.1%
🌐
Hostman
hostman.com › tutorials › how to format code with prettier in visual studio code
How to Format Code Using Prettier in Visual Studio Code
October 20, 2025 - This utility automatically formats Python code according to PEP 8, the official Python style guide, using pycodestyle to identify areas needing formatting. Autopep8 can fix most issues flagged by pycodestyle. To avoid the need for manual formatting each time, enable auto-formatting on save in Prettier:
Price   $
Address   1999 Harrison St 1800 9079, 94612, Oakland
🌐
YouTube
youtube.com › watch
How to Format Python Code on Save in Visual Studio Code | Auto-Format Python in VS Code - YouTube
🚀 **Automatically Format Python Code on Save in VS Code!** Tired of fixing code formatting manually? In this quick and easy tutorial, I’ll show you how to ...
Published   February 22, 2025
🌐
JustAnswer
justanswer.com › computer › rd8ph-want-set-extension-prettier-vs-code-save.html
How to Set Prettier as VS Code Save Formatter?
2. Right-click inside the file. 3. Select "Format Document With...". 4. Then choose "Configure Default Formatter..." and select "Prettier - Code formatter".This will set Prettier as the default formatter for JSX files.
Find elsewhere
🌐
freeCodeCamp
freecodecamp.org › news › how-to-use-prettier-in-visual-studio-code
How To Use Prettier in Visual Studio Code
March 18, 2024 - In this guide, you will learn how to install Prettier in Visual Studio Code and how to use it to format code.
🌐
GitHub
github.com › prettier › prettier-vscode › issues › 1395
Extension 'prettier - Code formatter' cannot format "hello.py" · Issue #1395 · prettier/prettier-vscode
May 24, 2020 - Summary I used to write javascript only in vs code and everything works fine. But now I start learning python. When I hit ctrl-s will see this warning: Extension 'prettier - Code formatter' cannot ...
Published   May 24, 2020
Author   krave1986
🌐
Medium
medium.com › @glen.gracieux › auto-formatting-on-vs-code-using-prettier-extension-743b88f1539d
Auto formatting on VS Code using Prettier extension. - Glen Paulson - Medium
August 26, 2023 - Auto formatting on VS Code using Prettier extension. Steps to enable Prettier code formatter extension on VS Code Step 1 → Open VS Code → Navigate to Extensions → Search for Prettier → …
🌐
Reddit
reddit.com › r › vscode › comments › 95lsb8 › a_better_python_formatter
r/vscode on Reddit: A better Python formatter?
August 10, 2017 - Maybe autopep8 that supports Python 2...this one allows for more configuration.
🌐
DigitalOcean
digitalocean.com › community › tutorials › how-to-format-code-with-prettier-in-visual-studio-code
Format Code with Prettier in Visual Studio Code: Setup Guide | DigitalOcean
August 1, 2025 - To make sure Visual Studio Code uses Prettier for all formatting operations: Open Settings (JSON) via the Command Palette. ... You can apply this setting globally or in a workspace-specific .vscode/settings.json file.
🌐
Prettier
prettier.io
Prettier · Opinionated Code Formatter · Prettier
prettier-vscode · Built-in support · Got more?Send a PR · See others · Regularly used by: More than 83% of respondents to State of JS 2021. More than 70% of respondents to State of JS 2020. More than 9.9 million dependent repositories on GitHubCheck Them Out ·
🌐
GitHub
github.com › prettier › plugin-python
GitHub - prettier/plugin-python: Prettier Python Plugin · GitHub
Prettier Python Plugin. Contribute to prettier/plugin-python development by creating an account on GitHub.
Starred by 520 users
Forked by 38 users
Languages   JavaScript 72.2% | Python 27.8%
🌐
TMS Outsource
tms-outsource.com › home › how to use prettier in vscode to format code
How to Use Prettier in VSCode to Format Code
December 18, 2025 - Navigate to File > Preferences > Settings (or press Ctrl+,), search for “Default Formatter” in the search bar, then select “esbenp.prettier-vscode” from the dropdown menu to make Prettier handle all code formatting tasks.
🌐
Donjayamanne
donjayamanne.github.io › pythonVSCodeDocs › docs › formatting
Formatting | Python in Visual Studio Code
"python.formatting.yapfArgs": ["--style", "{based_on_style: chromium, indent_width: 20}"]